Class: Propshaft::Processor
- Inherits:
-
Object
- Object
- Propshaft::Processor
- Defined in:
- lib/propshaft/processor.rb
Constant Summary collapse
- MANIFEST_FILENAME =
".manifest.json"
Instance Attribute Summary collapse
-
#compilers ⇒ Object
readonly
Returns the value of attribute compilers.
-
#load_path ⇒ Object
readonly
Returns the value of attribute load_path.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
Instance Method Summary collapse
- #clean(count) ⇒ Object
- #clobber ⇒ Object
-
#initialize(load_path:, output_path:, compilers:) ⇒ Processor
constructor
A new instance of Processor.
- #process ⇒ Object
Constructor Details
#initialize(load_path:, output_path:, compilers:) ⇒ Processor
8 9 10 11 |
# File 'lib/propshaft/processor.rb', line 8 def initialize(load_path:, output_path:, compilers:) @load_path, @output_path = load_path, output_path @compilers = compilers end |
Instance Attribute Details
#compilers ⇒ Object (readonly)
Returns the value of attribute compilers.
6 7 8 |
# File 'lib/propshaft/processor.rb', line 6 def compilers @compilers end |
#load_path ⇒ Object (readonly)
Returns the value of attribute load_path.
6 7 8 |
# File 'lib/propshaft/processor.rb', line 6 def load_path @load_path end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
6 7 8 |
# File 'lib/propshaft/processor.rb', line 6 def output_path @output_path end |
Instance Method Details
#clean(count) ⇒ Object
23 24 25 |
# File 'lib/propshaft/processor.rb', line 23 def clean(count) Propshaft::OutputPath.new(output_path, load_path.manifest).clean(count, 1.hour) end |
#clobber ⇒ Object
19 20 21 |
# File 'lib/propshaft/processor.rb', line 19 def clobber FileUtils.rm_r(output_path) if File.exist?(output_path) end |
#process ⇒ Object
13 14 15 16 17 |
# File 'lib/propshaft/processor.rb', line 13 def process ensure_output_path_exists write_manifest output_assets end |