faker 2.11.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +810 -19
- data/History.md +5 -5
- data/README.md +232 -105
- data/lib/faker/blockchain/aeternity.rb +5 -5
- data/lib/faker/blockchain/bitcoin.rb +2 -2
- data/lib/faker/blockchain/ethereum.rb +1 -1
- data/lib/faker/blockchain/tezos.rb +31 -3
- data/lib/faker/books/dune.rb +17 -12
- data/lib/faker/books/lovecraft.rb +14 -41
- data/lib/faker/books/the_kingkiller_chronicle.rb +61 -0
- data/lib/faker/creature/bird.rb +203 -0
- data/lib/faker/default/address.rb +40 -30
- data/lib/faker/default/adjective.rb +35 -0
- data/lib/faker/default/alphanumeric.rb +2 -8
- data/lib/faker/default/app.rb +1 -10
- data/lib/faker/default/avatar.rb +1 -12
- data/lib/faker/default/bank.rb +104 -19
- 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/boolean.rb +1 -4
- 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 +54 -16
- data/lib/faker/default/chuck_norris.rb +1 -0
- data/lib/faker/default/code.rb +106 -38
- data/lib/faker/default/color.rb +77 -6
- data/lib/faker/default/commerce.rb +105 -28
- data/lib/faker/default/company.rb +116 -28
- 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 +48 -15
- data/lib/faker/default/date.rb +21 -50
- data/lib/faker/default/demographic.rb +1 -5
- data/lib/faker/default/driving_licence.rb +66 -10
- data/lib/faker/default/drone.rb +332 -0
- data/lib/faker/default/educator.rb +13 -0
- data/lib/faker/default/emotion.rb +33 -0
- data/lib/faker/default/file.rb +53 -21
- data/lib/faker/default/finance.rb +75 -7
- data/lib/faker/default/food.rb +28 -2
- data/lib/faker/default/gender.rb +1 -1
- data/lib/faker/default/hipster.rb +106 -48
- data/lib/faker/default/hobby.rb +22 -0
- data/lib/faker/default/id_number.rb +230 -13
- data/lib/faker/default/internet.rb +390 -108
- data/lib/faker/default/internet_http.rb +48 -0
- data/lib/faker/default/invoice.rb +37 -23
- data/lib/faker/default/json.rb +61 -23
- data/lib/faker/default/lorem.rb +171 -72
- data/lib/faker/default/lorem_flickr.rb +69 -37
- data/lib/faker/default/markdown.rb +97 -11
- data/lib/faker/default/marketing.rb +1 -1
- data/lib/faker/default/measurement.rb +101 -42
- data/lib/faker/default/military.rb +26 -0
- data/lib/faker/default/mountain.rb +33 -0
- data/lib/faker/default/name.rb +99 -5
- data/lib/faker/default/nation.rb +0 -3
- data/lib/faker/default/nhs.rb +21 -6
- data/lib/faker/default/number.rb +38 -68
- data/lib/faker/default/omniauth.rb +111 -53
- data/lib/faker/default/phone_number.rb +89 -10
- data/lib/faker/default/placeholdit.rb +23 -12
- data/lib/faker/default/relationship.rb +2 -6
- data/lib/faker/default/religion.rb +6 -0
- data/lib/faker/default/science.rb +108 -0
- data/lib/faker/default/slack_emoji.rb +81 -0
- data/lib/faker/default/source.rb +3 -16
- data/lib/faker/default/south_africa.rb +90 -0
- data/lib/faker/default/space.rb +1 -1
- data/lib/faker/default/string.rb +18 -8
- data/lib/faker/default/stripe.rb +68 -23
- data/lib/faker/default/tea.rb +41 -0
- data/lib/faker/default/time.rb +4 -34
- data/lib/faker/default/twitter.rb +42 -23
- data/lib/faker/default/types.rb +88 -29
- data/lib/faker/default/university.rb +45 -0
- data/lib/faker/default/vehicle.rb +212 -54
- data/lib/faker/default/verb.rb +45 -0
- data/lib/faker/default/vulnerability_identifier.rb +23 -0
- data/lib/faker/default/world_cup.rb +6 -15
- 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 +178 -0
- data/lib/faker/games/dota.rb +14 -5
- 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/myst.rb +1 -1
- data/lib/faker/games/street_fighter.rb +61 -0
- data/lib/faker/games/super_mario.rb +48 -0
- data/lib/faker/games/tarkov.rb +205 -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/cowboy_bebop.rb +61 -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/fullmetal_alchemist_brotherhood.rb +48 -0
- data/lib/faker/japanese_media/kamen_rider.rb +102 -0
- data/lib/faker/japanese_media/naruto.rb +61 -0
- data/lib/faker/japanese_media/one_piece.rb +1 -1
- data/lib/faker/japanese_media/studio_ghibli.rb +48 -0
- data/lib/faker/locations/australia.rb +47 -0
- data/lib/faker/movies/avatar.rb +49 -0
- data/lib/faker/movies/departed.rb +49 -0
- data/lib/faker/movies/hackers.rb +48 -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 +75 -7
- data/lib/faker/movies/tron.rb +161 -0
- 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 +93 -1
- data/lib/faker/quotes/rajnikanth.rb +1 -0
- data/lib/faker/quotes/shakespeare.rb +70 -0
- data/lib/faker/religion/bible.rb +50 -0
- data/lib/faker/sports/chess.rb +90 -0
- data/lib/faker/sports/mountaineering.rb +22 -0
- data/lib/faker/sports/sport.rb +116 -0
- data/lib/faker/sports/volleyball.rb +74 -0
- data/lib/faker/travel/airport.rb +43 -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/brooklyn_nine_nine.rb +38 -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/michael_scott.rb +0 -3
- data/lib/faker/tv_shows/simpsons.rb +14 -0
- data/lib/faker/tv_shows/spongebob.rb +50 -0
- data/lib/faker/tv_shows/suits.rb +37 -0
- data/lib/faker/tv_shows/supernatural.rb +48 -0
- data/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +17 -4
- data/lib/faker/tv_shows/the_office.rb +37 -0
- data/lib/faker/version.rb +2 -2
- data/lib/faker.rb +40 -84
- data/lib/helpers/base58.rb +1 -1
- data/lib/helpers/char.rb +22 -27
- data/lib/helpers/unique_generator.rb +13 -13
- data/lib/locales/ar.yml +6 -1
- data/lib/locales/bg.yml +1 -1
- data/lib/locales/da-DK.yml +1 -1
- data/lib/locales/de-AT.yml +7 -6
- data/lib/locales/de-CH.yml +1697 -2
- data/lib/locales/de.yml +12 -6
- data/lib/locales/en/address.yml +4 -3
- data/lib/locales/en/adjective.yml +179 -0
- data/lib/locales/en/airport.yml +381 -0
- data/lib/locales/en/animal.yml +1 -1
- data/lib/locales/en/aqua_teen_hunger_force.yml +33 -1
- data/lib/locales/en/australia.yml +107 -0
- data/lib/locales/en/avatar.yml +31 -0
- data/lib/locales/en/bank.yml +1 -1
- data/lib/locales/en/barcode.yml +24 -0
- data/lib/locales/en/bible.yml +90 -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/brooklyn_nine_nine.yml +35 -0
- data/lib/locales/en/buffy.yml +1 -1
- data/lib/locales/en/camera.yml +611 -0
- data/lib/locales/en/cat.yml +1 -1
- data/lib/locales/en/chess.yml +103 -0
- data/lib/locales/en/clash_of_clan.yml +101 -0
- data/lib/locales/en/coffee.yml +1 -1
- data/lib/locales/en/commerce.yml +17 -0
- data/lib/locales/en/community.yml +17 -17
- data/lib/locales/en/company.yml +3 -2
- data/lib/locales/en/computer.yml +55 -0
- data/lib/locales/en/conan.yml +171 -0
- data/lib/locales/en/control.yml +247 -0
- data/lib/locales/en/cowboy_bebop.yml +163 -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 +636 -0
- data/lib/locales/en/doraemon.yml +286 -0
- data/lib/locales/en/dota.yml +651 -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/emotion.yml +480 -0
- data/lib/locales/en/fallout.yml +311 -133
- data/lib/locales/en/file.yml +9 -1
- data/lib/locales/en/final_space.yml +37 -0
- data/lib/locales/en/finance.yml +77 -1
- data/lib/locales/en/fma_brotherhood.yml +78 -0
- data/lib/locales/en/food.yml +1066 -10
- 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/game.yml +11 -0
- data/lib/locales/en/hackers.yml +53 -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/hobby.yml +171 -0
- data/lib/locales/en/horse.yml +2 -2
- data/lib/locales/en/house.yml +1 -1
- data/lib/locales/en/how_to_train_your_dragon.yml +174 -0
- data/lib/locales/en/internet.yml +140 -3
- data/lib/locales/en/jack_handey.yml +54 -0
- data/lib/locales/en/kamen_rider.yml +452 -0
- data/lib/locales/en/kpop.yml +7 -7
- 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/mitch_hedberg.yml +46 -0
- data/lib/locales/en/mountain.yml +171 -0
- data/lib/locales/en/mountaineering.yml +14 -0
- data/lib/locales/en/movie.yml +194 -2
- 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 +230 -0
- data/lib/locales/en/one_piece.yml +2 -2
- data/lib/locales/en/opera.yml +169 -1
- data/lib/locales/en/overwatch.yml +2648 -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 +481 -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 +35 -0
- data/lib/locales/en/space.yml +1 -1
- data/lib/locales/en/spongebob.yml +489 -0
- data/lib/locales/en/sport.yml +130 -0
- data/lib/locales/en/star_trek.yml +1 -1
- data/lib/locales/en/star_wars.yml +568 -220
- data/lib/locales/en/stranger_thing.yml +1 -1
- 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 +23 -6
- data/lib/locales/en/supernatural.yml +141 -0
- data/lib/locales/en/tarkov.yml +593 -0
- data/lib/locales/en/tea.yml +172 -0
- data/lib/locales/en/the_kingkiller_chronicle.yml +56 -0
- data/lib/locales/en/the_office.yml +86 -0
- data/lib/locales/en/tolkien.yml +2453 -0
- data/lib/locales/en/touhou.yml +839 -0
- data/lib/locales/en/tron.yml +227 -0
- data/lib/locales/en/vehicle.yml +2809 -75
- 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/en-AU.yml +50 -10
- data/lib/locales/en-CA.yml +4 -1
- data/lib/locales/en-GB.yml +3 -2
- data/lib/locales/en-IND.yml +2 -1
- data/lib/locales/en-MS.yml +3 -1
- data/lib/locales/en-NEP.yml +4 -1
- data/lib/locales/en-NG.yml +1 -0
- data/lib/locales/en-NZ.yml +4 -1
- data/lib/locales/en-PAK.yml +3 -1
- data/lib/locales/en-SG.yml +3 -1
- data/lib/locales/en-UG.yml +1 -0
- data/lib/locales/en-US.yml +38 -12
- data/lib/locales/en-ZA.yml +1 -1
- data/lib/locales/en-au-ocker.yml +4 -1
- data/lib/locales/en.yml +0 -3
- data/lib/locales/es-AR.yml +4601 -0
- data/lib/locales/es-MX.yml +1 -1
- data/lib/locales/es.yml +58 -2
- data/lib/locales/fi-FI.yml +4 -2
- data/lib/locales/fr/address.yml +20 -0
- data/lib/locales/fr/adjective.yml +266 -0
- data/lib/locales/fr/ancient.yml +141 -0
- data/lib/locales/fr/animal.yml +5 -0
- data/lib/locales/fr/appliance.yml +4 -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 +7 -0
- data/lib/locales/fr-CA.yml +22 -6
- data/lib/locales/fr-CH.yml +3 -3
- data/lib/locales/fr.yml +1 -113
- data/lib/locales/hy.yml +2 -1
- data/lib/locales/id.yml +3 -1
- data/lib/locales/it.yml +3 -1
- data/lib/locales/ja/README.md +13 -0
- data/lib/locales/ja/address.yml +120539 -0
- data/lib/locales/ja/adjective.yml +148 -0
- data/lib/locales/ja/ancient.yml +4 -0
- data/lib/locales/ja/animal.yml +5 -0
- data/lib/locales/ja/bank.yml +4 -0
- data/lib/locales/ja/book.yml +7 -0
- data/lib/locales/ja/cat.yml +5 -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/dog.yml +6 -0
- data/lib/locales/ja/emotion.yml +51 -0
- data/lib/locales/ja/food.yml +4 -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/naruto.yml +230 -0
- data/lib/locales/ja/overwatch.yml +5 -0
- data/lib/locales/ja/phone_number.yml +7 -0
- data/lib/locales/ja/pokemon.yml +7 -0
- data/lib/locales/ja/relationship.yml +10 -0
- data/lib/locales/ja/restaurant.yml +11 -0
- data/lib/locales/ja/space.yml +5 -0
- data/lib/locales/ja/studio_ghibli.yml +112 -0
- data/lib/locales/ja/subscription.yml +8 -0
- data/lib/locales/ja/super_mario.yml +9 -0
- data/lib/locales/ja/super_smash_bros.yml +8 -0
- data/lib/locales/ja/university.yml +9 -0
- data/lib/locales/ja/zelda.yml +5 -0
- data/lib/locales/ko.yml +95 -2
- data/lib/locales/lt.yml +34 -0
- data/lib/locales/lv.yml +1 -1
- data/lib/locales/mi-NZ.yml +283 -0
- data/lib/locales/nb-NO.yml +5 -2
- data/lib/locales/nl.yml +1 -0
- data/lib/locales/pl.yml +2 -2
- data/lib/locales/pt-BR.yml +10 -2
- data/lib/locales/pt.yml +4 -2
- data/lib/locales/ru.yml +43 -1
- data/lib/locales/sk.yml +5 -2
- data/lib/locales/sv.yml +1 -0
- data/lib/locales/th.yml +76 -76
- data/lib/locales/tr.yml +1 -0
- data/lib/locales/uk.yml +3 -0
- data/lib/locales/vi.yml +1 -0
- data/lib/locales/zh-CN.yml +1 -0
- data/lib/locales/zh-TW.yml +1 -0
- metadata +219 -29
- data/lib/faker/default/fillmurray.rb +0 -45
- data/lib/faker/default/lorem_pixel.rb +0 -47
- 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)
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
* Added bork locale for bork-ified lorem [johnbentcope]
|
|
105
105
|
* Added IPv6 address generator [jc00ke]
|
|
106
106
|
* Removed deprecation warnings for Array#rand [chrismarshall]
|
|
107
|
-
* Added German translation and I18n
|
|
107
|
+
* Added German translation and I18n improvements [Matthias Kühnert]
|
|
108
108
|
* Added Dutch translation [moretea]
|
|
109
109
|
* Added Lat/Long generator [Andy Callaghan]
|
|
110
110
|
* Added buzzword-laden title generator [supercleanse]
|
|
@@ -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,78 +1,116 @@
|
|
|
1
|
-
|
|
2
1
|

