Sha256: 480fbe432fe38ca46a5157268b911ec6df6efa87471631ad29439bb9bf68e54b

Contents?: true

Size: 423 Bytes

Versions: 16

Compression:

Stored size: 423 Bytes

Contents

require 'pathname'

module SitemapGenerator
  class Application
    def rails?
      defined?(Rails)
    end

    # Returns a boolean indicating whether this environment is Rails 3
    #
    # @return [Boolean]    
    def rails3?
      rails? && Rails.version.to_f >= 3
    rescue
      false # Rails.version defined in 2.1.0
    end
   
    def root
      Pathname.new(rails? && Rails.root || Dir.getwd)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sitemap_generator-2.2.1 lib/sitemap_generator/application.rb
sitemap_generator-2.1.8 lib/sitemap_generator/application.rb
sitemap_generator-2.1.7 lib/sitemap_generator/application.rb
sitemap_generator-2.1.7.pre1 lib/sitemap_generator/application.rb
sitemap_generator-2.1.6 lib/sitemap_generator/application.rb
sitemap_generator-2.1.5 lib/sitemap_generator/application.rb
sitemap_generator-2.1.4 lib/sitemap_generator/application.rb
sitemap_generator-2.1.3 lib/sitemap_generator/application.rb
sitemap_generator-2.1.2 lib/sitemap_generator/application.rb
sitemap_generator-2.1.1 lib/sitemap_generator/application.rb
sitemap_generator-2.1.0 lib/sitemap_generator/application.rb
sitemap_generator-2.0.1.pre2 lib/sitemap_generator/application.rb
sitemap_generator-2.0.1.pre1 lib/sitemap_generator/application.rb
sitemap_generator-2.0.1 lib/sitemap_generator/application.rb
sitemap_generator-2.0.0 lib/sitemap_generator/application.rb
sitemap_generator-1.5.2 lib/sitemap_generator/application.rb