Class: Middleman::Sitemap::Extensions::Ignores::IgnoreDescriptor
- Inherits:
-
Struct
- Object
- Struct
- Middleman::Sitemap::Extensions::Ignores::IgnoreDescriptor
- Defined in:
- middleman-core/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 'middleman-core/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 'middleman-core/lib/middleman-core/sitemap/extensions/ignores.rb', line 35 def path @path end |
Instance Method Details
#execute_descriptor(_app, resource_list) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'middleman-core/lib/middleman-core/sitemap/extensions/ignores.rb', line 36 def execute_descriptor(_app, resource_list) resource_list.each do |r| # Ignore based on the source path (without template extensions) if ignored?(r.normalized_path) resource_list.update!(r, :ignored) { 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) resource_list.update!(r, :ignored) { r.ignore! } end end end |
#ignored?(_match_path) ⇒ Boolean
48 49 50 |
# File 'middleman-core/lib/middleman-core/sitemap/extensions/ignores.rb', line 48 def ignored?(_match_path) raise NotImplementedError end |