faker 2.11.0 → 2.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +421 -13
- data/History.md +4 -4
- data/README.md +33 -3
- data/lib/faker.rb +28 -23
- data/lib/faker/blockchain/aeternity.rb +4 -4
- data/lib/faker/blockchain/bitcoin.rb +2 -2
- data/lib/faker/blockchain/tezos.rb +30 -2
- data/lib/faker/books/dune.rb +15 -2
- data/lib/faker/books/lovecraft.rb +8 -4
- data/lib/faker/creature/bird.rb +203 -0
- data/lib/faker/default/address.rb +35 -5
- data/lib/faker/default/app.rb +1 -1
- data/lib/faker/default/avatar.rb +1 -1
- data/lib/faker/default/bank.rb +96 -3
- data/lib/faker/default/barcode.rb +165 -0
- data/lib/faker/default/beer.rb +3 -3
- data/lib/faker/default/blood.rb +48 -0
- data/lib/faker/default/business.rb +1 -1
- data/lib/faker/default/camera.rb +46 -0
- data/lib/faker/default/cannabis.rb +10 -0
- data/lib/faker/default/chile_rut.rb +47 -3
- data/lib/faker/default/chuck_norris.rb +1 -0
- data/lib/faker/default/code.rb +98 -17
- data/lib/faker/default/commerce.rb +74 -11
- data/lib/faker/default/company.rb +96 -11
- data/lib/faker/default/compass.rb +135 -0
- data/lib/faker/default/computer.rb +63 -0
- data/lib/faker/default/construction.rb +54 -0
- data/lib/faker/default/cosmere.rb +90 -0
- data/lib/faker/default/crypto.rb +17 -4
- data/lib/faker/default/crypto_coin.rb +45 -0
- data/lib/faker/default/date.rb +16 -12
- data/lib/faker/default/driving_licence.rb +67 -1
- data/lib/faker/default/drone.rb +332 -0
- data/lib/faker/default/educator.rb +13 -0
- data/lib/faker/default/faker_adjective.rb +35 -0
- data/lib/faker/default/file.rb +53 -2
- data/lib/faker/default/finance.rb +45 -0
- data/lib/faker/default/food.rb +1 -1
- data/lib/faker/default/gender.rb +1 -1
- data/lib/faker/default/hipster.rb +107 -10
- data/lib/faker/default/id_number.rb +122 -2
- data/lib/faker/default/internet.rb +266 -12
- data/lib/faker/default/internet_http.rb +48 -0
- data/lib/faker/default/invoice.rb +33 -6
- data/lib/faker/default/json.rb +61 -5
- data/lib/faker/default/lorem.rb +160 -5
- data/lib/faker/default/lorem_flickr.rb +67 -7
- data/lib/faker/default/lorem_pixel.rb +23 -0
- data/lib/faker/default/markdown.rb +91 -0
- data/lib/faker/default/measurement.rb +93 -2
- data/lib/faker/default/military.rb +26 -0
- data/lib/faker/default/mountain.rb +33 -0
- data/lib/faker/default/name.rb +98 -0
- data/lib/faker/default/nhs.rb +19 -0
- data/lib/faker/default/number.rb +28 -13
- data/lib/faker/default/omniauth.rb +62 -14
- data/lib/faker/default/phone_number.rb +88 -5
- data/lib/faker/default/placeholdit.rb +23 -1
- data/lib/faker/default/relationship.rb +1 -1
- data/lib/faker/default/science.rb +26 -0
- data/lib/faker/default/slack_emoji.rb +81 -0
- data/lib/faker/default/south_africa.rb +90 -0
- data/lib/faker/default/space.rb +1 -1
- data/lib/faker/default/string.rb +20 -3
- data/lib/faker/default/stripe.rb +64 -3
- data/lib/faker/default/tea.rb +41 -0
- data/lib/faker/default/twitter.rb +35 -0
- data/lib/faker/default/types.rb +84 -3
- data/lib/faker/default/university.rb +45 -0
- data/lib/faker/default/vehicle.rb +184 -4
- data/lib/faker/default/verb.rb +45 -0
- data/lib/faker/default/world_cup.rb +4 -4
- data/lib/faker/fantasy/tolkien.rb +67 -0
- data/lib/faker/games/clash_of_clans.rb +48 -0
- data/lib/faker/games/control.rb +113 -0
- data/lib/faker/games/dnd.rb +136 -0
- data/lib/faker/games/elder_scrolls.rb +26 -0
- data/lib/faker/games/heroes.rb +13 -0
- data/lib/faker/games/heroes_of_the_storm.rb +16 -5
- data/lib/faker/games/minecraft.rb +113 -0
- data/lib/faker/games/street_fighter.rb +61 -0
- data/lib/faker/games/super_mario.rb +48 -0
- data/lib/faker/games/touhou.rb +75 -0
- data/lib/faker/games/warhammer_fantasy.rb +74 -0
- data/lib/faker/games/witcher.rb +39 -0
- data/lib/faker/games/world_of_warcraft.rb +26 -1
- data/lib/faker/japanese_media/conan.rb +48 -0
- data/lib/faker/japanese_media/doraemon.rb +48 -0
- data/lib/faker/japanese_media/dragon_ball.rb +26 -0
- data/lib/faker/japanese_media/naruto.rb +61 -0
- data/lib/faker/japanese_media/studio_ghibli.rb +48 -0
- data/lib/faker/movies/departed.rb +49 -0
- data/lib/faker/movies/hobbit.rb +4 -4
- data/lib/faker/movies/how_to_train_your_dragon.rb +48 -0
- data/lib/faker/movies/lord_of_the_rings.rb +3 -3
- data/lib/faker/movies/movie.rb +13 -0
- data/lib/faker/movies/room.rb +63 -0
- data/lib/faker/movies/star_wars.rb +74 -2
- data/lib/faker/music/hiphop.rb +48 -0
- data/lib/faker/music/music.rb +12 -0
- data/lib/faker/music/opera.rb +237 -1
- data/lib/faker/music/pearl_jam.rb +50 -0
- data/lib/faker/music/phish.rb +27 -1
- data/lib/faker/music/prince.rb +64 -0
- data/lib/faker/music/rock_band.rb +12 -0
- data/lib/faker/music/rush.rb +37 -0
- data/lib/faker/music/show.rb +49 -0
- data/lib/faker/quotes/quote.rb +80 -1
- data/lib/faker/quotes/rajnikanth.rb +1 -0
- data/lib/faker/quotes/shakespeare.rb +70 -0
- data/lib/faker/sports/volleyball.rb +74 -0
- data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +13 -0
- data/lib/faker/tv_shows/big_bang_theory.rb +37 -0
- data/lib/faker/tv_shows/buffy.rb +17 -4
- data/lib/faker/tv_shows/dr_who.rb +1 -1
- data/lib/faker/tv_shows/final_space.rb +51 -0
- data/lib/faker/tv_shows/futurama.rb +65 -0
- data/lib/faker/tv_shows/simpsons.rb +14 -0
- data/lib/faker/tv_shows/suits.rb +37 -0
- data/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +17 -4
- data/lib/faker/version.rb +1 -1
- data/lib/helpers/base58.rb +1 -1
- data/lib/helpers/char.rb +22 -27
- data/lib/helpers/unique_generator.rb +0 -2
- data/lib/locales/de-AT.yml +4 -2
- data/lib/locales/de-CH.yml +1696 -1
- data/lib/locales/de.yml +4 -2
- data/lib/locales/en-AU.yml +50 -10
- data/lib/locales/en-CA.yml +2 -0
- data/lib/locales/en-GB.yml +1 -1
- data/lib/locales/en-IND.yml +2 -1
- data/lib/locales/en-MS.yml +2 -1
- data/lib/locales/en-NEP.yml +4 -1
- data/lib/locales/en-NZ.yml +3 -1
- data/lib/locales/en-PAK.yml +2 -1
- data/lib/locales/en-SG.yml +2 -1
- data/lib/locales/en-US.yml +37 -11
- data/lib/locales/en-au-ocker.yml +2 -1
- data/lib/locales/en.yml +0 -3
- data/lib/locales/en/address.yml +2 -0
- data/lib/locales/en/adjective.yml +179 -0
- data/lib/locales/en/animal.yml +1 -1
- data/lib/locales/en/aqua_teen_hunger_force.yml +33 -1
- data/lib/locales/en/bank.yml +1 -1
- data/lib/locales/en/barcode.yml +24 -0
- data/lib/locales/en/big_bang_theory.yml +38 -0
- data/lib/locales/en/bird.yml +1281 -0
- data/lib/locales/en/blood.yml +13 -0
- data/lib/locales/en/book.yml +487 -3
- data/lib/locales/en/buffy.yml +1 -1
- data/lib/locales/en/camera.yml +611 -0
- data/lib/locales/en/clash_of_clan.yml +101 -0
- data/lib/locales/en/company.yml +2 -2
- data/lib/locales/en/computer.yml +36 -0
- data/lib/locales/en/conan.yml +171 -0
- data/lib/locales/en/control.yml +247 -0
- data/lib/locales/en/demographic.yml +218 -5
- data/lib/locales/en/departed.yml +50 -0
- data/lib/locales/en/device.yml +112 -4
- data/lib/locales/en/dnd.yml +451 -0
- data/lib/locales/en/doraemon.yml +286 -0
- data/lib/locales/en/dota.yml +531 -63
- data/lib/locales/en/dragon_ball.yml +243 -1
- data/lib/locales/en/driving_license.yml +181 -0
- data/lib/locales/en/drone.yml +95 -0
- data/lib/locales/en/dune.yml +270 -131
- data/lib/locales/en/educator.yml +6 -0
- data/lib/locales/en/elder_scrolls.yml +583 -9
- data/lib/locales/en/fallout.yml +311 -133
- data/lib/locales/en/final_space.yml +37 -0
- data/lib/locales/en/finance.yml +53 -0
- data/lib/locales/en/football.yml +3 -3
- data/lib/locales/en/fresh_prince_of_bel_air.yml +1 -1
- data/lib/locales/en/futurama.yml +344 -0
- data/lib/locales/en/half_life.yml +84 -3
- data/lib/locales/en/heroes.yml +408 -3
- data/lib/locales/en/heroes_of_the_storm.yml +131 -4
- data/lib/locales/en/house.yml +1 -1
- data/lib/locales/en/how_to_train_your_dragon.yml +174 -0
- data/lib/locales/en/jack_handey.yml +54 -0
- data/lib/locales/en/league_of_legends.yml +285 -6
- data/lib/locales/en/lebowski.yml +1 -1
- data/lib/locales/en/lovecraft.yml +76 -6
- data/lib/locales/en/military.yml +179 -5
- data/lib/locales/en/minecraft.yml +663 -0
- data/lib/locales/en/mountain.yml +158 -0
- data/lib/locales/en/movie.yml +192 -1
- data/lib/locales/en/music.yml +461 -29
- data/lib/locales/en/myst.yml +87 -31
- data/lib/locales/en/name.yml +5 -4
- data/lib/locales/en/naruto.yml +231 -0
- data/lib/locales/en/one_piece.yml +2 -2
- data/lib/locales/en/opera.yml +168 -0
- data/lib/locales/en/overwatch.yml +2650 -2622
- data/lib/locales/en/pearl_jam.yml +213 -0
- data/lib/locales/en/phish.yml +392 -1
- data/lib/locales/en/pokemon.yml +417 -4
- data/lib/locales/en/prince.yml +227 -0
- data/lib/locales/en/quote.yml +692 -163
- data/lib/locales/en/rock_band.yml +1 -0
- data/lib/locales/en/room.yml +68 -0
- data/lib/locales/en/rush.yml +32 -0
- data/lib/locales/en/science.yml +355 -3
- data/lib/locales/en/shakespeare.yml +21 -24
- data/lib/locales/en/show.yml +597 -0
- data/lib/locales/en/simpsons.yml +668 -0
- data/lib/locales/en/source.yml +30 -0
- data/lib/locales/en/space.yml +1 -1
- data/lib/locales/en/star_trek.yml +1 -1
- data/lib/locales/en/star_wars.yml +568 -220
- data/lib/locales/en/street_fighter.yml +1524 -0
- data/lib/locales/en/studio_ghibli.yml +107 -0
- data/lib/locales/en/suits.yml +45 -0
- data/lib/locales/en/super_mario.yml +58 -0
- data/lib/locales/en/super_smash_bros.yml +18 -4
- data/lib/locales/en/tea.yml +172 -0
- data/lib/locales/en/tolkien.yml +2453 -0
- data/lib/locales/en/touhou.yml +839 -0
- data/lib/locales/en/volleyball.yml +501 -0
- data/lib/locales/en/warhammer_fantasy.yml +582 -0
- data/lib/locales/en/witcher.yml +426 -7
- data/lib/locales/en/world_of_warcraft.yml +122 -4
- data/lib/locales/en/zelda.yml +962 -4
- data/lib/locales/es-AR.yml +4603 -0
- data/lib/locales/es.yml +56 -0
- data/lib/locales/fi-FI.yml +1 -1
- data/lib/locales/fr-CA.yml +21 -5
- data/lib/locales/fr-CH.yml +2 -2
- data/lib/locales/fr.yml +1 -113
- data/lib/locales/fr/address.yml +21 -0
- data/lib/locales/fr/book.yml +7 -0
- data/lib/locales/fr/color.yml +4 -0
- data/lib/locales/fr/company.yml +17 -0
- data/lib/locales/fr/compass.yml +23 -0
- data/lib/locales/fr/demographic.yml +4 -0
- data/lib/locales/fr/gender.yml +6 -0
- data/lib/locales/fr/internet.yml +5 -0
- data/lib/locales/fr/lorem.yml +5 -0
- data/lib/locales/fr/measurement.yml +7 -0
- data/lib/locales/fr/name.yml +21 -0
- data/lib/locales/fr/phone_number.yml +7 -0
- data/lib/locales/fr/pokemon.yml +9 -0
- data/lib/locales/id.yml +3 -1
- data/lib/locales/it.yml +2 -1
- data/lib/locales/ja/README.md +13 -0
- data/lib/locales/ja/address.yml +17 -0
- data/lib/locales/ja/ancient.yml +4 -0
- data/lib/locales/ja/bank.yml +4 -0
- data/lib/locales/ja/book.yml +7 -0
- data/lib/locales/ja/coffee.yml +4 -0
- data/lib/locales/ja/color.yml +4 -0
- data/lib/locales/ja/commerce.yml +11 -0
- data/lib/locales/ja/company.yml +8 -0
- data/lib/locales/ja/creature.yml +9 -0
- data/lib/locales/ja/food.yml +4 -0
- data/lib/locales/ja/games.yml +18 -0
- data/lib/locales/ja/gender.yml +4 -0
- data/lib/locales/ja/lorem.yml +9 -0
- data/lib/locales/ja/name.yml +13 -0
- data/lib/locales/ja/phone_number.yml +7 -0
- data/lib/locales/ja/restaurant.yml +11 -0
- data/lib/locales/ja/space.yml +5 -0
- data/lib/locales/ja/subscription.yml +8 -0
- data/lib/locales/ja/university.yml +9 -0
- data/lib/locales/ko.yml +94 -2
- data/lib/locales/nb-NO.yml +4 -2
- data/lib/locales/pt-BR.yml +3 -1
- data/lib/locales/pt.yml +3 -1
- data/lib/locales/ru.yml +42 -1
- data/lib/locales/sk.yml +4 -2
- data/lib/locales/uk.yml +2 -0
- metadata +133 -24
- data/lib/locales/en/hobbit.yml +0 -19
- data/lib/locales/en/lord_of_the_rings.yml +0 -6
- data/lib/locales/ja.yml +0 -101
data/History.md
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
## v1.6.0 (2015-11-23)
|
34
34
|
* Lots of bug fixes -- most notably, a fix for email addresses and domains in non-en locales
|
35
35
|
* Updated locales: de, en-AU, en-NZ, en-SG, en-US, en-au-ocker, en, es, fr, he, it, ja, nb-NO, pl, pt-BR, sk, and zh-CN
|
36
|
-
* Updated classes: Address, Avatar, Book, Code, Commerce, Company, Hipster, IDNumber, Internet, Number, Placeholdit, Shakespeare, and Time
|
36
|
+
* Updated classes: Address, Avatar, Book, Code, Commerce, Company, Hipster, IDNumber, Internet, Number, Placeholdit, Shakespeare, and Time
|
37
37
|
|
38
38
|
## v1.5.0 (2015-08-17)
|
39
39
|
* Added logos
|
@@ -83,7 +83,7 @@
|
|
83
83
|
* 1 major change:
|
84
84
|
* Removed deprecated methods from Address: earth_country, us_state, us_state_abbr, uk_postcode, uk_county
|
85
85
|
* Many minor changes (please see github pull requests for credits)
|
86
|
-
* Added many localizations
|
86
|
+
* Added many localizations
|
87
87
|
* Added range and array support for Lorem
|
88
88
|
|
89
89
|
## v1.0.1 (2011-09-27)
|
@@ -117,7 +117,7 @@
|
|
117
117
|
* Added Canadian translation [igbanam]
|
118
118
|
* Added Norwegian translation [kytrinyx]
|
119
119
|
* Lots of translation-related cleanup [kytrinyx]
|
120
|
-
|
120
|
+
|
121
121
|
|
122
122
|
## v0.9.5 (2011-01-27)
|
123
123
|
* 1 minor bug fix:
|
@@ -159,7 +159,7 @@
|
|
159
159
|
* 3 major enhancements:
|
160
160
|
* Added Lorem to generate fake Latin
|
161
161
|
* Added secondary_address to Address, and made inclusion of
|
162
|
-
secondary address in street_address optional (false by
|
162
|
+
secondary address in street_address optional (false by
|
163
163
|
default).
|
164
164
|
* Added UK address methods [Caius Durling]
|
165
165
|
|
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
|
2
1
|
![logotype a happy-07](https://user-images.githubusercontent.com/36028424/40263395-4318481e-5b44-11e8-92e5-3dcc1ce169b3.png)
|
3
2
|
|
4
3
|
# Faker
|
5
|
-
[![
|
4
|
+
[![Tests](https://github.com/faker-ruby/faker/workflows/Tests/badge.svg)](https://github.com/faker-ruby/faker/actions?query=workflow%3ATests)
|
6
5
|
[![Gem Version](https://badge.fury.io/rb/faker.svg)](https://badge.fury.io/rb/faker)
|
7
6
|
[![Inline docs](https://inch-ci.org/github/faker-ruby/faker.svg?branch=master)](https://inch-ci.org/github/faker-ruby/faker)
|
8
7
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/test_coverage)](https://codeclimate.com/github/stympy/faker/test_coverage)
|
@@ -28,6 +27,7 @@ development.
|
|
28
27
|
- [Default](#default)
|
29
28
|
- [Blockchain](#blockchain)
|
30
29
|
- [Books](#books)
|
30
|
+
- [Fantasy](#fantasy)
|
31
31
|
- [Creature](#creature)
|
32
32
|
- [Games](#games)
|
33
33
|
- [Japanese Media](#japanese-media)
|
@@ -95,7 +95,7 @@ manually set values).
|
|
95
95
|
# Faker::<generator>.unique.exclude(method, arguments, list)
|
96
96
|
|
97
97
|
# Add 'azerty' and 'wxcvbn' to the string generator with 6 char length
|
98
|
-
Faker::Lorem.unique.exclude :string, [6], %w[azerty wxcvbn]
|
98
|
+
Faker::Lorem.unique.exclude :string, [number: 6], %w[azerty wxcvbn]
|
99
99
|
```
|
100
100
|
|
101
101
|
### Deterministic Random
|
@@ -130,7 +130,9 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
130
130
|
- [Faker::Artist](doc/default/artist.md)
|
131
131
|
- [Faker::Avatar](doc/default/avatar.md)
|
132
132
|
- [Faker::Bank](doc/default/bank.md)
|
133
|
+
- [Faker::Barcode](doc/default/barcode.md)
|
133
134
|
- [Faker::Beer](doc/default/beer.md)
|
135
|
+
- [Faker::Blood](doc/default/blood.md)
|
134
136
|
- [Faker::Boolean](doc/default/boolean.md)
|
135
137
|
- [Faker::BossaNova](doc/default/bossa_nova.md)
|
136
138
|
- [Faker::Business](doc/default/business.md)
|
@@ -144,6 +146,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
144
146
|
- [Faker::Commerce](doc/default/commerce.md)
|
145
147
|
- [Faker::Company](doc/default/company.md)
|
146
148
|
- [Faker::Compass](doc/default/compass.md)
|
149
|
+
- [Faker::Computer](doc/default/computer.md)
|
147
150
|
- [Faker::Construction](doc/default/construction.md)
|
148
151
|
- [Faker::Cosmere](doc/default/cosmere.md)
|
149
152
|
- [Faker::Crypto](doc/default/crypto.md)
|
@@ -155,6 +158,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
155
158
|
- [Faker::Dessert](doc/default/dessert.md)
|
156
159
|
- [Faker::Device](doc/default/device.md)
|
157
160
|
- [Faker::DrivingLicence](doc/default/driving_licence.md)
|
161
|
+
- [Faker::Drone](doc/drone/drone.md)
|
158
162
|
- [Faker::Educator](doc/default/educator.md)
|
159
163
|
- [Faker::ElectricalComponents](doc/default/electrical_components.md)
|
160
164
|
- [Faker::Esport](doc/default/esport.md)
|
@@ -182,6 +186,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
182
186
|
- [Faker::Marketing](doc/default/marketing.md)
|
183
187
|
- [Faker::Measurement](doc/default/measurement.md)
|
184
188
|
- [Faker::Military](doc/default/military.md)
|
189
|
+
- [Faker::Mountain](doc/default/mountain.md)
|
185
190
|
- [Faker::Name](doc/default/name.md)
|
186
191
|
- [Faker::Nation](doc/default/nation.md)
|
187
192
|
- [Faker::NatoPhoneticAlphabet](doc/default/nato_phonetic_alphabet.md)
|
@@ -202,6 +207,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
202
207
|
- [Faker::Stripe](doc/default/stripe.md)
|
203
208
|
- [Faker::Subscription](doc/default/subscription.md)
|
204
209
|
- [Faker::Superhero](doc/default/superhero.md)
|
210
|
+
- [Faker::Tea](doc/default/tea.md)
|
205
211
|
- [Faker::Team](doc/default/team.md)
|
206
212
|
- [Faker::Time](doc/default/time.md)
|
207
213
|
- [Faker::Twitter](doc/default/twitter.md)
|
@@ -223,14 +229,20 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
223
229
|
- [Faker::Books::Dune](doc/books/dune.md)
|
224
230
|
- [Faker::Books::Lovecraft](doc/books/lovecraft.md)
|
225
231
|
|
232
|
+
### Fantasy
|
233
|
+
- [Faker::Fantasy::Tolkien](doc/fantasy/tolkien.md)
|
234
|
+
|
226
235
|
### Creature
|
227
236
|
- [Faker::Creature::Animal](doc/creature/animal.md)
|
237
|
+
- [Faker::Creature::Bird](doc/creature/bird.md)
|
228
238
|
- [Faker::Creature::Cat](doc/creature/cat.md)
|
229
239
|
- [Faker::Creature::Dog](doc/creature/dog.md)
|
230
240
|
- [Faker::Creature::Horse](doc/creature/horse.md)
|
231
241
|
|
232
242
|
### Games
|
233
243
|
- [Faker::Game](doc/games/game.md)
|
244
|
+
- [Faker::Games::ClashOfClans](doc/games/clash_of_clans.md)
|
245
|
+
- [Faker::Games::DnD](doc/games/dnd.md)
|
234
246
|
- [Faker::Games::Dota](doc/games/dota.md)
|
235
247
|
- [Faker::Games::ElderScrolls](doc/games/elder_scrolls.md)
|
236
248
|
- [Faker::Games::Fallout](doc/games/fallout.md)
|
@@ -238,11 +250,16 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
238
250
|
- [Faker::Games::Heroes](doc/games/heroes.md)
|
239
251
|
- [Faker::Games::HeroesOfTheStorm](doc/games/heroes_of_the_storm.md)
|
240
252
|
- [Faker::Games::LeagueOfLegends](doc/games/league_of_legends.md)
|
253
|
+
- [Faker::Games::Minecraft](doc/games/minecraft.md)
|
241
254
|
- [Faker::Games::Myst](doc/games/myst.md)
|
242
255
|
- [Faker::Games::Overwatch](doc/games/overwatch.md)
|
243
256
|
- [Faker::Games::Pokemon](doc/games/pokemon.md)
|
244
257
|
- [Faker::Games::SonicTheHedgehog](doc/games/sonic_the_hedgehog.md)
|
258
|
+
- [Faker::Games::StreetFighter](doc/games/street_fighter.md)
|
259
|
+
- [Faker::Games::SuperMario](doc/games/super_mario.md)
|
245
260
|
- [Faker::Games::SuperSmashBros](doc/games/super_smash_bros.md)
|
261
|
+
- [Faker::Games::Touhou](doc/games/touhou.md)
|
262
|
+
- [Faker::Games::WarhammerFantasy](doc/games/warhammer_fantasy.md)
|
246
263
|
- [Faker::Games::Witcher](doc/games/witcher.md)
|
247
264
|
- [Faker::Games::WorldOfWarcraft](doc/games/world_of_warcraft.md)
|
248
265
|
- [Faker::Games::Zelda](doc/games/zelda.md)
|
@@ -250,15 +267,21 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
250
267
|
### Japanese Media
|
251
268
|
- [Faker::JapaneseMedia::DragonBall](doc/japanese_media/dragon_ball.md)
|
252
269
|
- [Faker::JapaneseMedia::OnePiece](doc/japanese_media/one_piece.md)
|
270
|
+
- [Faker::JapaneseMedia::StudioGhibli](doc/japanese_media/studio_ghibli.md)
|
253
271
|
- [Faker::JapaneseMedia::SwordArtOnline](doc/japanese_media/sword_art_online.md)
|
272
|
+
- [Faker::JapaneseMedia::Naruto](doc/japanese_media/naruto.md)
|
273
|
+
- [Faker::JapaneseMedia::Doraemon](doc/japanese_media/doraemon.md)
|
274
|
+
- [Faker::JapaneseMedia::Conan](doc/japanese_media/conan.md)
|
254
275
|
|
255
276
|
### Movies
|
256
277
|
- [Faker::Movie](doc/movies/movie.md)
|
257
278
|
- [Faker::Movies::BackToTheFuture](doc/movies/back_to_the_future.md)
|
279
|
+
- [Faker::Movies::Departed](doc/movies/departed.md)
|
258
280
|
- [Faker::Movies::Ghostbusters](doc/movies/ghostbusters.md)
|
259
281
|
- [Faker::Movies::HarryPotter](doc/movies/harry_potter.md)
|
260
282
|
- [Faker::Movies::HitchhikersGuideToTheGalaxy](doc/movies/hitchhikers_guide_to_the_galaxy.md)
|
261
283
|
- [Faker::Movies::Hobbit](doc/movies/hobbit.md)
|
284
|
+
- [Faker::Movies::HowToTrainYourDragon](doc/movies/how_to_train_your_dragon.md)
|
262
285
|
- [Faker::Movies::Lebowski](doc/movies/lebowski.md)
|
263
286
|
- [Faker::Movies::LordOfTheRings](doc/movies/lord_of_the_rings.md)
|
264
287
|
- [Faker::Movies::PrincessBride](doc/movies/princess_bride.md)
|
@@ -268,9 +291,13 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
268
291
|
### Music
|
269
292
|
- [Faker::Music](doc/music/music.md)
|
270
293
|
- [Faker::Music::GratefulDead](doc/music/grateful_dead.md)
|
294
|
+
- [Faker::Music::Hiphop](doc/music/hiphop.md)
|
271
295
|
- [Faker::Music::Opera](doc/music/opera.md)
|
296
|
+
- [Faker::Music::PearlJam](doc/music/pearl_jam.md)
|
272
297
|
- [Faker::Music::Phish](doc/music/phish.md)
|
298
|
+
- [Faker::Music::Prince](doc/music/prince.md)
|
273
299
|
- [Faker::Music::RockBand](doc/music/rock_band.md)
|
300
|
+
- [Faker::Music::Rush](doc/music/rush.md)
|
274
301
|
- [Faker::Music::UmphreysMcgee](doc/music/umphreys_mcgee.md)
|
275
302
|
|
276
303
|
### Quotes
|
@@ -286,6 +313,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
286
313
|
|
287
314
|
### Tv Shows
|
288
315
|
- [Faker::TvShows::AquaTeenHungerForce](doc/tv_shows/aqua_teen_hunger_force.md)
|
316
|
+
- [Faker::TvShows::BigBangTheory](doc/tv_shows/big_bang_theory.md)
|
289
317
|
- [Faker::TvShows::BojackHorseman](doc/tv_shows/bojack_horseman.md)
|
290
318
|
- [Faker::TvShows::BreakingBad](doc/tv_shows/breaking_bad.md)
|
291
319
|
- [Faker::TvShows::Buffy](doc/tv_shows/buffy.md)
|
@@ -293,6 +321,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
293
321
|
- [Faker::TvShows::DrWho](doc/tv_shows/dr_who.md)
|
294
322
|
- [Faker::TvShows::DumbAndDumber](doc/tv_shows/dumb_and_dumber.md)
|
295
323
|
- [Faker::TvShows::FamilyGuy](doc/tv_shows/family_guy.md)
|
324
|
+
- [Faker::TvShows::FinalSpace](doc/tv_shows/final_space.md)
|
296
325
|
- [Faker::TvShows::Friends](doc/tv_shows/friends.md)
|
297
326
|
- [Faker::TvShows::GameOfThrones](doc/tv_shows/game_of_thrones.md)
|
298
327
|
- [Faker::TvShows::HeyArnold](doc/tv_shows/hey_arnold.md)
|
@@ -309,6 +338,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
309
338
|
- [Faker::TvShows::StarTrek](doc/tv_shows/star_trek.md)
|
310
339
|
- [Faker::TvShows::Stargate](doc/tv_shows/stargate.md)
|
311
340
|
- [Faker::TvShows::StrangerThings](doc/tv_shows/stranger_things.md)
|
341
|
+
- [Faker::TvShows::Suits](doc/tv_shows/suits.md)
|
312
342
|
- [Faker::TvShows::TheExpanse](doc/tv_shows/the_expanse.md)
|
313
343
|
- [Faker::TvShows::TheFreshPrinceOfBelAir](doc/tv_shows/the_fresh_prince_of_bel_air.md)
|
314
344
|
- [Faker::TvShows::TheITCrowd](doc/tv_shows/the_it_crowd.md)
|
data/lib/faker.rb
CHANGED
@@ -2,29 +2,26 @@
|
|
2
2
|
|
3
3
|
mydir = __dir__
|
4
4
|
|
5
|
-
|
6
|
-
require 'psych'
|
7
|
-
end
|
8
|
-
|
5
|
+
require 'psych'
|
9
6
|
require 'i18n'
|
10
7
|
require 'set' # Fixes a bug in i18n 0.6.11
|
11
8
|
|
12
|
-
Dir.glob(File.join(
|
9
|
+
Dir.glob(File.join(mydir, 'helpers', '*.rb')).sort.each { |file| require file }
|
13
10
|
|
14
11
|
I18n.load_path += Dir[File.join(mydir, 'locales', '**/*.yml')]
|
15
12
|
I18n.reload! if I18n.backend.initialized?
|
16
13
|
|
17
14
|
module Faker
|
18
|
-
|
15
|
+
module Config
|
19
16
|
@locale = nil
|
20
17
|
@random = nil
|
21
18
|
|
22
19
|
class << self
|
23
|
-
attr_writer :locale
|
24
|
-
attr_writer :random
|
20
|
+
attr_writer :locale, :random
|
25
21
|
|
26
22
|
def locale
|
27
|
-
|
23
|
+
# Because I18n.locale defaults to :en, if we don't have :en in our available_locales, errors will happen
|
24
|
+
@locale || (I18n.available_locales.include?(I18n.locale) ? I18n.locale : I18n.available_locales.first)
|
28
25
|
end
|
29
26
|
|
30
27
|
def own_locale
|
@@ -32,7 +29,7 @@ module Faker
|
|
32
29
|
end
|
33
30
|
|
34
31
|
def random
|
35
|
-
@random || Random
|
32
|
+
@random || Random.new
|
36
33
|
end
|
37
34
|
end
|
38
35
|
end
|
@@ -83,13 +80,13 @@ module Faker
|
|
83
80
|
def regexify(reg)
|
84
81
|
reg = reg.source if reg.respond_to?(:source) # Handle either a Regexp or a String that looks like a Regexp
|
85
82
|
reg
|
86
|
-
.gsub(%r{
|
83
|
+
.gsub(%r{^/?\^?}, '').gsub(%r{\$?/?$}, '') # Ditch the anchors
|
87
84
|
.gsub(/\{(\d+)\}/, '{\1,\1}').gsub(/\?/, '{0,1}') # All {2} become {2,2} and ? become {0,1}
|
88
85
|
.gsub(/(\[[^\]]+\])\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # [12]{1,2} becomes [12] or [12][12]
|
89
|
-
.gsub(/(\([
|
86
|
+
.gsub(/(\([^)]+\))\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # (12|34){1,2} becomes (12|34) or (12|34)(12|34)
|
90
87
|
.gsub(/(\\?.)\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # A{1,2} becomes A or AA or \d{3} becomes \d\d\d
|
91
|
-
.gsub(/\((.*?)\)/) { |match| sample(match.gsub(/[
|
92
|
-
.gsub(/\[([^\]]+)\]/) { |match| match.gsub(/(\w
|
88
|
+
.gsub(/\((.*?)\)/) { |match| sample(match.gsub(/[()]/, '').split('|')) } # (this|that) becomes 'this' or 'that'
|
89
|
+
.gsub(/\[([^\]]+)\]/) { |match| match.gsub(/(\w-\w)/) { |range| sample(Array(Range.new(*range.split('-')))) } } # All A-Z inside of [] become C (or X, or whatever)
|
93
90
|
.gsub(/\[([^\]]+)\]/) { |_match| sample(Regexp.last_match(1).split('')) } # All [ABC] become B (or A or C)
|
94
91
|
.gsub('\d') { |_match| sample(Numbers) }
|
95
92
|
.gsub('\w') { |_match| sample(Letters) }
|
@@ -99,7 +96,7 @@ module Faker
|
|
99
96
|
# with an array of values and selecting one of them.
|
100
97
|
def fetch(key)
|
101
98
|
fetched = sample(translate("faker.#{key}"))
|
102
|
-
if fetched&.match(%r{
|
99
|
+
if fetched&.match(%r{^/}) && fetched&.match(%r{/$}) # A regex
|
103
100
|
regexify(fetched)
|
104
101
|
else
|
105
102
|
fetched
|
@@ -111,7 +108,7 @@ module Faker
|
|
111
108
|
def fetch_all(key)
|
112
109
|
fetched = translate("faker.#{key}")
|
113
110
|
fetched = fetched.last if fetched.size <= 1
|
114
|
-
if !fetched.respond_to?(:sample) && fetched.match(%r{
|
111
|
+
if !fetched.respond_to?(:sample) && fetched.match(%r{^/}) && fetched.match(%r{/$}) # A regex
|
115
112
|
regexify(fetched)
|
116
113
|
else
|
117
114
|
fetched
|
@@ -123,7 +120,7 @@ module Faker
|
|
123
120
|
# formatted translation: e.g., "#{first_name} #{last_name}".
|
124
121
|
def parse(key)
|
125
122
|
fetched = fetch(key)
|
126
|
-
parts = fetched.scan(/(\(?)#\{([A-Za-z]+\.)?([
|
123
|
+
parts = fetched.scan(/(\(?)#\{([A-Za-z]+\.)?([^}]+)\}([^#]+)?/).map do |prefix, kls, meth, etc|
|
127
124
|
# If the token had a class Prefix (e.g., Name.first_name)
|
128
125
|
# grab the constant, otherwise use self
|
129
126
|
cls = kls ? Faker.const_get(kls.chop) : self
|
@@ -132,7 +129,7 @@ module Faker
|
|
132
129
|
# In either case the information will be retained for reconstruction of the string.
|
133
130
|
text = prefix
|
134
131
|
|
135
|
-
# If the class has the method, call it, otherwise fetch the
|
132
|
+
# If the class has the method, call it, otherwise fetch the translation
|
136
133
|
# (e.g., faker.phone_number.area_code)
|
137
134
|
text += if cls.respond_to?(meth)
|
138
135
|
cls.send(meth)
|
@@ -167,12 +164,12 @@ module Faker
|
|
167
164
|
end
|
168
165
|
|
169
166
|
# Executes block with given locale set.
|
170
|
-
def with_locale(tmp_locale = nil)
|
167
|
+
def with_locale(tmp_locale = nil, &block)
|
171
168
|
current_locale = Faker::Config.own_locale
|
172
169
|
Faker::Config.locale = tmp_locale
|
173
170
|
|
174
171
|
disable_enforce_available_locales do
|
175
|
-
I18n.with_locale(tmp_locale)
|
172
|
+
I18n.with_locale(tmp_locale, &block)
|
176
173
|
end
|
177
174
|
ensure
|
178
175
|
Faker::Config.locale = current_locale
|
@@ -225,8 +222,16 @@ module Faker
|
|
225
222
|
@unique ||= UniqueGenerator.new(self, max_retries)
|
226
223
|
end
|
227
224
|
|
228
|
-
def sample(list)
|
229
|
-
list.respond_to?(:sample)
|
225
|
+
def sample(list, num = nil)
|
226
|
+
if list.respond_to?(:sample)
|
227
|
+
if num
|
228
|
+
list.sample(num, random: Faker::Config.random)
|
229
|
+
else
|
230
|
+
list.sample(random: Faker::Config.random)
|
231
|
+
end
|
232
|
+
else
|
233
|
+
list
|
234
|
+
end
|
230
235
|
end
|
231
236
|
|
232
237
|
def shuffle(list)
|
@@ -307,4 +312,4 @@ module Faker
|
|
307
312
|
end
|
308
313
|
|
309
314
|
# require faker objects
|
310
|
-
Dir.glob(File.join(
|
315
|
+
Dir.glob(File.join(mydir, 'faker', '/**/*.rb')).sort.each { |file| require file }
|
@@ -14,7 +14,7 @@ module Faker
|
|
14
14
|
# #=> "ak_zvU8YQLagjcfng7Tg8yCdiZ1rpiWNp1PBn3vtUs44utSvbJVR"
|
15
15
|
#
|
16
16
|
def address
|
17
|
-
|
17
|
+
"ak_#{rand_strings}"
|
18
18
|
end
|
19
19
|
|
20
20
|
##
|
@@ -27,7 +27,7 @@ module Faker
|
|
27
27
|
# #=> "th_147nDP22h3pHrLt2qykTH4txUwQh1ccaXp"
|
28
28
|
#
|
29
29
|
def transaction
|
30
|
-
|
30
|
+
"th_#{rand_strings(51)}"
|
31
31
|
end
|
32
32
|
|
33
33
|
##
|
@@ -40,7 +40,7 @@ module Faker
|
|
40
40
|
# #=> "ct_Hk2JsNeWGEYQEHHQCfcBeGrwbhtYSwFTPdDhW2SvjFYVojyhW"
|
41
41
|
#
|
42
42
|
def contract
|
43
|
-
|
43
|
+
"ct_#{rand_strings}"
|
44
44
|
end
|
45
45
|
|
46
46
|
##
|
@@ -53,7 +53,7 @@ module Faker
|
|
53
53
|
# #=> "ok_28QDg7fkF5qiKueSdUvUBtCYPJdmMEoS73CztzXCRAwMGKHKZh"
|
54
54
|
#
|
55
55
|
def oracle
|
56
|
-
|
56
|
+
"ok_#{rand_strings(51)}"
|
57
57
|
end
|
58
58
|
|
59
59
|
protected
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'openssl'
|
4
4
|
require 'securerandom'
|
5
5
|
|
6
6
|
module Faker
|
@@ -51,7 +51,7 @@ module Faker
|
|
51
51
|
def address_for(network)
|
52
52
|
version = PROTOCOL_VERSIONS.fetch(network)
|
53
53
|
packed = version.chr + Faker::Config.random.bytes(20)
|
54
|
-
checksum = Digest::
|
54
|
+
checksum = OpenSSL::Digest::SHA256.digest(OpenSSL::Digest::SHA256.digest(packed))[0..3]
|
55
55
|
Faker::Base58.encode(packed + checksum)
|
56
56
|
end
|
57
57
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'openssl'
|
4
4
|
require 'securerandom'
|
5
5
|
|
6
6
|
module Faker
|
@@ -88,6 +88,34 @@ module Faker
|
|
88
88
|
encode_tz(:edsig, 64)
|
89
89
|
end
|
90
90
|
|
91
|
+
##
|
92
|
+
# Produces a random Tezos public key
|
93
|
+
#
|
94
|
+
# @return [String]
|
95
|
+
#
|
96
|
+
# @example
|
97
|
+
# Faker::Blockchain::Tezos.public_key
|
98
|
+
# #=> "edpkuib9x8QXRc5nWwHUg7U1dXsVmaUrUNU5sX9pVEEvwbMVdfMCeq"
|
99
|
+
#
|
100
|
+
# @faker.version 2.15.2
|
101
|
+
def public_key
|
102
|
+
encode_tz(:edpk, 32)
|
103
|
+
end
|
104
|
+
|
105
|
+
##
|
106
|
+
# Produces a random Tezos public key
|
107
|
+
#
|
108
|
+
# @return [String]
|
109
|
+
#
|
110
|
+
# @example
|
111
|
+
# Faker::Blockchain::Tezos.secret_key
|
112
|
+
# #=> "edsk3HZCAGEGpzQPnQUwQeFY4ESanFhQCgLpKriQw8GHyhKCrjHawv"
|
113
|
+
#
|
114
|
+
# @faker.version 2.15.2
|
115
|
+
def secret_key
|
116
|
+
encode_tz(:edsk, 32)
|
117
|
+
end
|
118
|
+
|
91
119
|
protected
|
92
120
|
|
93
121
|
##
|
@@ -98,7 +126,7 @@ module Faker
|
|
98
126
|
def encode_tz(prefix, payload_size)
|
99
127
|
prefix = PREFIXES.fetch(prefix)
|
100
128
|
packed = prefix.map(&:chr).join('') + Faker::Config.random.bytes(payload_size)
|
101
|
-
checksum = Digest::
|
129
|
+
checksum = OpenSSL::Digest::SHA256.digest(OpenSSL::Digest::SHA256.digest(packed))[0..3]
|
102
130
|
Faker::Base58.encode(packed + checksum)
|
103
131
|
end
|
104
132
|
end
|
data/lib/faker/books/dune.rb
CHANGED
@@ -30,6 +30,19 @@ module Faker
|
|
30
30
|
fetch('dune.titles')
|
31
31
|
end
|
32
32
|
|
33
|
+
##
|
34
|
+
# Produces the name of a city from Dune
|
35
|
+
#
|
36
|
+
# @return [String]
|
37
|
+
#
|
38
|
+
# @example
|
39
|
+
# Faker::Books::Dune.city #=> "Arrakeen"
|
40
|
+
#
|
41
|
+
# @faker.version next
|
42
|
+
def city
|
43
|
+
fetch('dune.cities')
|
44
|
+
end
|
45
|
+
|
33
46
|
##
|
34
47
|
# Produces the name of a planet from Dune
|
35
48
|
#
|
@@ -76,7 +89,7 @@ module Faker
|
|
76
89
|
end
|
77
90
|
end
|
78
91
|
|
79
|
-
fetch(
|
92
|
+
fetch("dune.quotes.#{character}")
|
80
93
|
end
|
81
94
|
|
82
95
|
##
|
@@ -111,7 +124,7 @@ module Faker
|
|
111
124
|
end
|
112
125
|
end
|
113
126
|
|
114
|
-
fetch(
|
127
|
+
fetch("dune.sayings.#{source}")
|
115
128
|
end
|
116
129
|
end
|
117
130
|
end
|