Sha256: 5177ecc04aba9cdfd3dbd52197fec5e1317c5f47ead92c05f6b507ed15d68cbc

Contents?: true

Size: 741 Bytes

Versions: 16

Compression:

Stored size: 741 Bytes

Contents

module SitemapGenerator

  # Evaluate a sitemap config file within the context of a class that includes the
  # Rails URL helpers.
  class Interpreter

    if SitemapGenerator::Utilities.rails3?
      include ::Rails.application.routes.url_helpers
    else
      require 'action_controller'
      include ActionController::UrlWriter
    end

    def initialize(sitemap_config_file=nil)
      sitemap_config_file ||= File.join(::Rails.root, 'config/sitemap.rb')
      eval(open(sitemap_config_file).read)
    end

    # KJV do we need this?  We should be using path_* helpers.
    # def self.default_url_options(options = nil)
    #   { :host => SitemapGenerator::Sitemap.default_host }
    # end

    def self.run
      new
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
sitemap_generator-1.2.3 lib/sitemap_generator/interpreter.rb
sitemap_generator-1.2.2 lib/sitemap_generator/interpreter.rb
sitemap_generator-1.2.1 lib/sitemap_generator/interpreter.rb
sitemap_generator-1.2.0 lib/sitemap_generator/interpreter.rb
sitemap_generator-1.1.1 lib/sitemap_generator/interpreter.rb
apsoto-sitemap_generator-1.1.0 lib/sitemap_generator/interpreter.rb
apsoto-sitemap_generator-1.1.0.dev lib/sitemap_generator/interpreter.rb
sitemap_generator-1.1.0 lib/sitemap_generator/interpreter.rb
apsoto-sitemap_generator-1.0.1.dev lib/sitemap_generator/interpreter.rb
sitemap_generator-1.0.1 lib/sitemap_generator/interpreter.rb
sitemap_generator-1.0.0 lib/sitemap_generator/interpreter.rb
airblade-sitemap_generator-0.3.4 lib/sitemap_generator/interpreter.rb
sitemap_generator-0.3.3 lib/sitemap_generator/interpreter.rb
sitemap_generator-0.3.2 lib/sitemap_generator/interpreter.rb
sitemap_generator-0.3.1 lib/sitemap_generator/interpreter.rb
sitemap_generator-0.3.0 lib/sitemap_generator/interpreter.rb