forgery 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9756be4e19ec2f587a22381db7f90398dc1d203a
4
- data.tar.gz: 024a6316301e71afafd6eb948aac37992ba168f0
3
+ metadata.gz: edfed01a47576d5c89584ba13963d84d7e5a1a33
4
+ data.tar.gz: 4148f955ffab8872206eb45fee99a3f6dec63b1b
5
5
  SHA512:
6
- metadata.gz: 9a0114bc3393c3a8790ce074e65c4afb66a60406f4fd60df64c55d0151c3fbbf452e52db20d27263e2386b7d9410c67f29c8977b53ee76154b28343681c26185
7
- data.tar.gz: 7c882a4f0d9f699ddf7d23244fecaef25860379a605bc8d0be30ad70eb4d1e1fe84b9d0f0ddeea55c6dec7be0c6e31272abbe131ec47163c0ee8b9410126a8de
6
+ metadata.gz: 30bc7b7c2a647705238a09b742db2281db7e4d465f55cc81c6407cb9c7f0383fb5dee678cfc2313918c18064f21a2cbf78c7f474bb767fe1dfb6d21dc85bfea4
7
+ data.tar.gz: d2ecc07f38a548cb044f55caa39b3dc7940b9adde56556f64c13a58835539e0cc0cdae3ae67ee647d6a85ca3cde40181f74a37e8396ab0e79642421fe9b90643
@@ -1,10 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.2
5
- - 1.9.3
6
- - 2.0.0
7
- - 2.1.0
3
+ - 2.2.6
4
+ - 2.3.3
5
+ - 2.4.0
8
6
  - ruby-head
9
7
 
10
8
  matrix:
@@ -1,27 +1,35 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- forgery (0.6.0)
4
+ forgery (0.7.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- diff-lcs (1.1.3)
10
- rake (10.1.0)
11
- rspec (2.6.0)
12
- rspec-core (~> 2.6.0)
13
- rspec-expectations (~> 2.6.0)
14
- rspec-mocks (~> 2.6.0)
15
- rspec-core (2.6.4)
16
- rspec-expectations (2.6.0)
17
- diff-lcs (~> 1.1.2)
18
- rspec-mocks (2.6.0)
9
+ diff-lcs (1.3)
10
+ rake (12.3.0)
11
+ rspec (3.7.0)
12
+ rspec-core (~> 3.7.0)
13
+ rspec-expectations (~> 3.7.0)
14
+ rspec-mocks (~> 3.7.0)
15
+ rspec-core (3.7.0)
16
+ rspec-support (~> 3.7.0)
17
+ rspec-expectations (3.7.0)
18
+ diff-lcs (>= 1.2.0, < 2.0)
19
+ rspec-support (~> 3.7.0)
20
+ rspec-mocks (3.7.0)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.7.0)
23
+ rspec-support (3.7.0)
19
24
 
20
25
  PLATFORMS
21
26
  ruby
22
27
 
23
28
  DEPENDENCIES
24
- bundler (~> 1.3)
29
+ bundler (~> 1.16.0)
25
30
  forgery!
26
31
  rake
27
32
  rspec
33
+
34
+ BUNDLED WITH
35
+ 1.16.0
@@ -108,6 +108,151 @@ This Rails generators will make these directories in your Rails.root directory:
108
108
 
109
109
  You can then use these directories to write your own dictionaries, class extensions, forgeries, and formats.
110
110
 
