Class: SitemapGenerator::Interpreter
- Inherits:
-
Object
- Object
- SitemapGenerator::Interpreter
- 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
-
.default_url_options(options = nil) ⇒ Object
KJV do we need this? We should be using path_* helpers.
- .run ⇒ Object
Instance Method Summary collapse
-
#initialize(sitemap_config_file = nil) ⇒ Interpreter
constructor
A new instance of Interpreter.
Constructor Details
#initialize(sitemap_config_file = nil) ⇒ Interpreter
Returns a new instance of 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.( = nil) { :host => SitemapGenerator::Sitemap.default_host } end |
.run ⇒ Object
24 25 26 |
# File 'lib/sitemap_generator/interpreter.rb', line 24 def self.run new end |