Class: Middleman::Sitemap::Extensions::Import::ImportPathDescriptor
- Inherits:
-
Struct
- Object
- Struct
- Middleman::Sitemap::Extensions::Import::ImportPathDescriptor
- Defined in:
- 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
23 24 25 |
# File 'lib/middleman-core/sitemap/extensions/import.rb', line 23 def from @from end |
#renameProc ⇒ Object
Returns the value of attribute renameProc
23 24 25 |
# File 'lib/middleman-core/sitemap/extensions/import.rb', line 23 def renameProc @renameProc end |
Instance Method Details
#execute_descriptor(app, resources) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/middleman-core/sitemap/extensions/import.rb', line 24 def execute_descriptor(app, resources) 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 end |