111
+ Full List of methods:
112
+ --------------------
113
+
114
+ Address | Example Output
115
+ :------------------------------ |:----------------
116
+ `Forgery('address').city` | Loomis
117
+ `Forgery('address').continent` | South America
118
+ `Forgery('address').country` | Cameroon
119
+ `Forgery('address').phone` | +1 (693) 901-4549
120
+ `Forgery('address').province` | Alberta
121
+ `Forgery('address').province_abbrev` | NT
122
+ `Forgery('address').state` | Alabama
123
+ `Forgery('address').state_abbrev` | SC
124
+ `Forgery('address').street_address` | 21 Hayes Park
125
+ `Forgery('address').street_name` | Oneill
126
+ `Forgery('address').street_number` | 222
127
+ `Forgery('address').street_suffix` | Drive
128
+ `Forgery('address').zip` | 11281-5568
129
+
130
+
131
+ Basic | Example Output
132
+ :------------------------------ |:----------------
133
+ `Forgery('basic').boolean` | `true` (`TrueClass`)
134
+ `Forgery('basic').color` | Red
135
+ `Forgery('basic').encrypt` | fc0d835dd4e4df144a33a6a346298b0f23dcd14a
136
+ `Forgery('basic').frequency` | Never
137
+ `Forgery('basic').hex_color` | #e1d82a
138
+ `Forgery('basic').number` | 4
139
+ `Forgery('basic').password` | KcLBHCv6
140
+ `Forgery('basic').short_hex_color` | #c1d
141
+ `Forgery('basic').text` | G8gECFfvDs2
142
+
143
+ Credit Card | Example Output
144
+ :------------------------------ |:----------------
145
+ `Forgery('credit_card').check_digit(number)` | 5
146
+ `Forgery('credit_card').number` | 343682330855371
147
+ `Forgery('credit_card').type` | American Express
148
+ `Forgery('currency').code` | XPF
149
+ `Forgery('currency').description` | Austria Schillings
150
+
151
+ Date | Example Output
152
+ :------------------------------ |:----------------
153
+ `Forgery('date').date` | Fri, 20 Mar 2009 (`Date`)
154
+ `Forgery('date').day` | 15
155
+ `Forgery('date').day_of_week` | Monday
156
+ `Forgery('date').delta(options)` | 3
157
+ `Forgery('date').month` | January
158
+ `Forgery('date').year` | 1994
159
+
160
+ Email | Example Output
161
+ :------------------------------ |:----------------
162
+ `Forgery('email').address` | gsmith@kamba.org
163
+ `Forgery('email').body` | Lorem ipsum dolor sit amet, consectetuer ...
164
+ `Forgery('email').subject` | Lorem Ipsum Dolor Sit Amet...
165
+
166
+
167
+ Geo | Example Output
168
+ :------------------------------ |:----------------
169
+ `Forgery('geo').latitude` | -8.095096815540515 (`Float`)
170
+ `Forgery('geo').latitude_degrees` | -49
171
+ `Forgery('geo').latitude_direction` | N
172
+ `Forgery('geo').latitude_minutes` | 14
173
+ `Forgery('geo').latitude_seconds` | 45
174
+ `Forgery('geo').longitude` | -22.56746406884514 (`Float`)
175
+ `Forgery('geo').longitude_degrees` | 100
176
+ `Forgery('geo').longitude_direction` | W
177
+ `Forgery('geo').longitude_minutes` | 47
178
+ `Forgery('geo').longitude_seconds` | 41
179
+
180
+ Internet | Example Output
181
+ :------------------------------ |:----------------
182
+ `Forgery('internet').cctld` | cf
183
+ `Forgery('internet').domain_name` | bubbletube.net
184
+ `Forgery('internet').email_address` | cwalker@quire.name
185
+ `Forgery('internet').email_subject` | Lorem Ipsum Dolor Sit Amet...
186
+ `Forgery('internet').ip_v4` | 94.120.51.103
187
+ `Forgery('internet').ip_v6` | c61e:5926:15e6:d225:8eef:fb39:7412:e9d5
188
+ `Forgery('internet').top_level_domain` | com
189
+ `Forgery('internet').user_name` | sdixon
190
+
191
+ Lorem Ipsum | Example Output
192
+ :------------------------------ |:----------------
193
+ `Forgery('lorem_ipsum').character` | l
194
+ `Forgery('lorem_ipsum').characters` | lorem ipsu
195
+ `Forgery('lorem_ipsum').lorem_ipsum_characters` | lorem ipsum dolor sit amet...
196
+ `Forgery('lorem_ipsum').lorem_ipsum_words` | ["lorem", "ipsum", "dolor", ...] (`Array`)
197
+ `Forgery('lorem_ipsum').paragraph` | Lorem ipsum dolor sit amet...
198
+ `Forgery('lorem_ipsum').paragraphs` | Lorem ipsum dolor sit amet...
199
+ `Forgery('lorem_ipsum').range_from_quantity(quantity)` | 0..4 (`Range`)
200
+ `Forgery('lorem_ipsum').sentence` | Lorem ipsum dolor sit amet...
201
+ `Forgery('lorem_ipsum').sentences` | Lorem ipsum dolor sit amet...
202
+ `Forgery('lorem_ipsum').text` | Lorem ipsum dolor sit amet...
203
+ `Forgery('lorem_ipsum').title` | Lorem Ipsum Dolor Sit Amet...
204
+ `Forgery('lorem_ipsum').word` | lorem
205
+ `Forgery('lorem_ipsum').words` | lorem ipsum dolor sit amet...
206
+
207
+ Monetary | Example Output
208
+ :------------------------------ |:----------------
209
+ `Forgery('monetary').formatted_money` | $5.49
210
+ `Forgery('monetary').money` | 9.20 (`String`)
211
+
212
+
213
+ Name | Example Output
214
+ :------------------------------ |:----------------
215
+ `Forgery('name').company_name` | Bubbletube
216
+ `Forgery('name').female_first_name` | Judy
217
+ `Forgery('name').first_name` | Albert
218
+ `Forgery('name').full_name` | Evelyn Wallace
219
+ `Forgery('name').industry` | Toy & Hobby Stores
220
+ `Forgery('name').job_title` | Analyst Programmer
221
+ `Forgery('name').job_title_suffix` | III
222
+ `Forgery('name').last_name` | Jackson
223
+ `Forgery('name').location` | Try-N-Save
224
+ `Forgery('name').male_first_name` | Donald
225
+ `Forgery('name').suffix` | Sr
226
+ `Forgery('name').title` | Mr
227
+
228
+ Personal | Example Output
229
+ :------------------------------ |:----------------
230
+ `Forgery('personal').abbreviated_gender` | F
231
+ `Forgery('personal').gender` | Female
232
+ `Forgery('personal').language` | Bislama
233
+ `Forgery('personal').race` | Indonesian
234
+ `Forgery('personal').shirt_size` | 2XL
235
+
236
+ Bank Account | Example Output
237
+ :------------------------------ |:----------------
238
+ `Forgery('bank_account').iban` | BE68539007547034
239
+ `Forgery('bank_account').bic` | VBRSDE33345
240
+
241
+ Russian Tax | Example Output
242
+ :------------------------------ |:----------------
243
+ `Forgery('russian_tax').account_number` | 56335652786612121479
244
+ `Forgery('russian_tax').bik` | 046533860
245
+ `Forgery('russian_tax').inn` | 7366543467
246
+ `Forgery('russian_tax').legal_inn` | 7822838630
247
+ `Forgery('russian_tax').legal_ogrn` | 3483465598635
248
+ `Forgery('russian_tax').ogrn` | 666325227817763
249
+ `Forgery('russian_tax').person_inn` | 451559765443
250
+ `Forgery('russian_tax').person_ogrn` | 195478617554621
251
+
252
+ Time | Example Output
253
+ :------------------------------ |:----------------
254
+ `Forgery('time').zone` | Amsterdam (`String`)
255
+
111
256
 
