class Forgery

  def self.dictionaries
    @@dictionaries ||= Dictionaries.new
  end

  def self.formats
    @@formats ||= Formats.new
  end

  def self.rails_root
    if defined?(RAILS_ROOT)
      RAILS_ROOT
    elsif defined?(Rails)
      Rails.root.to_s
    end
  end

  def self.rails?
    !rails_root.nil?
  end

end

class Forgery

  def self.dictionaries
    @@dictionaries ||= Dictionaries.new
  end

  def self.formats
    @@formats ||= Formats.new
  end

  def self.rails_root
    if defined?(Rails)
      Rails.root.to_s
    elsif defined?(RAILS_ROOT)
      RAILS_ROOT
    end
  end

  def self.rails?
    !rails_root.nil?
  end

end

Change order of Rails checks to avoid Rails 3 deprecation warnings
Change order of Rails checks to avoid Rails 3 deprecation warnings
