Class: Middleman::Sitemap::Extensions::Ignores::IgnoreDescriptor
- Inherits:
-
Struct
- Object
- Struct
- Middleman::Sitemap::Extensions::Ignores::IgnoreDescriptor
- Defined in:
- lib/middleman-core/sitemap/extensions/ignores.rb
Direct Known Subclasses
BlockIgnoreDescriptor, GlobIgnoreDescriptor, RegexpIgnoreDescriptor, StringIgnoreDescriptor
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
35 36 37 |
# File 'lib/middleman-core/sitemap/extensions/ignores.rb', line 35 def block @block end |
#path ⇒ Object
Returns the value of attribute path
35 36 37 |
# File 'lib/middleman-core/sitemap/extensions/ignores.rb', line 35 def path @path end |
Instance Method Details
#execute_descriptor(_app, resources) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/middleman-core/sitemap/extensions/ignores.rb', line 36 def execute_descriptor(_app, resources) resources.map do |r| # Ignore based on the source path (without template extensions) if ignored?(r.normalized_path) r.ignore! elsif !r.is_a?(ProxyResource) && r.file_descriptor && ignored?(r.file_descriptor.normalized_relative_path) # This allows files to be ignored by their source file name (with template extensions) r.ignore! end r end end |
#ignored?(_match_path) ⇒ Boolean
50 51 52 |
# File 'lib/middleman-core/sitemap/extensions/ignores.rb', line 50 def ignored?(_match_path) raise NotImplementedError end |