112
257
  Contributing
113
258
  ------------
@@ -137,6 +282,7 @@ Thanks to the authors and contributors:
137
282
  * Diego Plentz (plentz)
138
283
  * Gabe Berke-Williams (gabebw)
139
284
  * Todd Mazierski (toddmazierski)
285
+ * Galen Palmer (palmergs)
140
286
 
141
287
 
142
288
  Licensing
@@ -164,3 +310,4 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
164
310
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
165
311
 
166
312
  On that note, have fun!
313
+
@@ -1,23 +1,23 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "forgery/version"
1
+
2
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
+ require 'forgery/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "forgery"
6
+ spec.name = 'forgery'
7
7
  spec.version = Forgery::VERSION
8
- spec.authors = ["Nathan Sutton", "Brandon Arbini", "Kamil Kieliszczyk"]
9
- spec.email = ["nate@zencoder.com", "brandon@zencoder.com", "kamil@kieliszczyk.net"]
10
- spec.homepage = "http://github.com/sevenwire/forgery"
11
- spec.summary = "Easy and customizable generation of forged data."
12
- spec.description = "Easy and customizable generation of forged data. Can be used as a gem or a rails plugin. Includes rails generators for creating your own forgeries."
8
+ spec.authors = ['Nathan Sutton', 'Brandon Arbini', 'Kamil Kieliszczyk']
9
+ spec.email = ['nate@zencoder.com', 'brandon@zencoder.com', 'kamil@kieliszczyk.net']
10
+ spec.homepage = 'http://github.com/sevenwire/forgery'
11
+ spec.summary = 'Easy and customizable generation of forged data.'
12
+ spec.description = 'Easy and customizable generation of forged data. Can be used as a gem or a rails plugin. Includes rails generators for creating your own forgeries.'
13
13
 
