Class: Bookbinder::Commands::Components::Bind::LayoutPreparer
- Inherits:
-
Object
- Object
- Bookbinder::Commands::Components::Bind::LayoutPreparer
- Defined in:
- lib/bookbinder/commands/components/bind/layout_preparer.rb
Instance Attribute Summary collapse
-
#fs ⇒ Object
readonly
Returns the value of attribute fs.
Instance Method Summary collapse
-
#initialize(fs) ⇒ LayoutPreparer
constructor
A new instance of LayoutPreparer.
- #prepare(output_locations, cloner, ref_override, config) ⇒ Object
Constructor Details
#initialize(fs) ⇒ LayoutPreparer
Returns a new instance of LayoutPreparer.
6 7 8 |
# File 'lib/bookbinder/commands/components/bind/layout_preparer.rb', line 6 def initialize(fs) @fs = fs end |
Instance Attribute Details
#fs ⇒ Object (readonly)
Returns the value of attribute fs.
10 11 12 |
# File 'lib/bookbinder/commands/components/bind/layout_preparer.rb', line 10 def fs @fs end |
Instance Method Details
#prepare(output_locations, cloner, ref_override, config) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bookbinder/commands/components/bind/layout_preparer.rb', line 12 def prepare(output_locations, cloner, ref_override, config) if config.has_option?('layout_repo') cloned_repo = cloner.call(source_repo_name: config.layout_repo, source_ref: ref_override || config.layout_repo_ref, destination_parent_dir: Dir.mktmpdir) fs.copy_contents(cloned_repo.path, output_locations.site_generator_home) end fs.copy_contents(File.absolute_path('master_middleman'), output_locations.site_generator_home) end |