Class: Propshaft::Assembly
- Inherits:
-
Object
- Object
- Propshaft::Assembly
- Defined in:
- lib/propshaft/assembly.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #compilers ⇒ Object
-
#initialize(config) ⇒ Assembly
constructor
A new instance of Assembly.
- #load_path ⇒ Object
- #processor ⇒ Object
- #resolver ⇒ Object
- #reveal ⇒ Object
- #server ⇒ Object
Constructor Details
#initialize(config) ⇒ Assembly
Returns a new instance of Assembly.
12 13 14 |
# File 'lib/propshaft/assembly.rb', line 12 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/propshaft/assembly.rb', line 10 def config @config end |
Instance Method Details
#compilers ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/propshaft/assembly.rb', line 37 def compilers @compilers ||= Propshaft::Compilers.new(self).tap do |compilers| Array(config.compilers).each do |(mime_type, klass)| compilers.register mime_type, klass end end end |
#load_path ⇒ Object
16 17 18 |
# File 'lib/propshaft/assembly.rb', line 16 def load_path @load_path ||= Propshaft::LoadPath.new(config.paths) end |
#processor ⇒ Object
32 33 34 35 |
# File 'lib/propshaft/assembly.rb', line 32 def processor Propshaft::Processor.new \ load_path: load_path, output_path: config.output_path, compilers: compilers end |
#resolver ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/propshaft/assembly.rb', line 20 def resolver @resolver ||= if manifest_path.exist? Propshaft::Resolver::Static.new manifest_path: manifest_path, prefix: config.prefix else Propshaft::Resolver::Dynamic.new load_path: load_path, prefix: config.prefix end end |
#reveal ⇒ Object
46 47 48 49 50 |
# File 'lib/propshaft/assembly.rb', line 46 def reveal load_path.assets.each do |asset| Propshaft.logger.info asset.logical_path end end |