quick_faker 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/data/faker.yaml +423 -0
- data/lib/quick_faker.rb +73 -9
- data.tar.gz.sig +0 -0
- metadata +42 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 289ffa96cfd99d88259757db9f4784d29ea68f312c3ce04b55d5ddf498b39864
|
4
|
+
data.tar.gz: 2cdce508302b2f541c22f26ace222129a2b31d5f128bc2f7cbc3e9a7a6c1d92f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97fe1f8c1ebe7949534c06e410c5aa8788da695b4ab66b55dbcc5815da253241fee375d0954f457fbbc1c911e7f87ed40c3450addcf651af5515a5e96f91a5ad
|
7
|
+
data.tar.gz: 5b66240f189374b6db1670808514c62468ec19ebb3cca353ff5aebf8d92d38f020d3f97230697dee8273c330601caf7b76cd04d984d346bb91c15b31794adfbc
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/data/faker.yaml
CHANGED
@@ -22,6 +22,114 @@
|
|
22
22
|
- Faker::Address.latitude
|
23
23
|
- Faker::Address.longitude
|
24
24
|
- Faker::Address.full_address
|
25
|
+
- - Alphanumeric
|
26
|
+
- []
|
27
|
+
- - Ancient
|
28
|
+
- - Faker::Ancient.god
|
29
|
+
- Faker::Ancient.primordial
|
30
|
+
- Faker::Ancient.titan
|
31
|
+
- Faker::Ancient.hero
|
32
|
+
- - App
|
33
|
+
- - Faker::App.name
|
34
|
+
- Faker::App.version
|
35
|
+
- Faker::App.author
|
36
|
+
- Faker::App.semantic_version
|
37
|
+
- - Appliance
|
38
|
+
- - Faker::Appliance.brand
|
39
|
+
- Faker::Appliance.equipment
|
40
|
+
- - Artist
|
41
|
+
- - Faker::Artist.name
|
42
|
+
- - Avatar
|
43
|
+
- - Faker::Avatar.image
|
44
|
+
- - Bank
|
45
|
+
- - Faker::Bank.account_number
|
46
|
+
- Faker::Bank.iban
|
47
|
+
- Faker::Bank.name
|
48
|
+
- Faker::Bank.routing_number
|
49
|
+
- Faker::Bank.swift_bic
|
50
|
+
- - Barcode
|
51
|
+
- - Faker::Barcode.ean
|
52
|
+
- Faker::Barcode.ean(8)
|
53
|
+
- Faker::Barcode.ean(13)
|
54
|
+
- Faker::Barcode.ean_with_composite_symbology
|
55
|
+
- Faker::Barcode.ean_with_composite_symbology(8)
|
56
|
+
- Faker::Barcode.ean_with_composite_symbology(13)
|
57
|
+
- Faker::Barcode.upc_a
|
58
|
+
- Faker::Barcode.upc_a_with_composite_symbology
|
59
|
+
- Faker::Barcode.upc_e
|
60
|
+
- Faker::Barcode.upc_e_with_composite_symbology
|
61
|
+
- Faker::Barcode.isbn
|
62
|
+
- Faker::Barcode.ismn
|
63
|
+
- Faker::Barcode.issn
|
64
|
+
- - Beer
|
65
|
+
- - Faker::Beer.brand
|
66
|
+
- Faker::Beer.name
|
67
|
+
- Faker::Beer.style
|
68
|
+
- Faker::Beer.hop
|
69
|
+
- Faker::Beer.yeast
|
70
|
+
- Faker::Beer.malts
|
71
|
+
- Faker::Beer.ibu
|
72
|
+
- Faker::Beer.alcohol
|
73
|
+
- Faker::Beer.blg
|
74
|
+
- - Blood
|
75
|
+
- - Faker::Blood.type
|
76
|
+
- Faker::Blood.rh_factor
|
77
|
+
- Faker::Blood.group
|
78
|
+
- - Boolean
|
79
|
+
- - Faker::Boolean.boolean
|
80
|
+
- - Business
|
81
|
+
- - Faker::Business.credit_card_number
|
82
|
+
- Faker::Business.credit_card_expiry_date
|
83
|
+
- Faker::Business.credit_card_type
|
84
|
+
- - Camera
|
85
|
+
- - Faker::Camera.brand
|
86
|
+
- Faker::Camera.model
|
87
|
+
- Faker::Camera.brand_with_model
|
88
|
+
- - Cannabis
|
89
|
+
- - Faker::Cannabis.strain
|
90
|
+
- Faker::Cannabis.cannabinoid_abbreviation
|
91
|
+
- Faker::Cannabis.cannabinoid
|
92
|
+
- Faker::Cannabis.terpene
|
93
|
+
- Faker::Cannabis.medical_use
|
94
|
+
- Faker::Cannabis.health_benefit
|
95
|
+
- Faker::Cannabis.category
|
96
|
+
- Faker::Cannabis.type
|
97
|
+
- Faker::Cannabis.buzzword
|
98
|
+
- Faker::Cannabis.brand
|
99
|
+
- - Code
|
100
|
+
- - Faker::Code.npi
|
101
|
+
- Faker::Code.isbn
|
102
|
+
- Faker::Code.ean
|
103
|
+
- Faker::Code.rut
|
104
|
+
- Faker::Code.nric
|
105
|
+
- Faker::Code.imei
|
106
|
+
- Faker::Code.asin
|
107
|
+
- Faker::Code.sin
|
108
|
+
- - Coffee
|
109
|
+
- - Faker::Coffee.blend_name
|
110
|
+
- Faker::Coffee.origin
|
111
|
+
- Faker::Coffee.variety
|
112
|
+
- Faker::Coffee.notes
|
113
|
+
- Faker::Coffee.intensifier
|
114
|
+
- - Coin
|
115
|
+
- - Faker::Coin.flip
|
116
|
+
- Faker::Coin.name
|
117
|
+
- - Color
|
118
|
+
- - Faker::Color.hex_color
|
119
|
+
- Faker::Color.color_name
|
120
|
+
- Faker::Color.rgb_color
|
121
|
+
- Faker::Color.hsl_color
|
122
|
+
- Faker::Color.hsla_color
|
123
|
+
- - Commerce
|
124
|
+
- - Faker::Commerce.color
|
125
|
+
- Faker::Commerce.department
|
126
|
+
- Faker::Commerce.material
|
127
|
+
- Faker::Commerce.product_name
|
128
|
+
- Faker::Commerce.price
|
129
|
+
- Faker::Commerce.promotion_code
|
130
|
+
- Faker::Commerce.material
|
131
|
+
- Faker::Commerce.brand
|
132
|
+
- Faker::Commerce.vendor
|
25
133
|
- - Company
|
26
134
|
- - Faker::Company.name
|
27
135
|
- Faker::Company.suffix
|
@@ -50,8 +158,74 @@
|
|
50
158
|
- Faker::Company.brazilian_company_number
|
51
159
|
- Faker::Company.sic_code
|
52
160
|
- Faker::Company.russian_tax_number
|
161
|
+
- - Compass
|
162
|
+
- - Faker::Compass.direction
|
163
|
+
- Faker::Compass.cardinal
|
164
|
+
- Faker::Compass.ordinal
|
165
|
+
- Faker::Compass.half_wind
|
166
|
+
- Faker::Compass.quarter_wind
|
167
|
+
- Faker::Compass.abbreviation
|
168
|
+
- Faker::Compass.cardinal_abbreviation
|
169
|
+
- Faker::Compass.ordinal_abbreviation
|
170
|
+
- Faker::Compass.half_wind_abbreviation
|
171
|
+
- Faker::Compass.quarter_wind_abbreviation
|
172
|
+
- Faker::Compass.azimuth
|
173
|
+
- Faker::Compass.cardinal_azimuth
|
174
|
+
- Faker::Compass.ordinal_azimuth
|
175
|
+
- Faker::Compass.half_wind_azimuth
|
176
|
+
- Faker::Compass.quarter_wind_azimuth
|
177
|
+
- - Computer
|
178
|
+
- - Faker::Computer.platform
|
179
|
+
- Faker::Computer.type
|
180
|
+
- Faker::Computer.os
|
181
|
+
- Faker::Computer.stack
|
182
|
+
- - Construction
|
183
|
+
- - Faker::Construction.material
|
184
|
+
- Faker::Construction.subcontract_category
|
185
|
+
- Faker::Construction.heavy_equipment
|
186
|
+
- Faker::Construction.trade
|
187
|
+
- Faker::Construction.standard_cost_code
|
188
|
+
- Faker::Construction.role
|
189
|
+
- - Cosmere
|
190
|
+
- - Faker::Cosmere.aon
|
191
|
+
- Faker::Cosmere.shard_world
|
192
|
+
- Faker::Cosmere.shard
|
193
|
+
- Faker::Cosmere.surge
|
194
|
+
- Faker::Cosmere.knight_radiant
|
195
|
+
- Faker::Cosmere.metal
|
196
|
+
- Faker::Cosmere.allomancer
|
197
|
+
- Faker::Cosmere.feruchemist
|
198
|
+
- Faker::Cosmere.herald
|
199
|
+
- Faker::Cosmere.spren
|
200
|
+
- - Crypto
|
201
|
+
- - Faker::Crypto.md5
|
202
|
+
- Faker::Crypto.sha1
|
203
|
+
- Faker::Crypto.sha256
|
204
|
+
- Faker::Crypto.sha512
|
205
|
+
- - Currency
|
206
|
+
- - Faker::Currency.name
|
207
|
+
- Faker::Currency.code
|
208
|
+
- Faker::Currency.symbol
|
53
209
|
- - Date
|
54
210
|
- - Faker::Date.in_date_period
|
211
|
+
- - Demographic
|
212
|
+
- - Faker::Demographic.race
|
213
|
+
- Faker::Demographic.educational_attainment
|
214
|
+
- Faker::Demographic.demonym
|
215
|
+
- Faker::Demographic.marital_status
|
216
|
+
- Faker::Demographic.sex
|
217
|
+
- Faker::Demographic.height
|
218
|
+
- - Dessert
|
219
|
+
- - Faker::Dessert.variety
|
220
|
+
- Faker::Dessert.topping
|
221
|
+
- Faker::Dessert.flavor
|
222
|
+
- - Device
|
223
|
+
- - Faker::Device.build_number
|
224
|
+
- Faker::Device.manufacturer
|
225
|
+
- Faker::Device.model_name
|
226
|
+
- Faker::Device.platform
|
227
|
+
- Faker::Device.serial
|
228
|
+
- Faker::Device.version
|
55
229
|
- - Educator
|
56
230
|
- - Faker::Educator.university
|
57
231
|
- Faker::Educator.secondary_school
|
@@ -60,12 +234,151 @@
|
|
60
234
|
- Faker::Educator.course_name
|
61
235
|
- Faker::Educator.subject
|
62
236
|
- Faker::Educator.campus
|
237
|
+
- - Emotion
|
238
|
+
- - Faker::Emotion.noun
|
239
|
+
- Faker::Emotion.adjective
|
240
|
+
- - Esport
|
241
|
+
- - Faker::Esport.player
|
242
|
+
- Faker::Esport.team
|
243
|
+
- Faker::Esport.league
|
244
|
+
- Faker::Esport.event
|
245
|
+
- Faker::Esport.game
|
246
|
+
- - File
|
247
|
+
- - Faker::File.extension
|
248
|
+
- Faker::File.mime_type
|
249
|
+
- Faker::File.dir
|
250
|
+
- - Fillmurray
|
251
|
+
- - Faker::Fillmurray.image
|
252
|
+
- - Finance
|
253
|
+
- - Faker::Finance.credit_card
|
254
|
+
- Faker::Finance.credit_card(:mastercard)
|
255
|
+
- Faker::Finance.credit_card(:mastercard,
|
256
|
+
- Faker::Finance.vat_number
|
257
|
+
- Faker::Finance.ticker
|
258
|
+
- Faker::Finance.ticker('NASDAQ')
|
259
|
+
- Faker::Finance.stock_market
|
260
|
+
- - Food
|
261
|
+
- - Faker::Food.description
|
262
|
+
- Faker::Food.dish
|
263
|
+
- Faker::Food.ethnic_category
|
264
|
+
- Faker::Food.fruits
|
265
|
+
- Faker::Food.ingredient
|
266
|
+
- Faker::Food.measurement
|
267
|
+
- Faker::Food.metric_measurement
|
268
|
+
- Faker::Food.spice
|
269
|
+
- Faker::Food.sushi
|
270
|
+
- Faker::Food.vegetables
|
63
271
|
- - Gender
|
64
272
|
- - Faker::Gender.type
|
65
273
|
- Faker::Gender.binary_type
|
66
274
|
- Faker::Gender.short_binary_type
|
275
|
+
- - Hacker
|
276
|
+
- - Faker::Hacker.say_something_smart
|
277
|
+
- Faker::Hacker.abbreviation
|
278
|
+
- Faker::Hacker.adjective
|
279
|
+
- Faker::Hacker.noun
|
280
|
+
- Faker::Hacker.verb
|
281
|
+
- Faker::Hacker.ingverb
|
282
|
+
- - Hipster
|
283
|
+
- - Faker::Hipster.word
|
284
|
+
- Faker::Hipster.words
|
285
|
+
- Faker::Hipster.sentence
|
286
|
+
- Faker::Hipster.sentences
|
287
|
+
- Faker::Hipster.paragraph
|
288
|
+
- Faker::Hipster.paragraphs
|
289
|
+
- Faker::Hipster.paragraph_by_chars
|
67
290
|
- - Hobby
|
68
291
|
- - Faker::Hobby.activity
|
292
|
+
- - House
|
293
|
+
- - Faker::House.furniture
|
294
|
+
- Faker::House.room
|
295
|
+
- - Internet
|
296
|
+
- - Faker::Internet.user
|
297
|
+
- Faker::Internet.user('username',
|
298
|
+
- Faker::Internet.email
|
299
|
+
- Faker::Internet.free_email
|
300
|
+
- Faker::Internet.safe_email
|
301
|
+
- Faker::Internet.username
|
302
|
+
- Faker::Internet.password
|
303
|
+
- Faker::Internet.domain_name
|
304
|
+
- Faker::Internet.domain_word
|
305
|
+
- Faker::Internet.domain_suffix
|
306
|
+
- Faker::Internet.ip_v4_address
|
307
|
+
- Faker::Internet.private_ip_v4_address
|
308
|
+
- Faker::Internet.public_ip_v4_address
|
309
|
+
- Faker::Internet.ip_v4_cidr
|
310
|
+
- Faker::Internet.ip_v6_address
|
311
|
+
- Faker::Internet.ip_v6_cidr
|
312
|
+
- Faker::Internet.mac_address
|
313
|
+
- Faker::Internet.url
|
314
|
+
- Faker::Internet.slug
|
315
|
+
- Faker::Internet.user_agent
|
316
|
+
- Faker::Internet.uuid
|
317
|
+
- - Invoice
|
318
|
+
- - Faker::Invoice.reference
|
319
|
+
- Faker::Invoice.creditor_reference
|
320
|
+
- - Job
|
321
|
+
- - Faker::Job.title
|
322
|
+
- Faker::Job.field
|
323
|
+
- Faker::Job.seniority
|
324
|
+
- Faker::Job.position
|
325
|
+
- Faker::Job.key_skill
|
326
|
+
- Faker::Job.employment_type
|
327
|
+
- Faker::Job.education_level
|
328
|
+
- - Json
|
329
|
+
- []
|
330
|
+
- - Kpop
|
331
|
+
- - Faker::Kpop.i_groups
|
332
|
+
- Faker::Kpop.ii_groups
|
333
|
+
- Faker::Kpop.iii_groups
|
334
|
+
- Faker::Kpop.girl_groups
|
335
|
+
- Faker::Kpop.boy_bands
|
336
|
+
- Faker::Kpop.solo
|
337
|
+
- - Lorem
|
338
|
+
- - Faker::Lorem.word
|
339
|
+
- Faker::Lorem.words
|
340
|
+
- Faker::Lorem.multibyte
|
341
|
+
- Faker::Lorem.characters
|
342
|
+
- Faker::Lorem.sentence
|
343
|
+
- Faker::Lorem.sentences
|
344
|
+
- Faker::Lorem.paragraph
|
345
|
+
- Faker::Lorem.paragraphs
|
346
|
+
- Faker::Lorem.question
|
347
|
+
- Faker::Lorem.paragraph_by_chars
|
348
|
+
- - Markdown
|
349
|
+
- - Faker::Markdown.headers
|
350
|
+
- Faker::Markdown.emphasis
|
351
|
+
- Faker::Markdown.ordered_list
|
352
|
+
- Faker::Markdown.unordered_list
|
353
|
+
- Faker::Markdown.inline_code
|
354
|
+
- Faker::Markdown.block_code
|
355
|
+
- Faker::Markdown.table
|
356
|
+
- Faker::Markdown.random
|
357
|
+
- Faker::Markdown.random("table")
|
358
|
+
- Faker::Markdown.random("ordered_list",
|
359
|
+
- Faker::Markdown.sandwich
|
360
|
+
- - Marketing
|
361
|
+
- - Faker::Marketing.buzzwords
|
362
|
+
- - Measurement
|
363
|
+
- - Faker::Measurement.height
|
364
|
+
- Faker::Measurement.length
|
365
|
+
- Faker::Measurement.volume
|
366
|
+
- Faker::Measurement.weight
|
367
|
+
- Faker::Measurement.metric_height
|
368
|
+
- Faker::Measurement.metric_length
|
369
|
+
- Faker::Measurement.metric_volume
|
370
|
+
- Faker::Measurement.metric_weight
|
371
|
+
- - Military
|
372
|
+
- - Faker::Military.army_rank
|
373
|
+
- Faker::Military.marines_rank
|
374
|
+
- Faker::Military.navy_rank
|
375
|
+
- Faker::Military.air_force_rank
|
376
|
+
- Faker::Military.space_force_rank
|
377
|
+
- Faker::Military.coast_guard_rank
|
378
|
+
- Faker::Military.dod_paygrade
|
379
|
+
- - Mountain
|
380
|
+
- - Faker::Mountain.name
|
381
|
+
- Faker::Mountain.range
|
69
382
|
- - Name
|
70
383
|
- - Faker::Name.name
|
71
384
|
- Faker::Name.name_with_middle
|
@@ -77,12 +390,120 @@
|
|
77
390
|
- Faker::Name.prefix
|
78
391
|
- Faker::Name.suffix
|
79
392
|
- Faker::Name.initials
|
393
|
+
- - Nation
|
394
|
+
- - Faker::Nation.nationality
|
395
|
+
- Faker::Nation.language
|
396
|
+
- Faker::Nation.capital_city
|
397
|
+
- Faker::Nation.national_sport
|
398
|
+
- Faker::Nation.flag
|
399
|
+
- - Number
|
400
|
+
- - Faker::Number.positive
|
401
|
+
- Faker::Number.negative
|
402
|
+
- Faker::Number.non_zero_digit
|
403
|
+
- Faker::Number.digit
|
404
|
+
- - Omniauth
|
405
|
+
- - Faker::Omniauth.google
|
406
|
+
- Faker::Omniauth.facebook
|
407
|
+
- Faker::Omniauth.twitter
|
408
|
+
- Faker::Omniauth.linkedin
|
409
|
+
- Faker::Omniauth.github
|
410
|
+
- Faker::Omniauth.apple
|
411
|
+
- Faker::Omniauth.auth0
|
412
|
+
- - Placeholdit
|
413
|
+
- - Faker::Placeholdit.image
|
80
414
|
- - Relationship
|
81
415
|
- - Faker::Relationship.familial
|
82
416
|
- Faker::Relationship.spouse
|
83
417
|
- Faker::Relationship.parent
|
84
418
|
- Faker::Relationship.in_law
|
85
419
|
- Faker::Relationship.sibling
|
420
|
+
- - Restaurant
|
421
|
+
- - Faker::Restaurant.name
|
422
|
+
- Faker::Restaurant.type
|
423
|
+
- Faker::Restaurant.description
|
424
|
+
- Faker::Restaurant.review
|
425
|
+
- - Science
|
426
|
+
- - Faker::Science.science
|
427
|
+
- Faker::Science.science(:natural,
|
428
|
+
- Faker::Science.science(:formal,
|
429
|
+
- Faker::Science.element
|
430
|
+
- Faker::Science.element_symbol
|
431
|
+
- Faker::Science.element_state
|
432
|
+
- Faker::Science.element_subcategory
|
433
|
+
- Faker::Science.scientist
|
434
|
+
- Faker::Science.scientist
|
435
|
+
- Faker::Science.modifier
|
436
|
+
- Faker::Science.tool
|
437
|
+
- - Source
|
438
|
+
- - Faker::Source.hello_world
|
439
|
+
- Faker::Source.print
|
440
|
+
- Faker::Source.print_1_to_10
|
441
|
+
- - Space
|
442
|
+
- - Faker::Space.planet
|
443
|
+
- Faker::Space.moon
|
444
|
+
- Faker::Space.galaxy
|
445
|
+
- Faker::Space.nebula
|
446
|
+
- Faker::Space.star_cluster
|
447
|
+
- Faker::Space.constellation
|
448
|
+
- Faker::Space.star
|
449
|
+
- Faker::Space.agency
|
450
|
+
- Faker::Space.agency_abv
|
451
|
+
- Faker::Space.nasa_space_craft
|
452
|
+
- Faker::Space.company
|
453
|
+
- Faker::Space.distance_measurement
|
454
|
+
- Faker::Space.meteorite
|
455
|
+
- Faker::Space.launch_vehicle
|
456
|
+
- - String
|
457
|
+
- - Faker::String.random
|
458
|
+
- - Stripe
|
459
|
+
- - Faker::Stripe.valid_card
|
460
|
+
- Faker::Stripe.valid_token
|
461
|
+
- Faker::Stripe.invalid_card
|
462
|
+
- Faker::Stripe.month
|
463
|
+
- Faker::Stripe.year
|
464
|
+
- Faker::Stripe.ccv
|
465
|
+
- - Subscription
|
466
|
+
- - Faker::Subscription.plan
|
467
|
+
- Faker::Subscription.status
|
468
|
+
- Faker::Subscription.payment_method
|
469
|
+
- Faker::Subscription.subscription_term
|
470
|
+
- Faker::Subscription.payment_term
|
471
|
+
- - Superhero
|
472
|
+
- - Faker::Superhero.name
|
473
|
+
- Faker::Superhero.power
|
474
|
+
- Faker::Superhero.prefix
|
475
|
+
- Faker::Superhero.suffix
|
476
|
+
- Faker::Superhero.descriptor
|
477
|
+
- - Tea
|
478
|
+
- - Faker::Tea.variety
|
479
|
+
- Faker::Tea.type
|
480
|
+
- - Team
|
481
|
+
- - Faker::Team.creature
|
482
|
+
- Faker::Team.name
|
483
|
+
- Faker::Team.state
|
484
|
+
- Faker::Team.sport
|
485
|
+
- Faker::Team.mascot
|
486
|
+
- - Time
|
487
|
+
- []
|
488
|
+
- - Twitter
|
489
|
+
- - Faker::Twitter.user
|
490
|
+
- Faker::Twitter.status
|
491
|
+
- Faker::Twitter.screen_name
|
492
|
+
- - Types
|
493
|
+
- - Faker::Types.rb_string
|
494
|
+
- Faker::Types.character
|
495
|
+
- Faker::Types.rb_integer
|
496
|
+
- Faker::Types.rb_hash
|
497
|
+
- Faker::Types.complex_rb_hash
|
498
|
+
- Faker::Types.rb_array
|
499
|
+
- Faker::Types.random_type
|
500
|
+
- Faker::Types.random_complex_type
|
501
|
+
- - University
|
502
|
+
- - Faker::University.name
|
503
|
+
- Faker::University.prefix
|
504
|
+
- Faker::University.suffix
|
505
|
+
- Faker::University.greek_organization
|
506
|
+
- Faker::University.greek_alphabet
|
86
507
|
- - Vehicle
|
87
508
|
- - Faker::Vehicle.vin
|
88
509
|
- Faker::Vehicle.manufacture
|
@@ -106,3 +527,5 @@
|
|
106
527
|
- Faker::Vehicle.kilometrage
|
107
528
|
- Faker::Vehicle.license_plate
|
108
529
|
- Faker::Vehicle.singapore_license_plate
|
530
|
+
- - Verbs
|
531
|
+
- []
|
data/lib/quick_faker.rb
CHANGED
@@ -6,43 +6,64 @@
|
|
6
6
|
|
7
7
|
require 'yaml'
|
8
8
|
require 'faker'
|
9
|
+
require 'c32'
|
10
|
+
require 'rxfreader'
|
11
|
+
|
9
12
|
|
10
13
|
class QuickFaker
|
14
|
+
using ColouredText
|
15
|
+
|
16
|
+
attr_reader :a
|
11
17
|
|
12
|
-
def initialize(locale='en-GB')
|
18
|
+
def initialize(locale='en-GB', debug: false)
|
13
19
|
|
20
|
+
@debug = debug
|
14
21
|
Faker::Config.locale = locale
|
15
22
|
s = File.join(File.dirname(__FILE__), '..', 'data', 'faker.yaml')
|
23
|
+
|
16
24
|
a = YAML.load(File.read(s))
|
25
|
+
@a = a.flat_map(&:last)
|
17
26
|
|
18
27
|
load_methods(a)
|
19
28
|
|
20
29
|
end
|
21
30
|
|
22
31
|
def lookup(s, context=nil)
|
32
|
+
|
23
33
|
found = @h[s.to_sym]
|
24
|
-
|
25
|
-
|
34
|
+
puts 'found: ' + found.inspect if @debug
|
35
|
+
|
36
|
+
if found and found[0].is_a? Array
|
37
|
+
|
26
38
|
h = found.map {|x| x.last[/[^:]+(?=\.)/].downcase.to_sym}.zip(found.map(&:first)).to_h
|
27
39
|
if context then
|
28
|
-
h[context].call
|
40
|
+
h[context.to_sym].call
|
29
41
|
elsif h.keys.include? :name
|
30
42
|
h[:name].call
|
31
43
|
else
|
32
|
-
raise 'provide context! options: ' + h.keys.map(&:to_s).join(', ')
|
44
|
+
raise 'provide context! options: ' + h.keys.map(&:to_s).join(', ') \
|
45
|
+
+ "\n try e.g. lookup(:#{s}, :#{h.keys.first})"
|
33
46
|
end
|
34
|
-
|
47
|
+
elsif found
|
35
48
|
found[0].call
|
49
|
+
else
|
50
|
+
puts ('*' + s.to_s + '* not found').warning
|
51
|
+
puts ('try: ').info
|
52
|
+
@a.grep /#{s}/i
|
36
53
|
end
|
37
54
|
end
|
38
55
|
|
39
56
|
def lookup2(s)
|
40
57
|
|
41
58
|
found = @h[s.to_sym]
|
42
|
-
if found[0].is_a? Array then
|
59
|
+
if found and found[0].is_a? Array then
|
43
60
|
found.map(&:last)
|
44
|
-
|
61
|
+
elsif found[0]
|
45
62
|
found.last
|
63
|
+
else
|
64
|
+
puts ('*' + s.to_s + '* not found').warning
|
65
|
+
puts ('try: ').info
|
66
|
+
@a.grep(/#{s}/i)[/[^\.]+$/].uniq.sort
|
46
67
|
end
|
47
68
|
|
48
69
|
end
|
@@ -58,7 +79,7 @@ class QuickFaker
|
|
58
79
|
@h = {}
|
59
80
|
a2.each do |rawname, a|
|
60
81
|
|
61
|
-
puts rawname + '...'
|
82
|
+
puts (' reading ' + rawname + '...').info
|
62
83
|
|
63
84
|
a.each do |mname|
|
64
85
|
|
@@ -84,5 +105,48 @@ class QuickFaker
|
|
84
105
|
end
|
85
106
|
end
|
86
107
|
end
|
108
|
+
|
109
|
+
def method_missing(method_name, *args)
|
110
|
+
lookup(method_name, *args)
|
111
|
+
end
|
87
112
|
end
|
88
113
|
|
114
|
+
class FakerData
|
115
|
+
|
116
|
+
def initialize(topics=nil, filepath: '/tmp/faker.yaml')
|
117
|
+
|
118
|
+
topics ||= %w(Address Company Date Educator Gender Hobby Name Relationship Vehicle)
|
119
|
+
@url = 'https://raw.githubusercontent.com/faker-ruby/faker/master/doc/default/'
|
120
|
+
@topics, @filepath = topics, filepath
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
def build()
|
125
|
+
|
126
|
+
a2 = @topics.map do |rawname|
|
127
|
+
|
128
|
+
puts rawname + '...'
|
129
|
+
name = rawname.downcase
|
130
|
+
url = @url + name + '.md'
|
131
|
+
begin
|
132
|
+
s, _ = RXFReader.read url
|
133
|
+
rescue
|
134
|
+
next
|
135
|
+
end
|
136
|
+
a = s.scan(/Faker::#{rawname}\S+/)
|
137
|
+
a.reject! {|x| x[-1] == ':'}
|
138
|
+
[rawname, a]
|
139
|
+
|
140
|
+
end
|
141
|
+
|
142
|
+
File.write @filepath, a2.compact.to_yaml
|
143
|
+
puts 'written to ' + @filepath
|
144
|
+
|
145
|
+
end
|
146
|
+
|
147
|
+
# returns a list of topics
|
148
|
+
#'
|
149
|
+
def scrape(s)
|
150
|
+
s.scan(/(?<=:)\w+/)
|
151
|
+
end
|
152
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quick_faker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,8 +35,28 @@ cert_chain:
|
|
35
35
|
zRDYM4cF85i758WhmABR7kc+eE91nlOvqa7JSKMrkazxZ/wPiQB2NVLNt+Acln/h
|
36
36
|
iC3Xzki6KMIM9QE5d5Q/ggVC
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-05-
|
38
|
+
date: 2022-05-28 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: c32
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.3'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.3.0
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0.3'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.3.0
|
40
60
|
- !ruby/object:Gem::Dependency
|
41
61
|
name: faker
|
42
62
|
requirement: !ruby/object:Gem::Requirement
|
@@ -57,6 +77,26 @@ dependencies:
|
|
57
77
|
- - ">="
|
58
78
|
- !ruby/object:Gem::Version
|
59
79
|
version: 2.21.0
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rxfreader
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - "~>"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0.3'
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.3.3
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.3'
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 0.3.3
|
60
100
|
description:
|
61
101
|
email: digital.robertson@gmail.com
|
62
102
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|