From 931fbc67b4911e65b0c8809b636f672ed501f3d1 Mon Sep 17 00:00:00 2001 From: Thomas McDonald Date: Sat, 12 May 2012 08:24:22 +0100 Subject: [PATCH] Add rake:debug task to quickly build the CSS Previously to ensure that changes have been working it was required to build the gem and then push it to a sample application (e.g. Rails & Compass). The rake:debug task uses plain Sass - as we do for testing, and creates the file 'debug.css' without having to rebuild the Gem and fire up an application. --- .gitignore | 3 ++- Rakefile | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 43ee303c..bc239884 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.gem -.sass-cache \ No newline at end of file +.sass-cache +debug.css \ No newline at end of file diff --git a/Rakefile b/Rakefile index cc6711fc..b5dc5da5 100644 --- a/Rakefile +++ b/Rakefile @@ -5,4 +5,14 @@ Rake::TestTask.new do |t| t.verbose = true end +desc 'Dumps output to a CSS file for testing' +task :debug do + require 'sass' + require './lib/bootstrap-sass/compass_functions' + require './lib/bootstrap-sass/rails_functions' + path = './vendor/assets/stylesheets' + engine = Sass::Engine.for_file("#{path}/_bootstrap.scss", syntax: :scss, load_paths: [path]) + File.open('./debug.css', 'w') { |f| f.write(engine.render) } +end + task default: :test \ No newline at end of file