Class: Guard::Sprockets2::Compiler
- Inherits:
-
Object
- Object
- Guard::Sprockets2::Compiler
- Defined in:
- lib/guard/sprockets2/compiler.rb
Instance Method Summary collapse
- #clean ⇒ Object
- #compile ⇒ Object
-
#initialize(options = {}) ⇒ Compiler
constructor
A new instance of Compiler.
Constructor Details
#initialize(options = {}) ⇒ Compiler
Returns a new instance of Compiler.
3 4 5 6 |
# File 'lib/guard/sprockets2/compiler.rb', line 3 def initialize( = {}) configure() @target = Pathname.new(@assets_path) end |
Instance Method Details
#clean ⇒ Object
8 9 10 |
# File 'lib/guard/sprockets2/compiler.rb', line 8 def clean FileUtils.rm_rf @assets_path, :secure => true end |
#compile ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/guard/sprockets2/compiler.rb', line 12 def compile @sprockets.send(:expire_index!) success = true @precompile.each do |path| @sprockets.each_logical_path do |logical_path| next unless path_matches?(path, logical_path) if asset = @sprockets.find_asset(logical_path) success = compile_asset(asset) break unless success end end end success end |