Class: Savory::Theme::Packager
- Inherits:
-
Object
- Object
- Savory::Theme::Packager
- Defined in:
- lib/savory/theme/packager.rb,
lib/savory/theme/packager/features.rb,
lib/savory/theme/packager/features/sass.rb,
lib/savory/theme/packager/features/compass.rb
Defined Under Namespace
Classes: Features
Instance Attribute Summary collapse
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
- #bom! ⇒ Object
- #clean ⇒ Object
- #compile!(options = {}) ⇒ Object
-
#initialize(theme, options = {}) ⇒ Packager
constructor
A new instance of Packager.
- #zip!(zip_name, options = {}) ⇒ Object
Constructor Details
#initialize(theme, options = {}) ⇒ Packager
Returns a new instance of Packager.
10 11 12 13 14 15 |
# File 'lib/savory/theme/packager.rb', line 10 def initialize(theme, = {}) @theme = theme = @verbose = .delete(:verbose) @features = Features.new(self) end |
Instance Attribute Details
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
8 9 10 |
# File 'lib/savory/theme/packager.rb', line 8 def verbose @verbose end |
Instance Method Details
#bom! ⇒ Object
26 27 28 |
# File 'lib/savory/theme/packager.rb', line 26 def bom! BOM.create!(@theme) end |
#clean ⇒ Object
49 50 51 52 53 |
# File 'lib/savory/theme/packager.rb', line 49 def clean BOM.new(@theme).clean @features.clean(@theme) @theme.layout.clean end |
#compile!(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/savory/theme/packager.rb', line 17 def compile!( = {}) full_version = .delete(:full_version) output_style = .delete(:output_style) @features.apply!(@theme, :output_style => output_style) puts "Theme CSS compiled" if @verbose end |
#zip!(zip_name, options = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/savory/theme/packager.rb', line 30 def zip!(zip_name, = {}) @theme.layout.prepare(:zip, @theme.res_home) home = Pathname.new(@theme.res_home) excludes = .delete(:exclude) paths = { 'VERSION' => 'config/VERSION', 'app' => 'app', 'config' => 'config', 'data' => 'data', home.join(@theme.layout.public_css) => 'public/stylesheets', home.join(@theme.layout.public_js) => 'public/javascripts', home.join(@theme.layout.public_images) => 'public/images' } write_zip(zip_name, paths, excludes) puts "Theme written to #{zip_name}" if @verbose end |