14
14
  spec.platform = Gem::Platform::RUBY
15
- spec.required_rubygems_version = ">= 1.3.6"
16
- spec.rubyforge_project = "forgery"
15
+ spec.required_rubygems_version = '>= 1.3.6'
16
+ spec.rubyforge_project = 'forgery'
17
17
 
18
- spec.files = `git ls-files`.split($/)
19
- spec.test_files = `git ls-files spec`.split($/)
20
- spec.require_paths = %w(lib)
18
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
19
+ spec.test_files = `git ls-files spec`.split($INPUT_RECORD_SEPARATOR)
20
+ spec.require_paths = %w[lib]
21
21
 
22
- spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency 'bundler', '~> 1.16.0'
23
23
  end
@@ -0,0 +1,7 @@
1
+ AARBDE5W100
2
+ GENODEF1PA1
3
+ GENODE61HD1
4
+ BPAAIT2B001
5
+ BPAAIT2B009
6
+ VBRSDE33345
7
+ VBRSDE33347
@@ -0,0 +1,61 @@
1
+ AD1200012030200359100100
2
+ AE070331234567890123456
3
+ AL47212110090000000235698741
4
+ AT611904300234573201
5
+ AZ21NABZ00000000137010001944
6
+ BA391290079401028494
7
+ BE68539007547034
8
+ BG80BNBG96611020345678
9
+ BH67BMAG00001299123456
10
+ CH9300762011623852957
11
+ CY17002001280000001200527600
12
+ CZ6508000000192000145399
13
+ DE89370400440532013000
14
+ DK5000400440116243
15
+ DO28BAGR00000001212453611324
16
+ EE382200221020145685
17
+ ES9121000418450200051332
18
+ FI2112345600000785
19
+ FO7630004440960235
20
+ FR1420041010050500013M02606
21
+ GB29NWBK60161331926819
22
+ GE29NB0000000101904917
23
+ GI75NWBK000000007099453
24
+ GL4330003330229543
25
+ GR1601101250000000012300695
26
+ HR1210010051863000160
27
+ HU42117730161111101800000000
28
+ IE29AIBK93115212345678
29
+ IL620108000000099999999
30
+ IS140159260076545510730339
31
+ IT60X0542811101000000123456
32
+ JO94CBJO0010000000000131000302
33
+ KW81CBKU0000000000001234560101
34
+ KZ86125KZT5004100100
35
+ LB62099900000001001901229114
36
+ LI21088100002324013AA
37
+ LT121000011101001000
38
+ LU280019400644750000
39
+ LV80BANK0000435195001
40
+ MC1112739000700011111000h79
41
+ MD24AG000225100013104168
42
+ ME25505000012345678951
43
+ MK07300000000042425
44
+ MR1300020001010000123456753
45
+ MT84MALT011000012345MTLCAST001S
46
+ MU17BOMM0101101030300200000MUR
47
+ NL91ABNA0417164300
48
+ NO9386011117947
49
+ PL27114020040000300201355387
50
+ PK36SCBL0000001123456702
51
+ PT50000201231234567890154
52
+ QA58DOHB00001234567890ABCDEFG
53
+ RO49AAAA1B31007593840000
54
+ RS35260005601001611379
55
+ SA0380000000608010167519
56
+ SE3550000000054910000003
57
+ SI56191000000123438
58
+ SK3112000000198742637541
59
+ SM86U0322509800000000270100
60
+ TN5914207207100707129648
61
+ TR330006100519786457841326
@@ -24,7 +24,7 @@ Community Outreach Specialist
24
24
  Compensation Analyst
25
25
  Computer Systems Analyst #{N}
26
26
  Cost Accountant
27
- Data Coordiator
27
+ Data Coordinator
28
28
  Database Administrator #{N}
29
29
  Dental Hygienist
30
30
  Design Engineer
@@ -66,7 +66,7 @@ Harare
66
66
  Helsinki
67
67
  Istanbul
68
68
  Jerusalem
69
- Kyev
69
+ Kyiv
70
70
  Minsk
71
71
  Pretoria
72
72
  Riga
@@ -114,7 +114,6 @@ Kuala Lumpur
114
114
  Perth
115
115
  Singapore
116
116
  Taipei
117
- Ulaan Bataar
118
117
  Urumqi
119
118
  Osaka
120
119
  Sapporo
@@ -9,7 +9,7 @@ class Forgery
9
9
  def random
10
10
  Integer(first) && Integer(last)
