Class: SitemapGenerator::Application

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

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) rails3?

Returns a boolean indicating whether this environment is Rails 3

Returns:

  • (Boolean)


12
13
14
15
16
# File 'lib/sitemap_generator/application.rb', line 12

def rails3?
  rails? && Rails.version.to_f >= 3
rescue
  false # Rails.version defined in 2.1.0
end

- (Boolean) rails?

Returns:

  • (Boolean)


5
6
7
# File 'lib/sitemap_generator/application.rb', line 5

def rails?
  defined?(Rails)
end

- (Object) root



18
19
20
# File 'lib/sitemap_generator/application.rb', line 18

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