Class: SitemapGenerator::Application
- Inherits:
-
Object
- Object
- SitemapGenerator::Application
- Defined in:
- lib/sitemap_generator/application.rb
Overview
Thin abstraction over the host application environment.
Provides the app root path and Rails version detection.
Instance Method Summary collapse
-
#is_at_least_rails3? ⇒ Boolean
Returns a boolean indicating whether this environment is Rails 3.
-
#is_rails? ⇒ Boolean
rubocop:disable Naming/PredicatePrefix.
- #root ⇒ Object
Instance Method Details
#is_at_least_rails3? ⇒ Boolean
Returns a boolean indicating whether this environment is Rails 3
16 17 18 19 20 |
# File 'lib/sitemap_generator/application.rb', line 16 def is_at_least_rails3? # rubocop:disable Naming/PredicatePrefix is_rails? && Rails.version.to_f >= 3 rescue StandardError false # Rails.version defined in 2.1.0 end |
#is_rails? ⇒ Boolean
rubocop:disable Naming/PredicatePrefix
9 10 11 |
# File 'lib/sitemap_generator/application.rb', line 9 def is_rails? # rubocop:disable Naming/PredicatePrefix !!defined?(Rails::VERSION) end |
#root ⇒ Object
22 23 24 |
# File 'lib/sitemap_generator/application.rb', line 22 def root Pathname.new(rails_root || Dir.getwd) end |