Class: Middleman::Sitemap::Extensions::Import::ImportPathDescriptor
- Inherits:
-
Struct
- Object
- Struct
- Middleman::Sitemap::Extensions::Import::ImportPathDescriptor
- Defined in:
- middleman-core/lib/middleman-core/sitemap/extensions/import.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#renameProc ⇒ Object
Returns the value of attribute renameProc.
Instance Method Summary collapse
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from
22 23 24 |
# File 'middleman-core/lib/middleman-core/sitemap/extensions/import.rb', line 22 def from @from end |
#renameProc ⇒ Object
Returns the value of attribute renameProc
22 23 24 |
# File 'middleman-core/lib/middleman-core/sitemap/extensions/import.rb', line 22 def renameProc @renameProc end |
Instance Method Details
#execute_descriptor(app, resource_list) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'middleman-core/lib/middleman-core/sitemap/extensions/import.rb', line 23 def execute_descriptor(app, resource_list) new_resources = ::Middleman::Util.glob_directory(File.join(from, '**/*')) .reject { |path| File.directory?(path) } .map do |path| target_path = Pathname(path).relative_path_from(Pathname(from).parent).to_s ::Middleman::Sitemap::Resource.new( app.sitemap, renameProc.call(target_path, path), path ) end resource_list.add!(*new_resources) end |