Class: SitemapGenerator::Interpreter

Inherits:
Object
  • Object
show all
Includes:
ActionController::UrlWriter
Defined in:
lib/sitemap_generator/interpreter.rb

Overview

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sitemap_config_file = nil) ⇒ Interpreter


14
15
16
17
# File 'lib/sitemap_generator/interpreter.rb', line 14

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

Class Method Details

.default_url_options(options = nil) ⇒ Object

KJV do we need this? We should be using path_* helpers.


20
21
22
# File 'lib/sitemap_generator/interpreter.rb', line 20

def self.default_url_options(options = nil)
  { :host => SitemapGenerator::Sitemap.default_host }
end

.runObject


24
25
26
# File 'lib/sitemap_generator/interpreter.rb', line 24

def self.run
  new
end