Class: SitemapGenerator::Application
- Inherits:
-
Object
- Object
- SitemapGenerator::Application
- Defined in:
- lib/sitemap_generator/application.rb
Instance Method Summary collapse
-
#is_at_least_rails3? ⇒ Boolean
Returns a boolean indicating whether this environment is Rails 3.
- #is_rails? ⇒ Boolean
- #root ⇒ Object
Instance Method Details
#is_at_least_rails3? ⇒ Boolean
Returns a boolean indicating whether this environment is Rails 3
14 15 16 17 18 |
# File 'lib/sitemap_generator/application.rb', line 14 def is_at_least_rails3? is_rails? && Rails.version.to_f >= 3 rescue false # Rails.version defined in 2.1.0 end |
#is_rails? ⇒ Boolean
7 8 9 |
# File 'lib/sitemap_generator/application.rb', line 7 def is_rails? !!defined?(Rails::VERSION) end |
#root ⇒ Object
20 21 22 |
# File 'lib/sitemap_generator/application.rb', line 20 def root Pathname.new(rails_root || Dir.getwd) end |