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.
This commit is contained in:
parent
cf14f13b44
commit
931fbc67b4
|
@ -1,2 +1,3 @@
|
||||||
*.gem
|
*.gem
|
||||||
.sass-cache
|
.sass-cache
|
||||||
|
debug.css
|
10
Rakefile
10
Rakefile
|
@ -5,4 +5,14 @@ Rake::TestTask.new do |t|
|
||||||
t.verbose = true
|
t.verbose = true
|
||||||
end
|
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
|
task default: :test
|
Loading…
Reference in New Issue