11
11
  raise ArgumentError if first > last
12
- Kernel.rand(last - first + (exclude_end? ? 0 : 1)) + first
12
+ Random.rand self
13
13
  rescue ArgumentError
14
14
  Forgery::Extend(to_a).random
15
15
  end
@@ -29,7 +29,7 @@ class Forgery
29
29
  def self.find_file(name, folder)
30
30
  Forgery.load_paths.reverse.each do |path|
31
31
  file = "#{path}/#{folder}/#{name}"
32
- return file if File.exists?(file)
32
+ return file if File.exist?(file)
33
33
  end
34
34
  raise ArgumentError.new("File '#{name}' wasn't found in '#{folder}' folder. Searched paths: \n#{Forgery.load_paths.join('\n')}")
35
35
  end
@@ -0,0 +1,25 @@
1
+ # Generates random bank account information
2
+ class Forgery::BankAccount < Forgery
3
+
4
+ # Gets a random iban out of the 'ibans' dictionary.
5
+ #
6
+ # Forgery(:bank_account).iban
7
+ # # => "BE68539007547034"
8
+ #
9
+ # Forgery(:bank_account).iban
10
+ # # => "FI2112345600000785"
11
+ def self.iban
12
+ dictionaries[:ibans].random.unextend
13
+ end
14
+
15
+ # Gets a random bic out of the 'bics' dictionary.
16
+ #
17
+ # Forgery(:bank_account).bic
18
+ # # => "AARBDE5W100"
19
+ #
20
+ # Forgery(:bank_account).bic
21
+ # # => "GENODEF1PA1"
22
+ def self.bic
23
+ dictionaries[:bics].random.unextend
24
+ end
25
+ end
@@ -34,7 +34,7 @@ class Forgery::CreditCard < Forgery
34
34
  def self.number(options={})
35
35
  # find a card by type specified, or select a card randomly
36
36
  card = if options[:type]
37
- CARDS.find { |card| card[:type] == options[:type] }.clone
37
+ CARDS.find { |ccard| ccard[:type] == options[:type] }.clone
38
38
  else
39
39
  CARDS.random.clone
40
40
  end
@@ -28,7 +28,7 @@ class Forgery::LoremIpsum < Forgery
28
28
  end
29
29
 
30
30
  def self.characters(quantity=10, options={})
31
- options.merge!(:random_limit => lorem_ipsum_characters.length-quantity) if quantity.is_a?(Fixnum)
31
+ options.merge!(:random_limit => lorem_ipsum_characters.length-quantity) if quantity.is_a?(Integer)
32
32
 
33
33
  lorem_ipsum_characters[range_from_quantity(quantity, options)]
34
34
  end
@@ -38,7 +38,7 @@ class Forgery::LoremIpsum < Forgery
38
38
  end
39
39
 
40
40
  def self.words(quantity=10, options={})
41
- options.merge!(:random_limit => lorem_ipsum_words.length-quantity) if quantity.is_a?(Fixnum)
41
+ options.merge!(:random_limit => lorem_ipsum_words.length-quantity) if quantity.is_a?(Integer)
42
42
 
43
43
  lorem_ipsum_words[range_from_quantity(quantity, options)].join(" ")
44
44
  end
@@ -48,7 +48,7 @@ class Forgery::LoremIpsum < Forgery
48
48
  end
49
49
 
50
50
  def self.sentences(quantity=2, options={})
51
- options.merge!(:random_limit => (dictionaries[:lorem_ipsum].length-quantity)) if quantity.is_a?(Fixnum)
51
+ options.merge!(:random_limit => (dictionaries[:lorem_ipsum].length-quantity)) if quantity.is_a?(Integer)
52
52
 
53
53
  dictionaries[:lorem_ipsum][range_from_quantity(quantity, options)].join(" ")
54
54
  end
@@ -65,7 +65,7 @@ class Forgery::LoremIpsum < Forgery
65
65
  :html => false,
66
66
  :sentences => 3}
67
67
  options = default_options.merge(options)
68
- options.merge!(:random_limit => (dictionaries[:lorem_ipsum].length/options[:sentences])-quantity) if quantity.is_a?(Fixnum)
68
+ options.merge!(:random_limit => (dictionaries[:lorem_ipsum].length/options[:sentences])-quantity) if quantity.is_a?(Integer)
69
69
 
70
70
  if options[:html]
71
71
  options[:wrap] = { :start => "<p>",