Class: AssetBuild
- Inherits:
-
Object
- Object
- AssetBuild
- Defined in:
- lib/asset_build.rb
Instance Attribute Summary collapse
-
#manifest ⇒ Object
Returns the value of attribute manifest.
Instance Method Summary collapse
-
#initialize(path) ⇒ AssetBuild
constructor
A new instance of AssetBuild.
- #process_files! ⇒ Object
Constructor Details
#initialize(path) ⇒ AssetBuild
Returns a new instance of AssetBuild.
7 8 9 10 |
# File 'lib/asset_build.rb', line 7 def initialize(path) @manifest = YAML::load(File.open(path).readlines.join("")) @path = File.dirname(path) end |
Instance Attribute Details
#manifest ⇒ Object
Returns the value of attribute manifest.
5 6 7 |
# File 'lib/asset_build.rb', line 5 def manifest @manifest end |
Instance Method Details
#process_files! ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/asset_build.rb', line 12 def process_files! @manifest.each do |destination,| compressed = ["compress"] || false if ["type"] == "coffeescript" coffee_bundler = CoffeeBundler.new(File.join(@path,["source"])) coffee_bundler.save(File.join(@path,destination),:compress => compressed) puts File.join(@path,destination) elsif ["type"] == "stylesheet" css_reader = CSSReader.new(File.join(@path,["source"])) css_reader.save(File.join(@path,destination),:compress => compressed) puts File.join(@path,destination) end end end |