|
|
3
2
|
|
|
4
3
|
# Faker
|
|
5
|
-
[](https://github.com/faker-ruby/faker/actions?query=workflow%3ATests)
|
|
6
5
|
[](https://badge.fury.io/rb/faker)
|
|
7
|
-
[](https://inch-ci.org/github/faker-ruby/faker)
|
|
8
7
|
[](https://codeclimate.com/github/stympy/faker/test_coverage)
|
|
9
8
|
[](https://codeclimate.com/github/stympy/faker/maintainability)
|
|
10
|
-
[](https://dependabot.com/compatibility-score.html?dependency-name=faker&package-manager=bundler&version-scheme=semver)
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
Faker is a port of [Perl's Data::Faker library](https://metacpan.org/pod/Data::Faker).
|
|
11
|
+
It's a library for generating fake data such as names, addresses, and phone numbers.
|
|
12
|
+
|
|
13
|
+
Faker helps you generate realistic test data, and populate your
|
|
14
|
+
database with more than a couple of records while you're doing development.
|
|
15
|
+
|
|
16
|
+
It comes in very handy for taking screenshots (taking screenshots for a personal project)
|
|
17
|
+
and it was the original impetus for the creation of this gem).
|
|
18
|
+
|
|
19
|
+
## Quick links
|
|
20
|
+
|
|
21
|
+
- 📖 **[Read the documentation for the latest version][rubydocs].**
|
|
22
|
+
- 📢 **[See what's changed in recent versions][changelog].**
|
|
13
23
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
development.
|
|
24
|
+
[rubydocs]: https://www.rubydoc.info/gems/faker/
|
|
25
|
+
[changelog]: CHANGELOG.md
|
|
26
|
+
|
|
27
|
+
## Table of Contents
|
|
19
28
|
|
|
20
29
|
- [Faker](#faker)
|
|
21
|
-
|
|
22
|
-
- [
|
|
30
|
+
- [Quick links](#quick-links)
|
|
31
|
+
- [Table of Contents](#table-of-contents)
|
|
32
|
+
- [Notes](#notes)
|
|
33
|
+
- [Getting Started](#getting-started)
|
|
23
34
|
- [Usage](#usage)
|
|
24
|
-
|
|
35
|
+
- [A note about the Generators versions](#a-note-about-the-generators-versions)
|
|
25
36
|
- [Ensuring unique values](#ensuring-unique-values)
|
|
26
37
|
- [Deterministic Random](#deterministic-random)
|
|
38
|
+
- [Customization](#customization)
|
|
39
|
+
- [Minitest and Faker \>= 2.22](#minitest-and-faker--222)
|
|
27
40
|
- [Generators](#generators)
|
|
28
|
-
- [Default](#default)
|
|
29
|
-
- [Blockchain](#blockchain)
|
|
30
|
-
- [Books](#books)
|
|
31
|
-
- [Creature](#creature)
|
|
32
|
-
- [Games](#games)
|
|
33
|
-
- [Japanese Media](#japanese-media)
|
|
34
|
-
- [Movies](#movies)
|
|
35
|
-
- [Music](#music)
|
|
36
|
-
- [Quotes](#quotes)
|
|
37
|
-
- [Sports](#sports)
|
|
38
|
-
- [Tv Shows](#tv-shows)
|
|
39
|
-
- [Customization](#customization)
|
|
40
41
|
- [Contributing](#contributing)
|
|
41
|
-
- [
|
|
42
|
+
- [Versioning](#versioning)
|
|
42
43
|
- [License](#license)
|
|
43
44
|
|
|
44
|
-
###
|
|
45
|
+
### Notes
|
|
46
|
+
|
|
45
47
|
* While Faker generates data at random, returned values are not guaranteed to be unique by default.
|
|
46
|
-
|
|
47
|
-
Values also can be deterministic if you use the deterministic feature, see [
|
|
48
|
-
* This is the `
|
|
49
|
-
Please refer the README of your version for the available methods.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
##
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
Note: if you are getting a `uninitialized constant Faker::[some_class]` error, your version of the gem is behind the one documented here. To make sure that your gem is the one documented here, change the line in your Gemfile to:
|
|
48
|
+
To explicitly specify when you require unique values, see [Ensuring Unique Values](#ensuring-unique-values).
|
|
49
|
+
Values also can be deterministic if you use the deterministic feature, see [Deterministic Random](#deterministic-random)
|
|
50
|
+
* This is the `main` branch of Faker and may contain changes that are not yet released.
|
|
51
|
+
Please refer to the README of your version for the available methods.
|
|
52
|
+
The list of all versions is [available here](https://github.com/stympy/faker/releases).
|
|
53
|
+
|
|
54
|
+
## Getting Started
|
|
55
|
+
|
|
56
|
+
Start by including `faker` in your Gemfile:
|
|
57
57
|
|
|
58
58
|
```ruby
|
|
59
|
-
gem 'faker'
|
|
59
|
+
gem 'faker'
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
Then run `bundle install`.
|
|
63
|
+
|
|
62
64
|
## Usage
|
|
65
|
+
|
|
66
|
+
Here are some examples of how to use Faker:
|
|
67
|
+
|
|
63
68
|
```ruby
|
|
64
69
|
require 'faker'
|
|
65
70
|
|
|
66
71
|
Faker::Name.name #=> "Christophe Bartell"
|
|
67
72
|
|
|
68
|
-
Faker::
|
|
73
|
+
Faker::Address.full_address #=> "5479 William Way, East Sonnyhaven, LA 63637"
|
|
74
|
+
|
|
75
|
+
Faker::Markdown.emphasis #=> "Quo qui aperiam. Amet corrupti distinctio. Sit quia *dolor.*"
|
|
76
|
+
|
|
77
|
+
Faker::TvShows::RuPaul.queen #=> "Violet Chachki"
|
|
78
|
+
|
|
79
|
+
Faker::Alphanumeric.alpha(number: 10) #=> "zlvubkrwga"
|
|
80
|
+
|
|
81
|
+
Faker::ProgrammingLanguage.name #=> "Ruby"
|
|
69
82
|
```
|
|
70
83
|
|
|
71
|
-
|
|
72
|
-
|
|
84
|
+
For a complete list of the generators, see [Generators](#generators).
|
|
85
|
+
|
|
86
|
+
#### A note about the Generators versions
|
|
87
|
+
|
|
88
|
+
If you get a `uninitialized constant Faker::[some_class]` error, your version of
|
|
89
|
+
the gem is behind main.
|
|
90
|
+
|
|
91
|
+
To make sure that your gem is the one
|
|
92
|
+
documented here, change the line in your Gemfile to:
|
|
93
|
+
|
|
94
|
+
```ruby
|
|
95
|
+
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The generators have the `@faker.version` tag on top of their implementation.
|
|
99
|
+
From the tags, you can identify the version the generator was added:
|
|
100
|
+
|
|
101
|
+
```ruby
|
|
102
|
+
# Faker::TvShows::ParksAndRec.character
|
|
103
|
+
|
|
104
|
+
# @faker.version 1.9.0
|
|
105
|
+
def character
|
|
106
|
+
fetch('parks_and_rec.characters')
|
|
107
|
+
end
|
|
108
|
+
```
|
|
73
109
|
|
|
74
110
|
### Ensuring unique values
|
|
75
|
-
|
|
111
|
+
|
|
112
|
+
To ensure Faker generates unique values, prefix your method call with `unique`:
|
|
113
|
+
|
|
76
114
|
```ruby
|
|
77
115
|
Faker::Name.unique.name # This will return a unique name every time it is called
|
|
78
116
|
```
|
|
@@ -81,6 +119,7 @@ If too many unique values are requested from a generator that has a limited
|
|
|
81
119
|
number of potential values, a `Faker::UniqueGenerator::RetryLimitExceeded`
|
|
82
120
|
exception may be raised. It is possible to clear the record of unique values
|
|
83
121
|
that have been returned, for example between tests.
|
|
122
|
+
|
|
84
123
|
```ruby
|
|
85
124
|
Faker::Name.unique.clear # Clears used values for Faker::Name
|
|
86
125
|
Faker::UniqueGenerator.clear # Clears used values for all generators
|
|
@@ -95,11 +134,13 @@ manually set values).
|
|
|
95
134
|
# Faker::<generator>.unique.exclude(method, arguments, list)
|
|
96
135
|
|
|
97
136
|
# Add 'azerty' and 'wxcvbn' to the string generator with 6 char length
|
|
98
|
-
Faker::Lorem.unique.exclude :string, [6], %w[azerty wxcvbn]
|
|
137
|
+
Faker::Lorem.unique.exclude :string, [number: 6], %w[azerty wxcvbn]
|
|
99
138
|
```
|
|
100
139
|
|
|
101
140
|
### Deterministic Random
|
|
102
|
-
|
|
141
|
+
|
|
142
|
+
Faker supports seeding of its pseudo-random number generator (PRNG)
|
|
143
|
+
to provide deterministic output of repeated method calls.
|
|
103
144
|
|
|
104
145
|
```ruby
|
|
105
146
|
Faker::Config.random = Random.new(42)
|
|
@@ -114,14 +155,49 @@ Faker::Config.random.seed #=> 185180369676275068918401850258677722187
|
|
|
114
155
|
Faker::Company.bs #=> "cultivate viral synergies"
|
|
115
156
|
```
|
|
116
157
|
|
|
158
|
+
### Customization
|
|
159
|
+
|
|
160
|
+
You may want Faker to print information depending on your location in the world.
|
|
161
|
+
To assist you in this, Faker uses the `I18n` gem to store strings and formats to
|
|
162
|
+
represent the names and postal codes of the area of your choosing.
|
|
163
|
+
|
|
164
|
+
Just set the locale you want as shown below, and Faker will take care of the rest.
|
|
165
|
+
|
|
166
|
+
```ruby
|
|
167
|
+
Faker::Config.locale = 'es'
|
|
168
|
+
# or
|
|
169
|
+
Faker::Config.locale = :es
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Note: Overriding the default locale might not be thread-safe. See [Locale setting can be ignored #2563](https://github.com/faker-ruby/faker/issues/2563) for more details.
|
|
173
|
+
|
|
174
|
+
To override Faker's locales,
|
|
175
|
+
check out the [locales README](lib/locales/README.md).
|
|
176
|
+
|
|
177
|
+
### Minitest and Faker >= 2.22
|
|
178
|
+
|
|
179
|
+
To prevent Faker (version >= 2.22) from generating duplicate values when using Minitest,
|
|
180
|
+
you might need to add the following to the `test_helper.rb` or `rails_helper.rb` file:
|
|
181
|
+
|
|
182
|
+
```ruby
|
|
183
|
+
Faker::Config.random = Random.new
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
See [Issue #2534](https://github.com/faker-ruby/faker/issues/2534) for more details.
|
|
187
|
+
|
|
117
188
|
## Generators
|
|
189
|
+
|
|
190
|
+
This is the full list of generators available with this gem. If you need details about any of them, make sure to consult the documentation.
|
|
191
|
+
|
|
118
192
|
**NOTE: Some of the generators below aren't released yet. If you want to use them, change the line in your gemfile to:**
|
|
119
193
|
|
|
120
194
|
```ruby
|
|
121
|
-
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => '
|
|
195
|
+
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
|
|
122
196
|
```
|
|
123
197
|
|
|
124
|
-
|
|
198
|
+
<details>
|
|
199
|
+
<summary>Default</summary>
|
|
200
|
+
|
|
125
201
|
- [Faker::Address](doc/default/address.md)
|
|
126
202
|
- [Faker::Alphanumeric](doc/default/alphanumeric.md)
|
|
127
203
|
- [Faker::Ancient](doc/default/ancient.md)
|
|
@@ -130,10 +206,13 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
130
206
|
- [Faker::Artist](doc/default/artist.md)
|
|
131
207
|
- [Faker::Avatar](doc/default/avatar.md)
|
|
132
208
|
- [Faker::Bank](doc/default/bank.md)
|
|
209
|
+
- [Faker::Barcode](doc/default/barcode.md)
|
|
133
210
|
- [Faker::Beer](doc/default/beer.md)
|
|
211
|
+
- [Faker::Blood](doc/default/blood.md)
|
|
134
212
|
- [Faker::Boolean](doc/default/boolean.md)
|
|
135
213
|
- [Faker::BossaNova](doc/default/bossa_nova.md)
|
|
136
214
|
- [Faker::Business](doc/default/business.md)
|
|
215
|
+
- [Faker::Camera](doc/default/camera.md)
|
|
137
216
|
- [Faker::Cannabis](doc/default/cannabis.md)
|
|
138
217
|
- [Faker::ChileRut](doc/default/chile_rut.md)
|
|
139
218
|
- [Faker::ChuckNorris](doc/default/chuck_norris.md)
|
|
@@ -144,6 +223,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
144
223
|
- [Faker::Commerce](doc/default/commerce.md)
|
|
145
224
|
- [Faker::Company](doc/default/company.md)
|
|
146
225
|
- [Faker::Compass](doc/default/compass.md)
|
|
226
|
+
- [Faker::Computer](doc/default/computer.md)
|
|
147
227
|
- [Faker::Construction](doc/default/construction.md)
|
|
148
228
|
- [Faker::Cosmere](doc/default/cosmere.md)
|
|
149
229
|
- [Faker::Crypto](doc/default/crypto.md)
|
|
@@ -155,11 +235,12 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
155
235
|
- [Faker::Dessert](doc/default/dessert.md)
|
|
156
236
|
- [Faker::Device](doc/default/device.md)
|
|
157
237
|
- [Faker::DrivingLicence](doc/default/driving_licence.md)
|
|
238
|
+
- [Faker::Drone](doc/drone/drone.md)
|
|
158
239
|
- [Faker::Educator](doc/default/educator.md)
|
|
159
240
|
- [Faker::ElectricalComponents](doc/default/electrical_components.md)
|
|
241
|
+
- [Faker::Emotion](doc/default/emotion.md)
|
|
160
242
|
- [Faker::Esport](doc/default/esport.md)
|
|
161
243
|
- [Faker::File](doc/default/file.md)
|
|
162
|
-
- [Faker::Fillmurray](doc/default/fillmurray.md)
|
|
163
244
|
- [Faker::Finance](doc/default/finance.md)
|
|
164
245
|
- [Faker::Food](doc/default/food.md)
|
|
165
246
|
- [Faker::FunnyName](doc/default/funny_name.md)
|
|
@@ -167,6 +248,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
167
248
|
- [Faker::GreekPhilosophers](doc/default/greek_philosophers.md)
|
|
168
249
|
- [Faker::Hacker](doc/default/hacker.md)
|
|
169
250
|
- [Faker::Hipster](doc/default/hipster.md)
|
|
251
|
+
- [Faker::Hobby](doc/default/hobby.md)
|
|
170
252
|
- [Faker::House](doc/default/house.md)
|
|
171
253
|
- [Faker::IDNumber](doc/default/id_number.md)
|
|
172
254
|
- [Faker::IndustrySegments](doc/default/industry_segments.md)
|
|
@@ -177,11 +259,11 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
177
259
|
- [Faker::Kpop](doc/default/kpop.md)
|
|
178
260
|
- [Faker::Lorem](doc/default/lorem.md)
|
|
179
261
|
- [Faker::LoremFlickr](doc/default/lorem_flickr.md)
|
|
180
|
-
- [Faker::LoremPixel](doc/default/lorem_pixel.md)
|
|
181
262
|
- [Faker::Markdown](doc/default/markdown.md)
|
|
182
263
|
- [Faker::Marketing](doc/default/marketing.md)
|
|
183
264
|
- [Faker::Measurement](doc/default/measurement.md)
|
|
184
265
|
- [Faker::Military](doc/default/military.md)
|
|
266
|
+
- [Faker::Mountain](doc/default/mountain.md)
|
|
185
267
|
- [Faker::Name](doc/default/name.md)
|
|
186
268
|
- [Faker::Nation](doc/default/nation.md)
|
|
187
269
|
- [Faker::NatoPhoneticAlphabet](doc/default/nato_phonetic_alphabet.md)
|
|
@@ -202,6 +284,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
202
284
|
- [Faker::Stripe](doc/default/stripe.md)
|
|
203
285
|
- [Faker::Subscription](doc/default/subscription.md)
|
|
204
286
|
- [Faker::Superhero](doc/default/superhero.md)
|
|
287
|
+
- [Faker::Tea](doc/default/tea.md)
|
|
205
288
|
- [Faker::Team](doc/default/team.md)
|
|
206
289
|
- [Faker::Time](doc/default/time.md)
|
|
207
290
|
- [Faker::Twitter](doc/default/twitter.md)
|
|
@@ -209,28 +292,57 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
209
292
|
- [Faker::University](doc/default/university.md)
|
|
210
293
|
- [Faker::Vehicle](doc/default/vehicle.md)
|
|
211
294
|
- [Faker::Verbs](doc/default/verbs.md)
|
|
295
|
+
- [Faker::VulnerabilityIdentifier](doc/default/vulnerability_identifier.md)
|
|
212
296
|
- [Faker::WorldCup](doc/default/world_cup.md)
|
|
297
|
+
</details>
|
|
298
|
+
|
|
299
|
+
<details>
|
|
300
|
+
<summary>Blockchain</summary>
|
|
213
301
|
|
|
214
|
-
### Blockchain
|
|
215
302
|
- [Faker::Blockchain::Aeternity](doc/blockchain/aeternity.md)
|
|
216
303
|
- [Faker::Blockchain::Bitcoin](doc/blockchain/bitcoin.md)
|
|
217
304
|
- [Faker::Blockchain::Ethereum](doc/blockchain/ethereum.md)
|
|
218
305
|
- [Faker::Blockchain::Tezos](doc/blockchain/tezos.md)
|
|
306
|
+
</details>
|
|
307
|
+
|
|
308
|
+
<details>
|
|
309
|
+
<summary>Books</summary>
|
|
219
310
|
|
|
220
|
-
### Books
|
|
221
311
|
- [Faker::Book](doc/books/book.md)
|
|
222
312
|
- [Faker::Books::CultureSeries](doc/books/culture_series.md)
|
|
223
313
|
- [Faker::Books::Dune](doc/books/dune.md)
|
|
224
314
|
- [Faker::Books::Lovecraft](doc/books/lovecraft.md)
|
|
315
|
+
- [Faker::Books::TheKingkillerChronicle](doc/books/the_kingkiller_chronicle.md)
|
|
316
|
+
</details>
|
|
317
|
+
|
|
318
|
+
<details>
|
|
319
|
+
<summary>Fantasy</summary>
|
|
320
|
+
|
|
321
|
+
- [Faker::Fantasy::Tolkien](doc/fantasy/tolkien.md)
|
|
322
|
+
</details>
|
|
323
|
+
|
|
324
|
+
<details>
|
|
325
|
+
<summary>Travel</summary>
|
|
326
|
+
|
|
327
|
+
- [Faker:Travel::Airport](doc/travel/airport.md)
|
|
328
|
+
</details>
|
|
329
|
+
|
|
330
|
+
<details>
|
|
331
|
+
<summary>Creature</summary>
|
|
225
332
|
|
|
226
|
-
### Creature
|
|
227
333
|
- [Faker::Creature::Animal](doc/creature/animal.md)
|
|
334
|
+
- [Faker::Creature::Bird](doc/creature/bird.md)
|
|
228
335
|
- [Faker::Creature::Cat](doc/creature/cat.md)
|
|
229
336
|
- [Faker::Creature::Dog](doc/creature/dog.md)
|
|
230
337
|
- [Faker::Creature::Horse](doc/creature/horse.md)
|
|
338
|
+
</details>
|
|
339
|
+
|
|
340
|
+
<details>
|
|
341
|
+
<summary>Games</summary>
|
|
231
342
|
|
|
232
|
-
### Games
|
|
233
343
|
- [Faker::Game](doc/games/game.md)
|
|
344
|
+
- [Faker::Games::ClashOfClans](doc/games/clash_of_clans.md)
|
|
345
|
+
- [Faker::Games::DnD](doc/games/dnd.md)
|
|
234
346
|
- [Faker::Games::Dota](doc/games/dota.md)
|
|
235
347
|
- [Faker::Games::ElderScrolls](doc/games/elder_scrolls.md)
|
|
236
348
|
- [Faker::Games::Fallout](doc/games/fallout.md)
|
|
@@ -238,61 +350,104 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
238
350
|
- [Faker::Games::Heroes](doc/games/heroes.md)
|
|
239
351
|
- [Faker::Games::HeroesOfTheStorm](doc/games/heroes_of_the_storm.md)
|
|
240
352
|
- [Faker::Games::LeagueOfLegends](doc/games/league_of_legends.md)
|
|
353
|
+
- [Faker::Games::Minecraft](doc/games/minecraft.md)
|
|
241
354
|
- [Faker::Games::Myst](doc/games/myst.md)
|
|
242
355
|
- [Faker::Games::Overwatch](doc/games/overwatch.md)
|
|
243
356
|
- [Faker::Games::Pokemon](doc/games/pokemon.md)
|
|
244
357
|
- [Faker::Games::SonicTheHedgehog](doc/games/sonic_the_hedgehog.md)
|
|
358
|
+
- [Faker::Games::StreetFighter](doc/games/street_fighter.md)
|
|
359
|
+
- [Faker::Games::SuperMario](doc/games/super_mario.md)
|
|
245
360
|
- [Faker::Games::SuperSmashBros](doc/games/super_smash_bros.md)
|
|
361
|
+
- [Faker::Games::Touhou](doc/games/touhou.md)
|
|
362
|
+
- [Faker::Games::WarhammerFantasy](doc/games/warhammer_fantasy.md)
|
|
246
363
|
- [Faker::Games::Witcher](doc/games/witcher.md)
|
|
247
364
|
- [Faker::Games::WorldOfWarcraft](doc/games/world_of_warcraft.md)
|
|
248
365
|
- [Faker::Games::Zelda](doc/games/zelda.md)
|
|
366
|
+
</details>
|
|
249
367
|
|
|
250
|
-
|
|
368
|
+
<details>
|
|
369
|
+
<summary>Japanese Media</summary>
|
|
370
|
+
|
|
371
|
+
- [Faker::JapaneseMedia::CowboyBebop](doc/japanese_media/cowboy_bebop.md)
|
|
251
372
|
- [Faker::JapaneseMedia::DragonBall](doc/japanese_media/dragon_ball.md)
|
|
252
373
|
- [Faker::JapaneseMedia::OnePiece](doc/japanese_media/one_piece.md)
|
|
374
|
+
- [Faker::JapaneseMedia::StudioGhibli](doc/japanese_media/studio_ghibli.md)
|
|
253
375
|
- [Faker::JapaneseMedia::SwordArtOnline](doc/japanese_media/sword_art_online.md)
|
|
376
|
+
- [Faker::JapaneseMedia::Naruto](doc/japanese_media/naruto.md)
|
|
377
|
+
- [Faker::JapaneseMedia::Doraemon](doc/japanese_media/doraemon.md)
|
|
378
|
+
- [Faker::JapaneseMedia::Conan](doc/japanese_media/conan.md)
|
|
379
|
+
- [Faker::JapaneseMedia::FmaBrotherhood](doc/japanese_media/fullmetal_alchemist_brotherhood.md)
|
|
380
|
+
</details>
|
|
381
|
+
|
|
382
|
+
<details>
|
|
383
|
+
<summary>Movies</summary>
|
|
254
384
|
|
|
255
|
-
### Movies
|
|
256
385
|
- [Faker::Movie](doc/movies/movie.md)
|
|
386
|
+
- [Faker::Movies::Avatar](doc/movies/avatar.md)
|
|
257
387
|
- [Faker::Movies::BackToTheFuture](doc/movies/back_to_the_future.md)
|
|
388
|
+
- [Faker::Movies::Departed](doc/movies/departed.md)
|
|
258
389
|
- [Faker::Movies::Ghostbusters](doc/movies/ghostbusters.md)
|
|
259
390
|
- [Faker::Movies::HarryPotter](doc/movies/harry_potter.md)
|
|
260
391
|
- [Faker::Movies::HitchhikersGuideToTheGalaxy](doc/movies/hitchhikers_guide_to_the_galaxy.md)
|
|
261
392
|
- [Faker::Movies::Hobbit](doc/movies/hobbit.md)
|
|
393
|
+
- [Faker::Movies::HowToTrainYourDragon](doc/movies/how_to_train_your_dragon.md)
|
|
262
394
|
- [Faker::Movies::Lebowski](doc/movies/lebowski.md)
|
|
263
395
|
- [Faker::Movies::LordOfTheRings](doc/movies/lord_of_the_rings.md)
|
|
264
396
|
- [Faker::Movies::PrincessBride](doc/movies/princess_bride.md)
|
|
265
397
|
- [Faker::Movies::StarWars](doc/movies/star_wars.md)
|
|
398
|
+
- [Faker::Movies::TRON](doc/movies/tron.md)
|
|
266
399
|
- [Faker::Movies::VForVendetta](doc/movies/v_for_vendetta.md)
|
|
400
|
+
</details>
|
|
401
|
+
|
|
402
|
+
<details>
|
|
403
|
+
<summary>Music</summary>
|
|
267
404
|
|
|
268
|
-
### Music
|
|
269
405
|
- [Faker::Music](doc/music/music.md)
|
|
270
406
|
- [Faker::Music::GratefulDead](doc/music/grateful_dead.md)
|
|
407
|
+
- [Faker::Music::Hiphop](doc/music/hiphop.md)
|
|
271
408
|
- [Faker::Music::Opera](doc/music/opera.md)
|
|
409
|
+
- [Faker::Music::PearlJam](doc/music/pearl_jam.md)
|
|
272
410
|
- [Faker::Music::Phish](doc/music/phish.md)
|
|
411
|
+
- [Faker::Music::Prince](doc/music/prince.md)
|
|
273
412
|
- [Faker::Music::RockBand](doc/music/rock_band.md)
|
|
413
|
+
- [Faker::Music::Rush](doc/music/rush.md)
|
|
274
414
|
- [Faker::Music::UmphreysMcgee](doc/music/umphreys_mcgee.md)
|
|
415
|
+
</details>
|
|
416
|
+
|
|
417
|
+
<details>
|
|
418
|
+
<summary>Quotes</summary>
|
|
275
419
|
|
|
276
|
-
### Quotes
|
|
277
420
|
- [Faker::Quote](doc/quotes/quote.md)
|
|
278
421
|
- [Faker::Quotes::Chiquito](doc/quotes/chiquito.md)
|
|
279
422
|
- [Faker::Quotes::Rajnikanth](doc/quotes/rajnikanth.md)
|
|
280
423
|
- [Faker::Quotes::Shakespeare](doc/quotes/shakespeare.md)
|
|
424
|
+
</details>
|
|
281
425
|
|
|
426
|
+
<details>
|
|
427
|
+
<summary>Sports</summary>
|
|
282
428
|
|
|
283
|
-
|
|
429
|
+
- [Faker::Sports](doc/sports/sports.md)
|
|
284
430
|
- [Faker::Sports::Basketball](doc/sports/basketball.md)
|
|
431
|
+
- [Faker::Sports::Chess](doc/sports/chess.md)
|
|
285
432
|
- [Faker::Sports::Football](doc/sports/football.md)
|
|
433
|
+
- [Faker::Sports::Mountaineering](doc/sports/mountaineering.md)
|
|
434
|
+
- [Faker::Sports::Volleyball](doc/sports/volleyball.md)
|
|
435
|
+
</details>
|
|
436
|
+
|
|
437
|
+
<details>
|
|
438
|
+
<summary>Tv Shows</summary>
|
|
286
439
|
|
|
287
|
-
### Tv Shows
|
|
288
440
|
- [Faker::TvShows::AquaTeenHungerForce](doc/tv_shows/aqua_teen_hunger_force.md)
|
|
441
|
+
- [Faker::TvShows::BigBangTheory](doc/tv_shows/big_bang_theory.md)
|
|
289
442
|
- [Faker::TvShows::BojackHorseman](doc/tv_shows/bojack_horseman.md)
|
|
290
443
|
- [Faker::TvShows::BreakingBad](doc/tv_shows/breaking_bad.md)
|
|
444
|
+
- [Faker::TvShows::BrooklynNineNine](doc/tv_shows/brooklyn_nine_nine.md)
|
|
291
445
|
- [Faker::TvShows::Buffy](doc/tv_shows/buffy.md)
|
|
292
446
|
- [Faker::TvShows::Community](doc/tv_shows/community.md)
|
|
293
447
|
- [Faker::TvShows::DrWho](doc/tv_shows/dr_who.md)
|
|
294
448
|
- [Faker::TvShows::DumbAndDumber](doc/tv_shows/dumb_and_dumber.md)
|
|
295
449
|
- [Faker::TvShows::FamilyGuy](doc/tv_shows/family_guy.md)
|
|
450
|
+
- [Faker::TvShows::FinalSpace](doc/tv_shows/final_space.md)
|
|
296
451
|
- [Faker::TvShows::Friends](doc/tv_shows/friends.md)
|
|
297
452
|
- [Faker::TvShows::GameOfThrones](doc/tv_shows/game_of_thrones.md)
|
|
298
453
|
- [Faker::TvShows::HeyArnold](doc/tv_shows/hey_arnold.md)
|
|
@@ -306,65 +461,37 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
306
461
|
- [Faker::TvShows::SiliconValley](doc/tv_shows/silicon_valley.md)
|
|
307
462
|
- [Faker::TvShows::Simpsons](doc/tv_shows/simpsons.md)
|
|
308
463
|
- [Faker::TvShows::SouthPark](doc/tv_shows/south_park.md)
|
|
464
|
+
- [Faker::TvShows::Spongebob](doc/tv_shows/spongebob.md)
|
|
309
465
|
- [Faker::TvShows::StarTrek](doc/tv_shows/star_trek.md)
|
|
310
466
|
- [Faker::TvShows::Stargate](doc/tv_shows/stargate.md)
|
|
311
467
|
- [Faker::TvShows::StrangerThings](doc/tv_shows/stranger_things.md)
|
|
468
|
+
- [Faker::TvShows::Suits](doc/tv_shows/suits.md)
|
|
469
|
+
- [Faker::TvShows::Supernatural](doc/tv_shows/supernatural.md)
|
|
312
470
|
- [Faker::TvShows::TheExpanse](doc/tv_shows/the_expanse.md)
|
|
313
471
|
- [Faker::TvShows::TheFreshPrinceOfBelAir](doc/tv_shows/the_fresh_prince_of_bel_air.md)
|
|
314
472
|
- [Faker::TvShows::TheITCrowd](doc/tv_shows/the_it_crowd.md)
|
|
315
473
|
- [Faker::TvShows::TheThickOfIt](doc/tv_shows/the_thick_of_it.md)
|
|
316
474
|
- [Faker::TvShows::TwinPeaks](doc/tv_shows/twin_peaks.md)
|
|
317
475
|
- [Faker::TvShows::VentureBros](doc/tv_shows/venture_bros.md)
|
|
318
|
-
|
|
319
|
-
## Customization
|
|
320
|
-
Since you may want to make addresses and other types of data look different
|
|
321
|
-
depending on where in the world you are (US postal codes vs. UK postal codes,
|
|
322
|
-
for example), Faker uses the I18n gem to store strings (like state names) and
|
|
323
|
-
formats (US postal codes are NNNNN while UK postal codes are AAN NAA),
|
|
324
|
-
allowing you to get different formats by switching locales. Just set
|
|
325
|
-
Faker::Config.locale to the locale you want, and Faker will take care of the
|
|
326
|
-
rest.
|
|
327
|
-
|
|
328
|
-
If your locale doesn't already exist, create it in the `lib/locales` directory
|
|
329
|
-
and you can then override or add elements to suit your needs. See more about how to
|
|
330
|
-
use locales [here](lib/locales/README.md)
|
|
331
|
-
|
|
332
|
-
```yaml
|
|
333
|
-
en-au-ocker:
|
|
334
|
-
faker:
|
|
335
|
-
name:
|
|
336
|
-
# Existing faker field, new data
|
|
337
|
-
first_name:
|
|
338
|
-
- Charlotte
|
|
339
|
-
- Ava
|
|
340
|
-
- Chloe
|
|
341
|
-
- Emily
|
|
342
|
-
|
|
343
|
-
# New faker fields
|
|
344
|
-
ocker_first_name:
|
|
345
|
-
- Bazza
|
|
346
|
-
- Bluey
|
|
347
|
-
- Davo
|
|
348
|
-
- Johno
|
|
349
|
-
- Shano
|
|
350
|
-
- Shazza
|
|
351
|
-
region:
|
|
352
|
-
- South East Queensland
|
|
353
|
-
- Wide Bay Burnett
|
|
354
|
-
- Margaret River
|
|
355
|
-
- Port Pirie
|
|
356
|
-
- Gippsland
|
|
357
|
-
- Elizabeth
|
|
358
|
-
- Barossa
|
|
359
|
-
```
|
|
476
|
+
</details>
|
|
360
477
|
|
|
361
478
|
## Contributing
|
|
362
|
-
See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/master/CONTRIBUTING.md).
|
|
363
479
|
|
|
364
|
-
|
|
365
|
-
|
|
480
|
+
If you have problems, please create a [GitHub Issue](/.github/ISSUE_TEMPLATE/bug-report.md).
|
|
481
|
+
|
|
482
|
+
Take a look at the [Contributing](CONTRIBUTING.md) document for
|
|
483
|
+
instructions on setting up the repo on your machine, understanding the codebase,
|
|
484
|
+
and creating a good pull request.
|
|
366
485
|
|
|
367
|
-
|
|
486
|
+
There is a [Discord channel](https://discord.gg/RMumTwB) to discuss anything
|
|
487
|
+
regarding improvements or feature requests.
|
|
488
|
+
|
|
489
|
+
Thank you, contributors!
|
|
490
|
+
|
|
491
|
+
## Versioning
|
|
492
|
+
|
|
493
|
+
Faker follows Semantic Versioning 2.0 as defined at https://semver.org.
|
|
368
494
|
|
|
369
495
|
## License
|
|
496
|
+
|
|
370
497
|
This code is free to use under the terms of the MIT license.
|
|
@@ -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
|
|
@@ -61,7 +61,7 @@ module Faker
|
|
|
61
61
|
def rand_strings(length = 50)
|
|
62
62
|
hex_alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
63
63
|
var = +''
|
|
64
|
-
length.times { var << sample(shuffle(hex_alphabet.
|
|
64
|
+
length.times { var << sample(shuffle(hex_alphabet.chars)) }
|
|
65
65
|
var
|
|
66
66
|
end
|
|
67
67
|
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
|
|
@@ -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
|