Class: GeneratedAssets::Manifest
- Inherits:
-
Object
- Object
- GeneratedAssets::Manifest
- Defined in:
- lib/generated-assets/manifest.rb
Instance Attribute Summary collapse
-
#after_hooks ⇒ Object
readonly
Returns the value of attribute after_hooks.
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#before_hooks ⇒ Object
readonly
Returns the value of attribute before_hooks.
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
- #add(logical_path, options = {}, &block) ⇒ Object
- #after_apply(&block) ⇒ Object
- #apply! ⇒ Object
- #before_apply(&block) ⇒ Object
-
#initialize(app, prefix) ⇒ Manifest
constructor
A new instance of Manifest.
Constructor Details
#initialize(app, prefix) ⇒ Manifest
Returns a new instance of Manifest.
10 11 12 13 14 15 16 |
# File 'lib/generated-assets/manifest.rb', line 10 def initialize(app, prefix) @app = app @prefix = prefix @entries = [] @before_hooks = [] @after_hooks = [] end |
Instance Attribute Details
#after_hooks ⇒ Object (readonly)
Returns the value of attribute after_hooks.
8 9 10 |
# File 'lib/generated-assets/manifest.rb', line 8 def after_hooks @after_hooks end |
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/generated-assets/manifest.rb', line 7 def app @app end |
#before_hooks ⇒ Object (readonly)
Returns the value of attribute before_hooks.
8 9 10 |
# File 'lib/generated-assets/manifest.rb', line 8 def before_hooks @before_hooks end |
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
7 8 9 |
# File 'lib/generated-assets/manifest.rb', line 7 def entries @entries end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
7 8 9 |
# File 'lib/generated-assets/manifest.rb', line 7 def prefix @prefix end |
Instance Method Details
#add(logical_path, options = {}, &block) ⇒ Object
18 19 20 |
# File 'lib/generated-assets/manifest.rb', line 18 def add(logical_path, = {}, &block) entries << Entry.new(logical_path, block, ) end |
#after_apply(&block) ⇒ Object
35 36 37 |
# File 'lib/generated-assets/manifest.rb', line 35 def after_apply(&block) after_hooks << block end |
#apply! ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/generated-assets/manifest.rb', line 22 def apply! before_hooks.each(&:call) write_files add_precompile_paths after_hooks.each(&:call) end |
#before_apply(&block) ⇒ Object
31 32 33 |
# File 'lib/generated-assets/manifest.rb', line 31 def before_apply(&block) before_hooks << block end |