Class: Bookbinder::Preprocessing::LinkToSiteGenDir
- Inherits:
-
Object
- Object
- Bookbinder::Preprocessing::LinkToSiteGenDir
- Defined in:
- lib/bookbinder/preprocessing/link_to_site_gen_dir.rb
Instance Method Summary collapse
- #applicable_to?(section) ⇒ Boolean
-
#initialize(filesystem) ⇒ LinkToSiteGenDir
constructor
A new instance of LinkToSiteGenDir.
- #preprocess(sections, output_locations, *_) ⇒ Object
Constructor Details
#initialize(filesystem) ⇒ LinkToSiteGenDir
Returns a new instance of LinkToSiteGenDir.
4 5 6 |
# File 'lib/bookbinder/preprocessing/link_to_site_gen_dir.rb', line 4 def initialize(filesystem) @filesystem = filesystem end |
Instance Method Details
#applicable_to?(section) ⇒ Boolean
8 9 10 |
# File 'lib/bookbinder/preprocessing/link_to_site_gen_dir.rb', line 8 def applicable_to?(section) filesystem.file_exist?(section.path_to_repository) end |
#preprocess(sections, output_locations, *_) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/bookbinder/preprocessing/link_to_site_gen_dir.rb', line 12 def preprocess(sections, output_locations, *_) sections.each do |section| filesystem.link_creating_intermediate_dirs( section.path_to_repository, output_locations.source_for_site_generator.join(section.destination_directory) ) end end |