Class: Forgery
- Inherits:
-
Object
show all
- Defined in:
- lib/forgery/extend.rb,
lib/forgery/forgery.rb,
lib/forgery/formats.rb,
lib/forgery/version.rb,
lib/forgery/file_reader.rb,
lib/forgery/dictionaries.rb,
lib/forgery/extensions/array.rb,
lib/forgery/extensions/range.rb,
lib/forgery/extensions/string.rb
Direct Known Subclasses
Address, BankAccount, Basic, CreditCard, Currency, Date, Email, Geo, Internet, LoremIpsum, Monetary, Name, Personal, RussianTax, Time
Defined Under Namespace
Modules: Extensions
Classes: Address, BankAccount, Basic, CreditCard, Currency, Date, Dictionaries, Email, FileReader, Formats, Geo, Internet, LoremIpsum, Monetary, Name, Personal, RussianTax, Time
Constant Summary
collapse
- VERSION =
'0.8.1'
Class Method Summary
collapse
Class Method Details
.dictionaries ⇒ Object
3
4
5
|
# File 'lib/forgery/forgery.rb', line 3
def self.dictionaries
@@dictionaries ||= Dictionaries.new
end
|
7
8
9
|
# File 'lib/forgery/forgery.rb', line 7
def self.formats
@@formats ||= Formats.new
end
|
.load_from!(path) ⇒ Object
15
16
17
18
|
# File 'lib/forgery/forgery.rb', line 15
def self.load_from!(path)
self.load_paths << File.expand_path(path)
Dir["#{self.load_paths.last}/**/*.rb"].uniq.each { |file| require file }
end
|
.load_paths ⇒ Object
11
12
13
|
# File 'lib/forgery/forgery.rb', line 11
def self.load_paths
@@load_paths ||= [File.dirname(__FILE__)]
end
|
.rails? ⇒ Boolean
28
29
30
|
# File 'lib/forgery/forgery.rb', line 28
def self.rails?
!rails_root.nil?
end
|
.rails_root ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/forgery/forgery.rb', line 20
def self.rails_root
if defined?(Rails) && Rails.respond_to?(:root)
Rails.root.to_s
elsif defined?(RAILS_ROOT)
RAILS_ROOT
end
end
|