Class: Bookwatch::Preprocessing::LinkToSiteGenDir
- Inherits:
-
Object
- Object
- Bookwatch::Preprocessing::LinkToSiteGenDir
- Defined in:
- lib/bookwatch/preprocessing/link_to_site_gen_dir.rb
Instance Method Summary collapse
- #applicable_to?(section) ⇒ Boolean
-
#initialize(filesystem, subnav_generator_factory) ⇒ LinkToSiteGenDir
constructor
A new instance of LinkToSiteGenDir.
- #preprocess(sections, output_locations, config: nil, options: {}, **_) ⇒ Object
Constructor Details
#initialize(filesystem, subnav_generator_factory) ⇒ LinkToSiteGenDir
Returns a new instance of LinkToSiteGenDir.
7 8 9 10 |
# File 'lib/bookwatch/preprocessing/link_to_site_gen_dir.rb', line 7 def initialize(filesystem, ) @filesystem = filesystem @subnav_generator_factory = end |
Instance Method Details
#applicable_to?(section) ⇒ Boolean
12 13 14 |
# File 'lib/bookwatch/preprocessing/link_to_site_gen_dir.rb', line 12 def applicable_to?(section) filesystem.file_exist?(section.path_to_repo_dir) end |
#preprocess(sections, output_locations, config: nil, options: {}, **_) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bookwatch/preprocessing/link_to_site_gen_dir.rb', line 16 def preprocess(sections, output_locations, config: nil, options: {}, **_) sections.each do |section| filesystem.link_creating_intermediate_dirs( section.path_to_repo_dir, output_locations.source_for_site_generator.join(section.destination_directory) ) end generator = ([:require_valid_subnav_links]) config.products.each do |product| generator.generate(product) end end |