Sha256: 2311ad3d3b384c838fbee9f97ffed0903392890a0177106ccb9dd50398121183

Contents?: true

Size: 583 Bytes

Versions: 17

Compression:

Stored size: 583 Bytes

Contents

class Forgery

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

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

  def self.load_paths
    @@load_paths ||= [File.dirname(__FILE__)]
  end

  def self.load_from!(path)
    self.load_paths << File.expand_path(path)
    Dir["#{self.load_paths.last}/**/*.rb"].uniq.each { |file| require file }
  end

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

  def self.rails?
    !rails_root.nil?
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
forgery-0.8.1 lib/forgery/forgery.rb
forgery-0.7.0 lib/forgery/forgery.rb
forgery-0.6.0 lib/forgery/forgery.rb
forgery-0.5.0 lib/forgery/forgery.rb
forgery-0.4.4 lib/forgery/forgery.rb
forgery-0.4.3 lib/forgery/forgery.rb
forgery-0.4.2 lib/forgery/forgery.rb
forgery-0.4.1 lib/forgery/forgery.rb
forgery-0.4.0 lib/forgery/forgery.rb
forgery-0.3.12 lib/forgery/forgery.rb
forgery-0.3.11 lib/forgery/forgery.rb
forgery-0.3.10 lib/forgery/forgery.rb
forgery-0.3.9 lib/forgery/forgery.rb
forgery-0.3.8 lib/forgery/forgery.rb
forgery-0.3.7 lib/forgery/forgery.rb
forgery-0.3.6 lib/forgery/forgery.rb
forgery-0.3.5 lib/forgery/forgery.rb