Class: Middleman::Sitemap::Extensions::Proxies

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

Overview

Manages the list of proxy configurations and manipulates the sitemap to include new resources based on those configurations

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, #proxy_method_call, #ready

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

#proxy(path, target, opts = {}) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/middleman-core/sitemap/extensions/proxies.rb', line 25

def proxy(path, target, opts={})
  ProxyDescriptor.new(
    ::Middleman::Util.normalize_path(path),
    ::Middleman::Util.normalize_path(target),
    opts.dup
  )
end

#StringProxyDescriptor

Setup a proxy from a path to a target

Parameters:

  • path (String)

    The new, proxied path to create

  • target (String)

    The existing path that should be proxied to. This must be a real resource, not another proxy.

Returns:



24
# File 'lib/middleman-core/sitemap/extensions/proxies.rb', line 24

Contract String, String, Maybe[Hash] => RespondTo[:execute_descriptor]