Class: SitemapGenerator::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/sitemap_generator/application.rb

Instance Method Summary collapse

Instance Method Details

#is_at_least_rails3?Boolean

Returns a boolean indicating whether this environment is Rails 3

Returns:

  • (Boolean)


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

Returns:

  • (Boolean)


7
8
9
# File 'lib/sitemap_generator/application.rb', line 7

def is_rails?
  !!defined?(Rails::VERSION)
end

#rootObject



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

def root
  Pathname.new(rails_root || Dir.getwd)
end