forgery 0.7.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -3
- data/Gemfile.lock +4 -4
- data/README.markdown +177 -193
- data/forgery.gemspec +4 -4
- data/lib/forgery/forgery/basic.rb +1 -1
- data/lib/forgery/version.rb +3 -1
- data/spec/forgery/monetary_spec.rb +5 -5
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 76b44d025c21b45dc7df8213246deb73529223357e862efb5278c5ffa3bcc7ef
|
4
|
+
data.tar.gz: 5f905c142572cc921c5c2742cef6ecf192e6cc2570dd1fff234f5313ce658ee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68431f47e7370aa37d807779d0253e9dd9b81d49b8e8e02f47a6d6f240f146dd7b986fbcd0b71796c9f397fb6919501fda5afc422f9d9e2dc976f2da4a6833b0
|
7
|
+
data.tar.gz: 01ed166d1e736194f9d67b80870ab3c116bea2764660504e22bf23e37c8cbf08183b86fcc9e797d6ca28de7c222c750fedf90ebe12de57a7f8cf283f1c182864
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
forgery (0.
|
4
|
+
forgery (0.8.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
diff-lcs (1.3)
|
10
|
-
rake (
|
10
|
+
rake (13.0.1)
|
11
11
|
rspec (3.7.0)
|
12
12
|
rspec-core (~> 3.7.0)
|
13
13
|
rspec-expectations (~> 3.7.0)
|
@@ -26,10 +26,10 @@ PLATFORMS
|
|
26
26
|
ruby
|
27
27
|
|
28
28
|
DEPENDENCIES
|
29
|
-
bundler (~> 1.
|
29
|
+
bundler (~> 2.1.4)
|
30
30
|
forgery!
|
31
31
|
rake
|
32
32
|
rspec
|
33
33
|
|
34
34
|
BUNDLED WITH
|
35
|
-
1.
|
35
|
+
2.1.4
|
data/README.markdown
CHANGED
@@ -1,21 +1,17 @@
|
|
1
|
-
Forgery
|
2
|
-
=======
|
3
|
-
|
4
|
-
[![Build Status](https://travis-ci.org/sevenwire/forgery.png)](https://travis-ci.org/sevenwire/forgery)
|
5
|
-
[![Code Climate](https://codeclimate.com/github/sevenwire/forgery.png)](https://codeclimate.com/github/sevenwire/forgery)
|
1
|
+
# Forgery
|
6
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/sevenwire/forgery.svg)](https://travis-ci.org/sevenwire/forgery)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/sevenwire/forgery.svg)](https://codeclimate.com/github/sevenwire/forgery)
|
7
5
|
|
8
6
|
**A Problem**:
|
9
|
-
It's harder than
|
7
|
+
It's harder than _absolutely easy_ to make meaningful, simple, data for testing and development.
|
10
8
|
|
11
9
|
**A Solution**:
|
12
10
|
A fake data generator that provides not only a host of basics and a rememberable syntax, but a customizable library to boot.
|
13
11
|
|
14
12
|
Welcome to Forgery, an excellent solution to a problem so hard you didn't know it was there.
|
15
13
|
|
16
|
-
|
17
|
-
Using
|
18
|
-
-----
|
14
|
+
## Using
|
19
15
|
|
20
16
|
You'll want to read individual Forgery categories for more information, but these are the basics:
|
21
17
|
|
@@ -38,7 +34,7 @@ Forgery(:monetary).formatted_money :min => 100, :max => 1000
|
|
38
34
|
|
39
35
|
And many many more!
|
40
36
|
|
41
|
-
Alternatively you can write it like this:
|
37
|
+
Alternatively you can write it like this:
|
42
38
|
|
43
39
|
```ruby
|
44
40
|
Forgery::Basic.hex_color
|
@@ -49,24 +45,21 @@ Forgery::Personal.shirt_size
|
|
49
45
|
In addition, you can always write your own dictionaries and formats, overriding the ones in the gem.
|
50
46
|
Fully explained here.
|
51
47
|
|
52
|
-
|
53
|
-
Installing
|
54
|
-
----------
|
48
|
+
## Installing
|
55
49
|
|
56
50
|
Like any gem, you can install Forgery two ways depending on it's use.
|
57
51
|
|
58
52
|
For normal Ruby development, you need simply use:
|
59
53
|
|
60
54
|
```bash
|
61
|
-
|
55
|
+
gem install forgery
|
62
56
|
```
|
63
57
|
|
64
58
|
This will add it to your gem library, just like any normal gem.
|
65
59
|
You can then use it like any normal gem library.
|
66
60
|
See examples for more.
|
67
61
|
|
68
|
-
|
69
|
-
**Rails 3.x**
|
62
|
+
### Rails 3.x
|
70
63
|
|
71
64
|
If you're using Rails 3.x you need to do a few extra things (that are probably rote).
|
72
65
|
First step is to add it to your `Rails.root/Gemfile`, we also suggest specifying the latest version (found on rubygems):
|
@@ -78,11 +71,11 @@ gem 'forgery', '0.6.0'
|
|
78
71
|
Then you'll need to run `bundle install` to install and lock in your new gem.
|
79
72
|
Next you'll want to run the special Rails 3 generator:
|
80
73
|
|
81
|
-
```
|
82
|
-
|
74
|
+
```bash
|
75
|
+
bundle exec rails generate forgery
|
83
76
|
```
|
84
77
|
|
85
|
-
|
78
|
+
### Rails 2.x
|
86
79
|
|
87
80
|
For **Rails 2.x** you'll need to do something a little different, by first editing your `Rails.root/config/environment.rb` and adding this to the configuration block:
|
88
81
|
|
@@ -93,10 +86,10 @@ config.gem 'forgery'
|
|
93
86
|
Then you'll need to run this in your command line:
|
94
87
|
|
95
88
|
```bash
|
96
|
-
|
89
|
+
script/generate forgery
|
97
90
|
```
|
98
91
|
|
99
|
-
|
92
|
+
### Generators
|
100
93
|
|
101
94
|
This Rails generators will make these directories in your Rails.root directory:
|
102
95
|
|
@@ -108,185 +101,177 @@ This Rails generators will make these directories in your Rails.root directory:
|
|
108
101
|
|
109
102
|
You can then use these directories to write your own dictionaries, class extensions, forgeries, and formats.
|
110
103
|
|
111
|
-
Full List of
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
`Forgery('address').
|
117
|
-
`Forgery('address').
|
118
|
-
`Forgery('address').
|
119
|
-
`Forgery('address').
|
120
|
-
`Forgery('address').
|
121
|
-
`Forgery('address').
|
122
|
-
`Forgery('address').
|
123
|
-
`Forgery('address').
|
124
|
-
`Forgery('address').
|
125
|
-
`Forgery('address').
|
126
|
-
`Forgery('address').
|
127
|
-
`Forgery('address').
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
`Forgery('basic').
|
134
|
-
`Forgery('basic').
|
135
|
-
`Forgery('basic').
|
136
|
-
`Forgery('basic').
|
137
|
-
`Forgery('basic').
|
138
|
-
`Forgery('basic').
|
139
|
-
`Forgery('basic').
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
`Forgery('credit_card').
|
146
|
-
`Forgery('
|
147
|
-
`Forgery('
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
`Forgery('date').
|
154
|
-
`Forgery('date').
|
155
|
-
`Forgery('date').
|
156
|
-
`Forgery('date').
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
`Forgery('email').
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
`Forgery('geo').
|
170
|
-
`Forgery('geo').
|
171
|
-
`Forgery('geo').
|
172
|
-
`Forgery('geo').
|
173
|
-
`Forgery('geo').
|
174
|
-
`Forgery('geo').
|
175
|
-
`Forgery('geo').
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
`Forgery('internet').
|
183
|
-
`Forgery('internet').
|
184
|
-
`Forgery('internet').
|
185
|
-
`Forgery('internet').
|
186
|
-
`Forgery('internet').
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
`Forgery('lorem_ipsum').
|
194
|
-
`Forgery('lorem_ipsum').
|
195
|
-
`Forgery('lorem_ipsum').
|
196
|
-
`Forgery('lorem_ipsum').
|
197
|
-
`Forgery('lorem_ipsum').
|
198
|
-
`Forgery('lorem_ipsum').
|
199
|
-
`Forgery('lorem_ipsum').
|
200
|
-
`Forgery('lorem_ipsum').
|
201
|
-
`Forgery('lorem_ipsum').
|
202
|
-
`Forgery('lorem_ipsum').
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
`Forgery('name').
|
216
|
-
`Forgery('name').
|
217
|
-
`Forgery('name').
|
218
|
-
`Forgery('name').
|
219
|
-
`Forgery('name').
|
220
|
-
`Forgery('name').
|
221
|
-
`Forgery('name').
|
222
|
-
`Forgery('name').
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
`Forgery('
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
`Forgery('personal').
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
`Forgery('
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
`Forgery('
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
`Forgery('russian_tax').
|
244
|
-
`Forgery('russian_tax').
|
245
|
-
`Forgery('russian_tax').
|
246
|
-
`Forgery('russian_tax').
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
`Forgery('
|
251
|
-
|
252
|
-
|
253
|
-
:------------------------------ |:----------------
|
254
|
-
`Forgery('time').zone` | Amsterdam (`String`)
|
255
|
-
|
256
|
-
|
257
|
-
Contributing
|
258
|
-
------------
|
104
|
+
## Full List of Methods
|
105
|
+
|
106
|
+
| Address | Example Output |
|
107
|
+
| :----------------------------------- | :---------------- |
|
108
|
+
| `Forgery('address').city` | Loomis |
|
109
|
+
| `Forgery('address').continent` | South America |
|
110
|
+
| `Forgery('address').country` | Cameroon |
|
111
|
+
| `Forgery('address').phone` | +1 (693) 901-4549 |
|
112
|
+
| `Forgery('address').province` | Alberta |
|
113
|
+
| `Forgery('address').province_abbrev` | NT |
|
114
|
+
| `Forgery('address').state` | Alabama |
|
115
|
+
| `Forgery('address').state_abbrev` | SC |
|
116
|
+
| `Forgery('address').street_address` | 21 Hayes Park |
|
117
|
+
| `Forgery('address').street_name` | Oneill |
|
118
|
+
| `Forgery('address').street_number` | 222 |
|
119
|
+
| `Forgery('address').street_suffix` | Drive |
|
120
|
+
| `Forgery('address').zip` | 11281-5568 |
|
121
|
+
|
122
|
+
| Basic | Example Output |
|
123
|
+
| :--------------------------------- | :--------------------------------------- |
|
124
|
+
| `Forgery('basic').boolean` | `true` (`TrueClass`) |
|
125
|
+
| `Forgery('basic').color` | Red |
|
126
|
+
| `Forgery('basic').encrypt` | fc0d835dd4e4df144a33a6a346298b0f23dcd14a |
|
127
|
+
| `Forgery('basic').frequency` | Never |
|
128
|
+
| `Forgery('basic').hex_color` | #e1d82a |
|
129
|
+
| `Forgery('basic').number` | 4 |
|
130
|
+
| `Forgery('basic').password` | KcLBHCv6 |
|
131
|
+
| `Forgery('basic').short_hex_color` | #c1d |
|
132
|
+
| `Forgery('basic').text` | G8gECFfvDs2 |
|
133
|
+
|
134
|
+
| Credit Card | Example Output |
|
135
|
+
| :------------------------------------------- | :----------------- |
|
136
|
+
| `Forgery('credit_card').check_digit(number)` | 5 |
|
137
|
+
| `Forgery('credit_card').number` | 343682330855371 |
|
138
|
+
| `Forgery('credit_card').type` | American Express |
|
139
|
+
| `Forgery('currency').code` | XPF |
|
140
|
+
| `Forgery('currency').description` | Austria Schillings |
|
141
|
+
|
142
|
+
| Date | Example Output |
|
143
|
+
| :------------------------------- | :------------------------ |
|
144
|
+
| `Forgery('date').date` | Fri, 20 Mar 2009 (`Date`) |
|
145
|
+
| `Forgery('date').day` | 15 |
|
146
|
+
| `Forgery('date').day_of_week` | Monday |
|
147
|
+
| `Forgery('date').delta(options)` | 3 |
|
148
|
+
| `Forgery('date').month` | January |
|
149
|
+
| `Forgery('date').year` | 1994 |
|
150
|
+
|
151
|
+
| Email | Example Output |
|
152
|
+
| :------------------------- | :------------------------------------------- |
|
153
|
+
| `Forgery('email').address` | gsmith@kamba.org |
|
154
|
+
| `Forgery('email').body` | Lorem ipsum dolor sit amet, consectetuer ... |
|
155
|
+
| `Forgery('email').subject` | Lorem Ipsum Dolor Sit Amet... |
|
156
|
+
|
157
|
+
| Geo | Example Output |
|
158
|
+
| :----------------------------------- | :--------------------------- |
|
159
|
+
| `Forgery('geo').latitude` | -8.095096815540515 (`Float`) |
|
160
|
+
| `Forgery('geo').latitude_degrees` | -49 |
|
161
|
+
| `Forgery('geo').latitude_direction` | N |
|
162
|
+
| `Forgery('geo').latitude_minutes` | 14 |
|
163
|
+
| `Forgery('geo').latitude_seconds` | 45 |
|
164
|
+
| `Forgery('geo').longitude` | -22.56746406884514 (`Float`) |
|
165
|
+
| `Forgery('geo').longitude_degrees` | 100 |
|
166
|
+
| `Forgery('geo').longitude_direction` | W |
|
167
|
+
| `Forgery('geo').longitude_minutes` | 47 |
|
168
|
+
| `Forgery('geo').longitude_seconds` | 41 |
|
169
|
+
|
170
|
+
| Internet | Example Output |
|
171
|
+
| :------------------------------------- | :-------------------------------------- |
|
172
|
+
| `Forgery('internet').cctld` | cf |
|
173
|
+
| `Forgery('internet').domain_name` | bubbletube.net |
|
174
|
+
| `Forgery('internet').email_address` | cwalker@quire.name |
|
175
|
+
| `Forgery('internet').email_subject` | Lorem Ipsum Dolor Sit Amet... |
|
176
|
+
| `Forgery('internet').ip_v4` | 94.120.51.103 |
|
177
|
+
| `Forgery('internet').ip_v6` | c61e:5926:15e6:d225:8eef:fb39:7412:e9d5 |
|
178
|
+
| `Forgery('internet').top_level_domain` | com |
|
179
|
+
| `Forgery('internet').user_name` | sdixon |
|
180
|
+
|
181
|
+
| Lorem Ipsum | Example Output |
|
182
|
+
| :----------------------------------------------------- | :---------------------------------------- |
|
183
|
+
| `Forgery('lorem_ipsum').character` | l |
|
184
|
+
| `Forgery('lorem_ipsum').characters` | lorem ipsu |
|
185
|
+
| `Forgery('lorem_ipsum').lorem_ipsum_characters` | lorem ipsum dolor sit amet... |
|
186
|
+
| `Forgery('lorem_ipsum').lorem_ipsum_words` | ["lorem", "ipsum", "dolor", ...](`Array`) |
|
187
|
+
| `Forgery('lorem_ipsum').paragraph` | Lorem ipsum dolor sit amet... |
|
188
|
+
| `Forgery('lorem_ipsum').paragraphs` | Lorem ipsum dolor sit amet... |
|
189
|
+
| `Forgery('lorem_ipsum').range_from_quantity(quantity)` | 0..4 (`Range`) |
|
190
|
+
| `Forgery('lorem_ipsum').sentence` | Lorem ipsum dolor sit amet... |
|
191
|
+
| `Forgery('lorem_ipsum').sentences` | Lorem ipsum dolor sit amet... |
|
192
|
+
| `Forgery('lorem_ipsum').text` | Lorem ipsum dolor sit amet... |
|
193
|
+
| `Forgery('lorem_ipsum').title` | Lorem Ipsum Dolor Sit Amet... |
|
194
|
+
| `Forgery('lorem_ipsum').word` | lorem |
|
195
|
+
| `Forgery('lorem_ipsum').words` | lorem ipsum dolor sit amet... |
|
196
|
+
|
197
|
+
| Monetary | Example Output |
|
198
|
+
| :------------------------------------ | :-------------- |
|
199
|
+
| `Forgery('monetary').formatted_money` | \$5.49 |
|
200
|
+
| `Forgery('monetary').money` | 9.20 (`String`) |
|
201
|
+
|
202
|
+
| Name | Example Output |
|
203
|
+
| :---------------------------------- | :----------------- |
|
204
|
+
| `Forgery('name').company_name` | Bubbletube |
|
205
|
+
| `Forgery('name').female_first_name` | Judy |
|
206
|
+
| `Forgery('name').first_name` | Albert |
|
207
|
+
| `Forgery('name').full_name` | Evelyn Wallace |
|
208
|
+
| `Forgery('name').industry` | Toy & Hobby Stores |
|
209
|
+
| `Forgery('name').job_title` | Analyst Programmer |
|
210
|
+
| `Forgery('name').job_title_suffix` | III |
|
211
|
+
| `Forgery('name').last_name` | Jackson |
|
212
|
+
| `Forgery('name').location` | Try-N-Save |
|
213
|
+
| `Forgery('name').male_first_name` | Donald |
|
214
|
+
| `Forgery('name').suffix` | Sr |
|
215
|
+
| `Forgery('name').title` | Mr |
|
216
|
+
|
217
|
+
| Personal | Example Output |
|
218
|
+
| :--------------------------------------- | :------------- |
|
219
|
+
| `Forgery('personal').abbreviated_gender` | F |
|
220
|
+
| `Forgery('personal').gender` | Female |
|
221
|
+
| `Forgery('personal').language` | Bislama |
|
222
|
+
| `Forgery('personal').race` | Indonesian |
|
223
|
+
| `Forgery('personal').shirt_size` | 2XL |
|
224
|
+
|
225
|
+
| Bank Account | Example Output |
|
226
|
+
| :----------------------------- | :--------------- |
|
227
|
+
| `Forgery('bank_account').iban` | BE68539007547034 |
|
228
|
+
| `Forgery('bank_account').bic` | VBRSDE33345 |
|
229
|
+
|
230
|
+
| Russian Tax | Example Output |
|
231
|
+
| :-------------------------------------- | :------------------- |
|
232
|
+
| `Forgery('russian_tax').account_number` | 56335652786612121479 |
|
233
|
+
| `Forgery('russian_tax').bik` | 046533860 |
|
234
|
+
| `Forgery('russian_tax').inn` | 7366543467 |
|
235
|
+
| `Forgery('russian_tax').legal_inn` | 7822838630 |
|
236
|
+
| `Forgery('russian_tax').legal_ogrn` | 3483465598635 |
|
237
|
+
| `Forgery('russian_tax').ogrn` | 666325227817763 |
|
238
|
+
| `Forgery('russian_tax').person_inn` | 451559765443 |
|
239
|
+
| `Forgery('russian_tax').person_ogrn` | 195478617554621 |
|
240
|
+
|
241
|
+
| Time | Example Output |
|
242
|
+
| :--------------------- | :------------------- |
|
243
|
+
| `Forgery('time').zone` | Amsterdam (`String`) |
|
244
|
+
|
245
|
+
## Contributing
|
259
246
|
|
260
247
|
This is a work in progress and an open source project, so feel free to contribute.
|
261
248
|
We'll take pull requests via git or suggestions via the issues tab.
|
262
249
|
Any work done on Forgery will get you into the credits list and in our hearts.
|
263
250
|
|
264
|
-
|
265
|
-
Credits
|
266
|
-
-------
|
251
|
+
## Credits
|
267
252
|
|
268
253
|
Thanks to the authors and contributors:
|
269
254
|
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
255
|
+
- Nate Sutton (nate aka fowlduck)
|
256
|
+
- Brandon Arbini (brandonarbini)
|
257
|
+
- Josh Nichols (technicalpickles)
|
258
|
+
- Jeremy Stephens (viking aka crookshanks)
|
259
|
+
- Darcy Laycock (Sutto)
|
260
|
+
- Lukas Westermann (lwe)
|
261
|
+
- Mike Dungan
|
262
|
+
- Andrew Selder (aselder)
|
263
|
+
- Thomas Sinclair (anathematic)
|
264
|
+
- Stafford Brunk (wingrunr21)
|
265
|
+
- SixArm (SixArm)
|
266
|
+
- Akira Matsuda (amatsuda)
|
267
|
+
- Diego Plentz (plentz)
|
268
|
+
- Gabe Berke-Williams (gabebw)
|
269
|
+
- Todd Mazierski (toddmazierski)
|
270
|
+
- Galen Palmer (palmergs)
|
271
|
+
- Matt Bertino (mbbertino)
|
272
|
+
- Olle Jonsson (olleolleolle)
|
273
|
+
|
274
|
+
## Licensing
|
290
275
|
|
291
276
|
Copyright (c) 2007 Sevenwire LLC
|
292
277
|
|
@@ -310,4 +295,3 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
310
295
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
311
296
|
|
312
297
|
On that note, have fun!
|
313
|
-
|
data/forgery.gemspec
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
|
-
$LOAD_PATH.push File.expand_path('
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
3
4
|
require 'forgery/version'
|
4
5
|
|
5
6
|
Gem::Specification.new do |spec|
|
6
7
|
spec.name = 'forgery'
|
7
8
|
spec.version = Forgery::VERSION
|
8
9
|
spec.authors = ['Nathan Sutton', 'Brandon Arbini', 'Kamil Kieliszczyk']
|
9
|
-
spec.email = ['nate@zencoder.com', '
|
10
|
+
spec.email = ['nate@zencoder.com', 'b@arbini.dev', 'kamil@kieliszczyk.net']
|
10
11
|
spec.homepage = 'http://github.com/sevenwire/forgery'
|
11
12
|
spec.summary = 'Easy and customizable generation of forged data.'
|
12
13
|
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
14
|
|
14
15
|
spec.platform = Gem::Platform::RUBY
|
15
16
|
spec.required_rubygems_version = '>= 1.3.6'
|
16
|
-
spec.rubyforge_project = 'forgery'
|
17
17
|
|
18
18
|
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
19
19
|
spec.test_files = `git ls-files spec`.split($INPUT_RECORD_SEPARATOR)
|
20
20
|
spec.require_paths = %w[lib]
|
21
21
|
|
22
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
22
|
+
spec.add_development_dependency 'bundler', '~> 2.1.4'
|
23
23
|
end
|
@@ -50,7 +50,7 @@ class Forgery::Basic < Forgery
|
|
50
50
|
#
|
51
51
|
# Forgery(:basic).encrypt('your-password', Time.utc(2009))
|
52
52
|
# # => "4b157c2fbf430b962842d21926eaa887c3a12f81"
|
53
|
-
def self.encrypt(password="password", salt
|
53
|
+
def self.encrypt(password="password", salt=rand)
|
54
54
|
Digest::SHA1.hexdigest("--#{salt}--#{password}--")
|
55
55
|
end
|
56
56
|
|
data/lib/forgery/version.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'bigdecimal'
|
3
5
|
|
4
6
|
describe Forgery::Monetary do
|
5
|
-
|
6
|
-
it "should return random number string" do
|
7
|
+
it 'should return random number string' do
|
7
8
|
expect(Forgery(:monetary).money).to match(/^[\d+\.]+$/)
|
8
9
|
end
|
9
10
|
|
10
|
-
it
|
11
|
-
expect(BigDecimal
|
11
|
+
it 'should return random number respecting min and max parameters' do
|
12
|
+
expect(BigDecimal(Forgery(:monetary).money({ min: 10, max: 20 }))).to be_between(10, 20)
|
12
13
|
end
|
13
|
-
|
14
14
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forgery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Sutton
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-07-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -18,19 +18,19 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 2.1.4
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.
|
28
|
+
version: 2.1.4
|
29
29
|
description: Easy and customizable generation of forged data. Can be used as a gem
|
30
30
|
or a rails plugin. Includes rails generators for creating your own forgeries.
|
31
31
|
email:
|
32
32
|
- nate@zencoder.com
|
33
|
-
-
|
33
|
+
- b@arbini.dev
|
34
34
|
- kamil@kieliszczyk.net
|
35
35
|
executables: []
|
36
36
|
extensions: []
|
@@ -153,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: 1.3.6
|
155
155
|
requirements: []
|
156
|
-
|
157
|
-
rubygems_version: 2.6.13
|
156
|
+
rubygems_version: 3.1.2
|
158
157
|
signing_key:
|
159
158
|
specification_version: 4
|
160
159
|
summary: Easy and customizable generation of forged data.
|