Class: BoringBuilder::Exporters::Local
- Inherits:
-
Object
- Object
- BoringBuilder::Exporters::Local
- Defined in:
- lib/boringbuilder/exporters/local.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #export(asset) ⇒ Object
-
#initialize(project) ⇒ Local
constructor
A new instance of Local.
- #name ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(project) ⇒ Local
Returns a new instance of Local.
10 11 12 |
# File 'lib/boringbuilder/exporters/local.rb', line 10 def initialize(project) @project = project end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
8 9 10 |
# File 'lib/boringbuilder/exporters/local.rb', line 8 def project @project end |
Instance Method Details
#export(asset) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/boringbuilder/exporters/local.rb', line 18 def export(asset) output = project.output_path FileUtils.mkdir_p(output.dirname) = asset.kind == :directory ? { wipe: true } : {} asset.source.export(output.to_s, **) Receipt.new(path: output.to_s) end |
#name ⇒ Object
14 |
# File 'lib/boringbuilder/exporters/local.rb', line 14 def name = :local |
#validate! ⇒ Object
16 |
# File 'lib/boringbuilder/exporters/local.rb', line 16 def validate! = self |