Class: Middleman::Sitemap::Extensions::Import

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

Defined Under Namespace

Classes: ImportFileDescriptor, ImportPathDescriptor

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

#import_file(from, to) ⇒ Object



44
45
46
47
48
49
# File 'lib/middleman-core/sitemap/extensions/import.rb', line 44

def import_file(from, to)
  ImportFileDescriptor.new(
    File.expand_path(from, @app.root),
    ::Middleman::Util.normalize_path(to)
  )
end

#import_path(from, &block) ⇒ Object



56
57
58
59
60
61
# File 'lib/middleman-core/sitemap/extensions/import.rb', line 56

def import_path(from, &block)
  ImportPathDescriptor.new(
    from,
    block_given? ? block : proc { |path| path }
  )
end

#String

This method returns an undefined value.

Import an external glob into source

Parameters:

  • from (String)

    The original path.

  • block (Proc)

    Renaming method



43
# File 'lib/middleman-core/sitemap/extensions/import.rb', line 43

Contract String, String => ImportFileDescriptor