Class: Middleman::Sitemap::Extensions::Ignores

Inherits:
ConfigExtension show all
Defined in:
lib/middleman-core/sitemap/extensions/ignores.rb

Overview

Class to handle managing ignores

Defined Under Namespace

Classes: IgnoreDescriptor

Constant Summary

Constants included from Contracts

Contracts::PATH_MATCHER

Instance Attribute Summary

Attributes inherited from Extension

#app, #options

Instance Method Summary collapse

Methods inherited from ConfigExtension

#after_configuration, #initialize, #manipulate_resource_list

Methods inherited from Extension

activated_extension, #add_exposed_to_context, #after_build, #after_configuration, #after_extension_activated, after_extension_activated, #before_build, #before_configuration, clear_after_extension_callbacks, config, define_setting, expose_to_application, expose_to_config, expose_to_template, global_config, helpers, #initialize, #manipulate_resource_list, option, #ready, resources

Methods included from Contracts

#Contract

Constructor Details

This class inherits a constructor from Middleman::ConfigExtension

Instance Method Details

#execute_descriptorIgnoreDescriptor

Ignore a path or add an ignore callback

Parameters:

  • path (String, Regexp)

    Path glob expression, or path regex

Returns:



14
# File 'lib/middleman-core/sitemap/extensions/ignores.rb', line 14

Contract Or[String, Regexp, Proc] => RespondTo[:execute_descriptor]

#ignore(path = nil, &block) ⇒ Object



15
16
17
18
# File 'lib/middleman-core/sitemap/extensions/ignores.rb', line 15

def ignore(path=nil, &block)
  @app.sitemap.invalidate_resources_not_ignored_cache!
  IgnoreDescriptor.new(path, block)
end