Sha256: ba7a9c4e9691ec699df61c3e54ec779400e7bf55f6f148ff9aadd801c27becf4

Contents?: true

Size: 555 Bytes

Versions: 3

Compression:

Stored size: 555 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.root.to_s
    elsif defined?(RAILS_ROOT)
      RAILS_ROOT
    end
  end

  def self.rails?
    !rails_root.nil?
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
forgery-0.3.4 lib/forgery/forgery.rb
forgery-0.3.3 lib/forgery/forgery.rb
forgery-0.3.2 lib/forgery/forgery.rb