faker 2.11.0 → 3.4.2
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 +1131 -19
- data/README.md +249 -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 +16 -44
- data/lib/faker/books/the_kingkiller_chronicle.rb +61 -0
- data/lib/faker/creature/bird.rb +203 -0
- data/lib/faker/default/address.rb +42 -32
- 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 +62 -18
- data/lib/faker/default/chuck_norris.rb +1 -0
- data/lib/faker/default/code.rb +162 -52
- data/lib/faker/default/color.rb +77 -6
- data/lib/faker/default/commerce.rb +105 -28
- data/lib/faker/default/company.rb +210 -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 +26 -4
- data/lib/faker/default/crypto_coin.rb +48 -15
- data/lib/faker/default/date.rb +81 -54
- data/lib/faker/default/demographic.rb +1 -5
- data/lib/faker/default/driving_licence.rb +85 -18
- 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 +108 -51
- data/lib/faker/default/hobby.rb +22 -0
- data/lib/faker/default/html.rb +230 -0
- data/lib/faker/default/id_number.rb +251 -17
- data/lib/faker/default/internet.rb +361 -113
- data/lib/faker/default/internet_http.rb +48 -0
- data/lib/faker/default/invoice.rb +37 -23
- data/lib/faker/default/json.rb +63 -25
- data/lib/faker/default/lorem.rb +177 -75
- 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 → national_health_service.rb} +26 -6
- data/lib/faker/default/number.rb +39 -69
- data/lib/faker/default/omniauth.rb +115 -57
- data/lib/faker/default/phone_number.rb +112 -14
- 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 +93 -3
- 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/theater.rb +52 -0
- data/lib/faker/default/time.rb +4 -34
- data/lib/faker/default/twitter.rb +42 -23
- data/lib/faker/default/types.rb +92 -34
- data/lib/faker/default/university.rb +45 -0
- data/lib/faker/default/vehicle.rb +227 -57
- 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/final_fantasy_xiv.rb +73 -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 +51 -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 +52 -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/star_wars.rb +75 -7
- data/lib/faker/movies/the_room.rb +63 -0
- 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/smashing_pumpkins.rb +64 -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/travel/train_station.rb +54 -0
- data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +13 -0
- data/lib/faker/tv_shows/archer.rb +51 -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/south_park.rb +15 -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 +51 -87
- data/lib/helpers/base58.rb +1 -1
- data/lib/helpers/char.rb +22 -27
- data/lib/helpers/deprecator.rb +53 -0
- data/lib/helpers/positional_generator.rb +480 -0
- data/lib/helpers/unique_generator.rb +13 -13
- data/lib/locales/README.md +18 -2
- data/lib/locales/ar.yml +6 -1
- data/lib/locales/bg.yml +1 -2
- data/lib/locales/da-DK.yml +529 -35
- data/lib/locales/de-AT.yml +3487 -25
- data/lib/locales/de-CH.yml +6020 -9
- data/lib/locales/de.yml +7185 -97
- data/lib/locales/ee.yml +0 -1
- data/lib/locales/en/address.yml +1828 -562
- 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/archer.yml +75 -0
- data/lib/locales/en/australia.yml +108 -0
- data/lib/locales/en/avatar.yml +31 -0
- data/lib/locales/en/bank.yml +2 -2
- 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/dog.yml +262 -7
- data/lib/locales/en/doraemon.yml +286 -0
- data/lib/locales/en/dota.yml +704 -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_fantasy_xiv.yml +754 -0
- data/lib/locales/en/final_space.yml +37 -0
- data/lib/locales/en/finance.yml +80 -4
- data/lib/locales/en/food.yml +1067 -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/fullmetal_alchemist_brotherhood.yml +78 -0
- 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/harry_potter.yml +1 -1
- 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/id_number.yml +1 -1
- data/lib/locales/en/internet.yml +136 -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/phone_number.yml +78 -3
- 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/rush.yml +32 -0
- data/lib/locales/en/science.yml +481 -3
- data/lib/locales/en/shakespeare.yml +21 -24
- data/lib/locales/en/simpsons.yml +668 -0
- data/lib/locales/en/smashing_pumpkins.yml +382 -0
- data/lib/locales/en/source.yml +35 -0
- data/lib/locales/en/south_park.yml +360 -2
- 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/the_room.yml +68 -0
- data/lib/locales/en/theater.yml +597 -0
- data/lib/locales/en/tolkien.yml +2453 -0
- data/lib/locales/en/touhou.yml +839 -0
- data/lib/locales/en/train_station.yml +280 -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 +728 -17
- data/lib/locales/en-CA.yml +373 -16
- data/lib/locales/en-GB.yml +116 -8
- data/lib/locales/en-IND.yml +1259 -16
- data/lib/locales/en-KE.yml +212 -0
- data/lib/locales/en-MS.yml +364 -16
- data/lib/locales/en-NEP.yml +212 -35
- data/lib/locales/en-NG.yml +1 -0
- data/lib/locales/en-NZ.yml +1153 -121
- data/lib/locales/en-PAK.yml +369 -9
- data/lib/locales/en-SG.yml +581 -15
- data/lib/locales/en-UG.yml +1 -0
- data/lib/locales/en-US.yml +6937 -71
- data/lib/locales/en-ZA.yml +1 -1
- data/lib/locales/en-au-ocker.yml +266 -21
- data/lib/locales/en.yml +0 -3
- data/lib/locales/es-AR.yml +4570 -0
- data/lib/locales/es-MX.yml +1 -2
- data/lib/locales/es.yml +58 -3
- 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 +4 -0
- data/lib/locales/fr/lorem.yml +5 -0
- data/lib/locales/fr/measurement.yml +7 -0
- data/lib/locales/fr/name.yml +22 -0
- data/lib/locales/fr/phone_number.yml +7 -0
- data/lib/locales/fr/pokemon.yml +7 -0
- data/lib/locales/fr-CA.yml +2748 -43
- data/lib/locales/fr-CH.yml +3 -4
- data/lib/locales/fr.yml +2 -112
- data/lib/locales/hy.yml +3624 -119
- data/lib/locales/id.yml +839 -10
- data/lib/locales/it.yml +1304 -31
- 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/football.yml +115 -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/sport.yml +130 -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/touhou.yml +466 -0
- data/lib/locales/ja/university.yml +9 -0
- data/lib/locales/ja/zelda.yml +5 -0
- data/lib/locales/ko.yml +1450 -17
- data/lib/locales/lt.yml +315 -0
- data/lib/locales/lv.yml +1 -2
- data/lib/locales/mi-NZ.yml +283 -0
- data/lib/locales/nb-NO.yml +518 -27
- data/lib/locales/nl.yml +1 -1
- data/lib/locales/pl.yml +1 -2
- data/lib/locales/pt-BR.yml +8157 -659
- data/lib/locales/pt.yml +844 -43
- data/lib/locales/ru.yml +1355 -30
- data/lib/locales/sk.yml +4410 -41
- data/lib/locales/sv.yml +100 -0
- data/lib/locales/th.yml +76 -76
- data/lib/locales/tr.yml +1 -2
- data/lib/locales/uk.yml +1810 -44
- data/lib/locales/vi.yml +1 -0
- data/lib/locales/zh-CN/bank.yml +17 -0
- data/lib/locales/zh-CN.yml +1 -0
- data/lib/locales/zh-TW.yml +1 -0
- metadata +192 -127
- data/History.md +0 -176
- 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/README.md
CHANGED
|
@@ -1,78 +1,124 @@
|
|
|
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].**
|
|
23
|
+
|
|
24
|
+
[rubydocs]: https://www.rubydoc.info/gems/faker/
|
|
25
|
+
[changelog]: CHANGELOG.md
|
|
26
|
+
|
|
27
|
+
## In the media
|
|
28
|
+
|
|
29
|
+
- 📰 [With Great Humor Comes Great Developer Engagement] - KTH Royal Institute of Technology research
|
|
30
|
+
- 🎧 [Computer und Kommunikation 4.5.2024, komplette Sendung] - Deutschland Funk Radio Interview
|
|
31
|
+
|
|
32
|
+
[With Great Humor Comes Great Developer Engagement]: https://arxiv.org/pdf/2312.01680
|
|
33
|
+
[Computer und Kommunikation 4.5.2024, komplette Sendung]: https://www.deutschlandfunk.de/computer-und-kommunikation-4-5-2024-komplette-sendung-dlf-16492b03-100.html
|
|
13
34
|
|
|
14
|
-
|
|
15
|
-
project, [Catch the Best](http://catchthebest.com/) was the original impetus
|
|
16
|
-
for the creation of this gem), having real-looking test data, and having your
|
|
17
|
-
database populated with more than one or two records while you're doing
|
|
18
|
-
development.
|
|
35
|
+
## Table of Contents
|
|
19
36
|
|
|
20
37
|
- [Faker](#faker)
|
|
21
|
-
|
|
22
|
-
- [
|
|
38
|
+
- [Quick links](#quick-links)
|
|
39
|
+
- [Table of Contents](#table-of-contents)
|
|
40
|
+
- [Notes](#notes)
|
|
41
|
+
- [Getting Started](#getting-started)
|
|
23
42
|
- [Usage](#usage)
|
|
24
|
-
|
|
43
|
+
- [A note about the Generators versions](#a-note-about-the-generators-versions)
|
|
25
44
|
- [Ensuring unique values](#ensuring-unique-values)
|
|
26
45
|
- [Deterministic Random](#deterministic-random)
|
|
46
|
+
- [Customization](#customization)
|
|
47
|
+
- [Minitest and Faker \>= 2.22](#minitest-and-faker--222)
|
|
27
48
|
- [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
49
|
- [Contributing](#contributing)
|
|
41
|
-
- [
|
|
50
|
+
- [Versioning](#versioning)
|
|
42
51
|
- [License](#license)
|
|
43
52
|
|
|
44
|
-
###
|
|
53
|
+
### Notes
|
|
54
|
+
|
|
45
55
|
* 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:
|
|
56
|
+
To explicitly specify when you require unique values, see [Ensuring Unique Values](#ensuring-unique-values).
|
|
57
|
+
Values also can be deterministic if you use the deterministic feature, see [Deterministic Random](#deterministic-random)
|
|
58
|
+
* This is the `main` branch of Faker and may contain changes that are not yet released.
|
|
59
|
+
Please refer to the README of your version for the available methods.
|
|
60
|
+
The list of all versions is [available here](https://github.com/stympy/faker/releases).
|
|
61
|
+
|
|
62
|
+
## Getting Started
|
|
63
|
+
|
|
64
|
+
Start by including `faker` in your Gemfile:
|
|
57
65
|
|
|
58
66
|
```ruby
|
|
59
|
-
gem 'faker'
|
|
67
|
+
gem 'faker'
|
|
60
68
|
```
|
|
61
69
|
|
|
70
|
+
Then run `bundle install`.
|
|
71
|
+
|
|
62
72
|
## Usage
|
|
73
|
+
|
|
74
|
+
Here are some examples of how to use Faker:
|
|
75
|
+
|
|
63
76
|
```ruby
|
|
64
77
|
require 'faker'
|
|
65
78
|
|
|
66
79
|
Faker::Name.name #=> "Christophe Bartell"
|
|
67
80
|
|
|
68
|
-
Faker::
|
|
81
|
+
Faker::Address.full_address #=> "5479 William Way, East Sonnyhaven, LA 63637"
|
|
82
|
+
|
|
83
|
+
Faker::Markdown.emphasis #=> "Quo qui aperiam. Amet corrupti distinctio. Sit quia *dolor.*"
|
|
84
|
+
|
|
85
|
+
Faker::TvShows::RuPaul.queen #=> "Violet Chachki"
|
|
86
|
+
|
|
87
|
+
Faker::Alphanumeric.alpha(number: 10) #=> "zlvubkrwga"
|
|
88
|
+
|
|
89
|
+
Faker::ProgrammingLanguage.name #=> "Ruby"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For a complete list of the generators, see [Generators](#generators).
|
|
93
|
+
|
|
94
|
+
#### A note about the Generators versions
|
|
95
|
+
|
|
96
|
+
If you get a `uninitialized constant Faker::[some_class]` error, your version of
|
|
97
|
+
the gem is behind main.
|
|
98
|
+
|
|
99
|
+
To make sure that your gem is the one
|
|
100
|
+
documented here, change the line in your Gemfile to:
|
|
101
|
+
|
|
102
|
+
```ruby
|
|
103
|
+
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
|
|
69
104
|
```
|
|
70
105
|
|
|
71
|
-
|
|
72
|
-
|
|
106
|
+
The generators have the `@faker.version` tag on top of their implementation.
|
|
107
|
+
From the tags, you can identify the version the generator was added:
|
|
108
|
+
|
|
109
|
+
```ruby
|
|
110
|
+
# Faker::TvShows::ParksAndRec.character
|
|
111
|
+
|
|
112
|
+
# @faker.version 1.9.0
|
|
113
|
+
def character
|
|
114
|
+
fetch('parks_and_rec.characters')
|
|
115
|
+
end
|
|
116
|
+
```
|
|
73
117
|
|
|
74
118
|
### Ensuring unique values
|
|
75
|
-
|
|
119
|
+
|
|
120
|
+
To ensure Faker generates unique values, prefix your method call with `unique`:
|
|
121
|
+
|
|
76
122
|
```ruby
|
|
77
123
|
Faker::Name.unique.name # This will return a unique name every time it is called
|
|
78
124
|
```
|
|
@@ -81,6 +127,7 @@ If too many unique values are requested from a generator that has a limited
|
|
|
81
127
|
number of potential values, a `Faker::UniqueGenerator::RetryLimitExceeded`
|
|
82
128
|
exception may be raised. It is possible to clear the record of unique values
|
|
83
129
|
that have been returned, for example between tests.
|
|
130
|
+
|
|
84
131
|
```ruby
|
|
85
132
|
Faker::Name.unique.clear # Clears used values for Faker::Name
|
|
86
133
|
Faker::UniqueGenerator.clear # Clears used values for all generators
|
|
@@ -95,11 +142,13 @@ manually set values).
|
|
|
95
142
|
# Faker::<generator>.unique.exclude(method, arguments, list)
|
|
96
143
|
|
|
97
144
|
# Add 'azerty' and 'wxcvbn' to the string generator with 6 char length
|
|
98
|
-
Faker::Lorem.unique.exclude :string, [6], %w[azerty wxcvbn]
|
|
145
|
+
Faker::Lorem.unique.exclude :string, [number: 6], %w[azerty wxcvbn]
|
|
99
146
|
```
|
|
100
147
|
|
|
101
148
|
### Deterministic Random
|
|
102
|
-
|
|
149
|
+
|
|
150
|
+
Faker supports seeding of its pseudo-random number generator (PRNG)
|
|
151
|
+
to provide deterministic output of repeated method calls.
|
|
103
152
|
|
|
104
153
|
```ruby
|
|
105
154
|
Faker::Config.random = Random.new(42)
|
|
@@ -114,14 +163,47 @@ Faker::Config.random.seed #=> 185180369676275068918401850258677722187
|
|
|
114
163
|
Faker::Company.bs #=> "cultivate viral synergies"
|
|
115
164
|
```
|
|
116
165
|
|
|
166
|
+
### Customization
|
|
167
|
+
|
|
168
|
+
You may want Faker to print information depending on your location in the world.
|
|
169
|
+
To assist you in this, Faker uses the `I18n` gem to store strings and formats to
|
|
170
|
+
represent the names and postal codes of the area of your choosing.
|
|
171
|
+
|
|
172
|
+
Just set the locale you want as shown below, and Faker will take care of the rest.
|
|
173
|
+
|
|
174
|
+
```ruby
|
|
175
|
+
Faker::Config.locale = 'es'
|
|
176
|
+
# or
|
|
177
|
+
Faker::Config.locale = :es
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
To override Faker's locales, and set it on threaded server environments
|
|
181
|
+
check out the [locales README](lib/locales/README.md).
|
|
182
|
+
|
|
183
|
+
### Minitest and Faker >= 2.22
|
|
184
|
+
|
|
185
|
+
To prevent Faker (version >= 2.22) from generating duplicate values when using Minitest,
|
|
186
|
+
you might need to add the following to the `test_helper.rb` or `rails_helper.rb` file:
|
|
187
|
+
|
|
188
|
+
```ruby
|
|
189
|
+
Faker::Config.random = Random.new
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
See [Issue #2534](https://github.com/faker-ruby/faker/issues/2534) for more details.
|
|
193
|
+
|
|
117
194
|
## Generators
|
|
195
|
+
|
|
196
|
+
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.
|
|
197
|
+
|
|
118
198
|
**NOTE: Some of the generators below aren't released yet. If you want to use them, change the line in your gemfile to:**
|
|
119
199
|
|
|
120
200
|
```ruby
|
|
121
|
-
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => '
|
|
201
|
+
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
|
|
122
202
|
```
|
|
123
203
|
|
|
124
|
-
|
|
204
|
+
<details>
|
|
205
|
+
<summary>Default</summary>
|
|
206
|
+
|
|
125
207
|
- [Faker::Address](doc/default/address.md)
|
|
126
208
|
- [Faker::Alphanumeric](doc/default/alphanumeric.md)
|
|
127
209
|
- [Faker::Ancient](doc/default/ancient.md)
|
|
@@ -130,10 +212,13 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
130
212
|
- [Faker::Artist](doc/default/artist.md)
|
|
131
213
|
- [Faker::Avatar](doc/default/avatar.md)
|
|
132
214
|
- [Faker::Bank](doc/default/bank.md)
|
|
215
|
+
- [Faker::Barcode](doc/default/barcode.md)
|
|
133
216
|
- [Faker::Beer](doc/default/beer.md)
|
|
217
|
+
- [Faker::Blood](doc/default/blood.md)
|
|
134
218
|
- [Faker::Boolean](doc/default/boolean.md)
|
|
135
219
|
- [Faker::BossaNova](doc/default/bossa_nova.md)
|
|
136
220
|
- [Faker::Business](doc/default/business.md)
|
|
221
|
+
- [Faker::Camera](doc/default/camera.md)
|
|
137
222
|
- [Faker::Cannabis](doc/default/cannabis.md)
|
|
138
223
|
- [Faker::ChileRut](doc/default/chile_rut.md)
|
|
139
224
|
- [Faker::ChuckNorris](doc/default/chuck_norris.md)
|
|
@@ -144,6 +229,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
144
229
|
- [Faker::Commerce](doc/default/commerce.md)
|
|
145
230
|
- [Faker::Company](doc/default/company.md)
|
|
146
231
|
- [Faker::Compass](doc/default/compass.md)
|
|
232
|
+
- [Faker::Computer](doc/default/computer.md)
|
|
147
233
|
- [Faker::Construction](doc/default/construction.md)
|
|
148
234
|
- [Faker::Cosmere](doc/default/cosmere.md)
|
|
149
235
|
- [Faker::Crypto](doc/default/crypto.md)
|
|
@@ -155,11 +241,12 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
155
241
|
- [Faker::Dessert](doc/default/dessert.md)
|
|
156
242
|
- [Faker::Device](doc/default/device.md)
|
|
157
243
|
- [Faker::DrivingLicence](doc/default/driving_licence.md)
|
|
244
|
+
- [Faker::Drone](doc/drone/drone.md)
|
|
158
245
|
- [Faker::Educator](doc/default/educator.md)
|
|
159
246
|
- [Faker::ElectricalComponents](doc/default/electrical_components.md)
|
|
247
|
+
- [Faker::Emotion](doc/default/emotion.md)
|
|
160
248
|
- [Faker::Esport](doc/default/esport.md)
|
|
161
249
|
- [Faker::File](doc/default/file.md)
|
|
162
|
-
- [Faker::Fillmurray](doc/default/fillmurray.md)
|
|
163
250
|
- [Faker::Finance](doc/default/finance.md)
|
|
164
251
|
- [Faker::Food](doc/default/food.md)
|
|
165
252
|
- [Faker::FunnyName](doc/default/funny_name.md)
|
|
@@ -167,8 +254,9 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
167
254
|
- [Faker::GreekPhilosophers](doc/default/greek_philosophers.md)
|
|
168
255
|
- [Faker::Hacker](doc/default/hacker.md)
|
|
169
256
|
- [Faker::Hipster](doc/default/hipster.md)
|
|
257
|
+
- [Faker::Hobby](doc/default/hobby.md)
|
|
170
258
|
- [Faker::House](doc/default/house.md)
|
|
171
|
-
- [Faker::
|
|
259
|
+
- [Faker::IdNumber](doc/default/id_number.md)
|
|
172
260
|
- [Faker::IndustrySegments](doc/default/industry_segments.md)
|
|
173
261
|
- [Faker::Internet](doc/default/internet.md)
|
|
174
262
|
- [Faker::Invoice](doc/default/invoice.md)
|
|
@@ -177,11 +265,11 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
177
265
|
- [Faker::Kpop](doc/default/kpop.md)
|
|
178
266
|
- [Faker::Lorem](doc/default/lorem.md)
|
|
179
267
|
- [Faker::LoremFlickr](doc/default/lorem_flickr.md)
|
|
180
|
-
- [Faker::LoremPixel](doc/default/lorem_pixel.md)
|
|
181
268
|
- [Faker::Markdown](doc/default/markdown.md)
|
|
182
269
|
- [Faker::Marketing](doc/default/marketing.md)
|
|
183
270
|
- [Faker::Measurement](doc/default/measurement.md)
|
|
184
271
|
- [Faker::Military](doc/default/military.md)
|
|
272
|
+
- [Faker::Mountain](doc/default/mountain.md)
|
|
185
273
|
- [Faker::Name](doc/default/name.md)
|
|
186
274
|
- [Faker::Nation](doc/default/nation.md)
|
|
187
275
|
- [Faker::NatoPhoneticAlphabet](doc/default/nato_phonetic_alphabet.md)
|
|
@@ -202,97 +290,175 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
202
290
|
- [Faker::Stripe](doc/default/stripe.md)
|
|
203
291
|
- [Faker::Subscription](doc/default/subscription.md)
|
|
204
292
|
- [Faker::Superhero](doc/default/superhero.md)
|
|
293
|
+
- [Faker::Tea](doc/default/tea.md)
|
|
205
294
|
- [Faker::Team](doc/default/team.md)
|
|
295
|
+
- [Faker::Theater](doc/default/theater.md)
|
|
206
296
|
- [Faker::Time](doc/default/time.md)
|
|
207
297
|
- [Faker::Twitter](doc/default/twitter.md)
|
|
208
298
|
- [Faker::Types](doc/default/types.md)
|
|
209
299
|
- [Faker::University](doc/default/university.md)
|
|
210
300
|
- [Faker::Vehicle](doc/default/vehicle.md)
|
|
211
301
|
- [Faker::Verbs](doc/default/verbs.md)
|
|
302
|
+
- [Faker::VulnerabilityIdentifier](doc/default/vulnerability_identifier.md)
|
|
212
303
|
- [Faker::WorldCup](doc/default/world_cup.md)
|
|
304
|
+
</details>
|
|
305
|
+
|
|
306
|
+
<details>
|
|
307
|
+
<summary>Blockchain</summary>
|
|
213
308
|
|
|
214
|
-
### Blockchain
|
|
215
309
|
- [Faker::Blockchain::Aeternity](doc/blockchain/aeternity.md)
|
|
216
310
|
- [Faker::Blockchain::Bitcoin](doc/blockchain/bitcoin.md)
|
|
217
311
|
- [Faker::Blockchain::Ethereum](doc/blockchain/ethereum.md)
|
|
218
312
|
- [Faker::Blockchain::Tezos](doc/blockchain/tezos.md)
|
|
313
|
+
</details>
|
|
314
|
+
|
|
315
|
+
<details>
|
|
316
|
+
<summary>Books</summary>
|
|
219
317
|
|
|
220
|
-
### Books
|
|
221
318
|
- [Faker::Book](doc/books/book.md)
|
|
222
319
|
- [Faker::Books::CultureSeries](doc/books/culture_series.md)
|
|
223
320
|
- [Faker::Books::Dune](doc/books/dune.md)
|
|
224
321
|
- [Faker::Books::Lovecraft](doc/books/lovecraft.md)
|
|
322
|
+
- [Faker::Books::TheKingkillerChronicle](doc/books/the_kingkiller_chronicle.md)
|
|
323
|
+
</details>
|
|
324
|
+
|
|
325
|
+
<details>
|
|
326
|
+
<summary>Fantasy</summary>
|
|
327
|
+
|
|
328
|
+
- [Faker::Fantasy::Tolkien](doc/fantasy/tolkien.md)
|
|
329
|
+
</details>
|
|
330
|
+
|
|
331
|
+
<details>
|
|
332
|
+
<summary>Travel</summary>
|
|
333
|
+
|
|
334
|
+
- [Faker:Travel::Airport](doc/travel/airport.md)
|
|
335
|
+
- [Faker:Travel::TrainStation](doc/travel/train_station.md)
|
|
336
|
+
</details>
|
|
337
|
+
|
|
338
|
+
<details>
|
|
339
|
+
<summary>Creature</summary>
|
|
225
340
|
|
|
226
|
-
### Creature
|
|
227
341
|
- [Faker::Creature::Animal](doc/creature/animal.md)
|
|
342
|
+
- [Faker::Creature::Bird](doc/creature/bird.md)
|
|
228
343
|
- [Faker::Creature::Cat](doc/creature/cat.md)
|
|
229
344
|
- [Faker::Creature::Dog](doc/creature/dog.md)
|
|
230
345
|
- [Faker::Creature::Horse](doc/creature/horse.md)
|
|
346
|
+
</details>
|
|
347
|
+
|
|
348
|
+
<details>
|
|
349
|
+
<summary>Games</summary>
|
|
231
350
|
|
|
232
|
-
### Games
|
|
233
351
|
- [Faker::Game](doc/games/game.md)
|
|
352
|
+
- [Faker::Games::ClashOfClans](doc/games/clash_of_clans.md)
|
|
353
|
+
- [Faker::Games::DnD](doc/games/dnd.md)
|
|
234
354
|
- [Faker::Games::Dota](doc/games/dota.md)
|
|
235
355
|
- [Faker::Games::ElderScrolls](doc/games/elder_scrolls.md)
|
|
236
356
|
- [Faker::Games::Fallout](doc/games/fallout.md)
|
|
357
|
+
- [Faker::Games::FinalFantasyXIV](doc/games/final_fantasy_xiv.md)
|
|
237
358
|
- [Faker::Games::HalfLife](doc/games/half_life.md)
|
|
238
359
|
- [Faker::Games::Heroes](doc/games/heroes.md)
|
|
239
360
|
- [Faker::Games::HeroesOfTheStorm](doc/games/heroes_of_the_storm.md)
|
|
240
361
|
- [Faker::Games::LeagueOfLegends](doc/games/league_of_legends.md)
|
|
362
|
+
- [Faker::Games::Minecraft](doc/games/minecraft.md)
|
|
241
363
|
- [Faker::Games::Myst](doc/games/myst.md)
|
|
242
364
|
- [Faker::Games::Overwatch](doc/games/overwatch.md)
|
|
243
365
|
- [Faker::Games::Pokemon](doc/games/pokemon.md)
|
|
244
366
|
- [Faker::Games::SonicTheHedgehog](doc/games/sonic_the_hedgehog.md)
|
|
367
|
+
- [Faker::Games::StreetFighter](doc/games/street_fighter.md)
|
|
368
|
+
- [Faker::Games::SuperMario](doc/games/super_mario.md)
|
|
245
369
|
- [Faker::Games::SuperSmashBros](doc/games/super_smash_bros.md)
|
|
370
|
+
- [Faker::Games::Touhou](doc/games/touhou.md)
|
|
371
|
+
- [Faker::Games::WarhammerFantasy](doc/games/warhammer_fantasy.md)
|
|
246
372
|
- [Faker::Games::Witcher](doc/games/witcher.md)
|
|
247
373
|
- [Faker::Games::WorldOfWarcraft](doc/games/world_of_warcraft.md)
|
|
248
374
|
- [Faker::Games::Zelda](doc/games/zelda.md)
|
|
375
|
+
</details>
|
|
249
376
|
|
|
250
|
-
|
|
377
|
+
<details>
|
|
378
|
+
<summary>Japanese Media</summary>
|
|
379
|
+
|
|
380
|
+
- [Faker::JapaneseMedia::CowboyBebop](doc/japanese_media/cowboy_bebop.md)
|
|
251
381
|
- [Faker::JapaneseMedia::DragonBall](doc/japanese_media/dragon_ball.md)
|
|
252
382
|
- [Faker::JapaneseMedia::OnePiece](doc/japanese_media/one_piece.md)
|
|
383
|
+
- [Faker::JapaneseMedia::StudioGhibli](doc/japanese_media/studio_ghibli.md)
|
|
253
384
|
- [Faker::JapaneseMedia::SwordArtOnline](doc/japanese_media/sword_art_online.md)
|
|
385
|
+
- [Faker::JapaneseMedia::Naruto](doc/japanese_media/naruto.md)
|
|
386
|
+
- [Faker::JapaneseMedia::Doraemon](doc/japanese_media/doraemon.md)
|
|
387
|
+
- [Faker::JapaneseMedia::Conan](doc/japanese_media/conan.md)
|
|
388
|
+
- [Faker::JapaneseMedia::FullmetalAlchemistBrotherhood](doc/japanese_media/fullmetal_alchemist_brotherhood.md)
|
|
389
|
+
</details>
|
|
390
|
+
|
|
391
|
+
<details>
|
|
392
|
+
<summary>Movies</summary>
|
|
254
393
|
|
|
255
|
-
### Movies
|
|
256
394
|
- [Faker::Movie](doc/movies/movie.md)
|
|
395
|
+
- [Faker::Movies::Avatar](doc/movies/avatar.md)
|
|
257
396
|
- [Faker::Movies::BackToTheFuture](doc/movies/back_to_the_future.md)
|
|
397
|
+
- [Faker::Movies::Departed](doc/movies/departed.md)
|
|
258
398
|
- [Faker::Movies::Ghostbusters](doc/movies/ghostbusters.md)
|
|
259
399
|
- [Faker::Movies::HarryPotter](doc/movies/harry_potter.md)
|
|
260
400
|
- [Faker::Movies::HitchhikersGuideToTheGalaxy](doc/movies/hitchhikers_guide_to_the_galaxy.md)
|
|
261
401
|
- [Faker::Movies::Hobbit](doc/movies/hobbit.md)
|
|
402
|
+
- [Faker::Movies::HowToTrainYourDragon](doc/movies/how_to_train_your_dragon.md)
|
|
262
403
|
- [Faker::Movies::Lebowski](doc/movies/lebowski.md)
|
|
263
404
|
- [Faker::Movies::LordOfTheRings](doc/movies/lord_of_the_rings.md)
|
|
264
405
|
- [Faker::Movies::PrincessBride](doc/movies/princess_bride.md)
|
|
265
406
|
- [Faker::Movies::StarWars](doc/movies/star_wars.md)
|
|
407
|
+
- [Faker::Movies::TRON](doc/movies/tron.md)
|
|
266
408
|
- [Faker::Movies::VForVendetta](doc/movies/v_for_vendetta.md)
|
|
409
|
+
</details>
|
|
410
|
+
|
|
411
|
+
<details>
|
|
412
|
+
<summary>Music</summary>
|
|
267
413
|
|
|
268
|
-
### Music
|
|
269
414
|
- [Faker::Music](doc/music/music.md)
|
|
270
415
|
- [Faker::Music::GratefulDead](doc/music/grateful_dead.md)
|
|
416
|
+
- [Faker::Music::Hiphop](doc/music/hiphop.md)
|
|
271
417
|
- [Faker::Music::Opera](doc/music/opera.md)
|
|
418
|
+
- [Faker::Music::PearlJam](doc/music/pearl_jam.md)
|
|
272
419
|
- [Faker::Music::Phish](doc/music/phish.md)
|
|
420
|
+
- [Faker::Music::Prince](doc/music/prince.md)
|
|
273
421
|
- [Faker::Music::RockBand](doc/music/rock_band.md)
|
|
422
|
+
- [Faker::Music::Rush](doc/music/rush.md)
|
|
423
|
+
- [Faker::Music::SmashingPumpkins](doc/music/smashing_pumpkins.md)
|
|
274
424
|
- [Faker::Music::UmphreysMcgee](doc/music/umphreys_mcgee.md)
|
|
425
|
+
</details>
|
|
426
|
+
|
|
427
|
+
<details>
|
|
428
|
+
<summary>Quotes</summary>
|
|
275
429
|
|
|
276
|
-
### Quotes
|
|
277
430
|
- [Faker::Quote](doc/quotes/quote.md)
|
|
278
431
|
- [Faker::Quotes::Chiquito](doc/quotes/chiquito.md)
|
|
279
432
|
- [Faker::Quotes::Rajnikanth](doc/quotes/rajnikanth.md)
|
|
280
433
|
- [Faker::Quotes::Shakespeare](doc/quotes/shakespeare.md)
|
|
434
|
+
</details>
|
|
281
435
|
|
|
436
|
+
<details>
|
|
437
|
+
<summary>Sports</summary>
|
|
282
438
|
|
|
283
|
-
|
|
439
|
+
- [Faker::Sport](doc/sports/sport.md)
|
|
284
440
|
- [Faker::Sports::Basketball](doc/sports/basketball.md)
|
|
441
|
+
- [Faker::Sports::Chess](doc/sports/chess.md)
|
|
285
442
|
- [Faker::Sports::Football](doc/sports/football.md)
|
|
443
|
+
- [Faker::Sports::Mountaineering](doc/sports/mountaineering.md)
|
|
444
|
+
- [Faker::Sports::Volleyball](doc/sports/volleyball.md)
|
|
445
|
+
</details>
|
|
446
|
+
|
|
447
|
+
<details>
|
|
448
|
+
<summary>Tv Shows</summary>
|
|
286
449
|
|
|
287
|
-
### Tv Shows
|
|
288
450
|
- [Faker::TvShows::AquaTeenHungerForce](doc/tv_shows/aqua_teen_hunger_force.md)
|
|
451
|
+
- [Faker::TvShows::Archer](doc/tv_shows/archer.md)
|
|
452
|
+
- [Faker::TvShows::BigBangTheory](doc/tv_shows/big_bang_theory.md)
|
|
289
453
|
- [Faker::TvShows::BojackHorseman](doc/tv_shows/bojack_horseman.md)
|
|
290
454
|
- [Faker::TvShows::BreakingBad](doc/tv_shows/breaking_bad.md)
|
|
455
|
+
- [Faker::TvShows::BrooklynNineNine](doc/tv_shows/brooklyn_nine_nine.md)
|
|
291
456
|
- [Faker::TvShows::Buffy](doc/tv_shows/buffy.md)
|
|
292
457
|
- [Faker::TvShows::Community](doc/tv_shows/community.md)
|
|
293
458
|
- [Faker::TvShows::DrWho](doc/tv_shows/dr_who.md)
|
|
294
459
|
- [Faker::TvShows::DumbAndDumber](doc/tv_shows/dumb_and_dumber.md)
|
|
295
460
|
- [Faker::TvShows::FamilyGuy](doc/tv_shows/family_guy.md)
|
|
461
|
+
- [Faker::TvShows::FinalSpace](doc/tv_shows/final_space.md)
|
|
296
462
|
- [Faker::TvShows::Friends](doc/tv_shows/friends.md)
|
|
297
463
|
- [Faker::TvShows::GameOfThrones](doc/tv_shows/game_of_thrones.md)
|
|
298
464
|
- [Faker::TvShows::HeyArnold](doc/tv_shows/hey_arnold.md)
|
|
@@ -306,65 +472,43 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
|
306
472
|
- [Faker::TvShows::SiliconValley](doc/tv_shows/silicon_valley.md)
|
|
307
473
|
- [Faker::TvShows::Simpsons](doc/tv_shows/simpsons.md)
|
|
308
474
|
- [Faker::TvShows::SouthPark](doc/tv_shows/south_park.md)
|
|
475
|
+
- [Faker::TvShows::Spongebob](doc/tv_shows/spongebob.md)
|
|
309
476
|
- [Faker::TvShows::StarTrek](doc/tv_shows/star_trek.md)
|
|
310
477
|
- [Faker::TvShows::Stargate](doc/tv_shows/stargate.md)
|
|
311
478
|
- [Faker::TvShows::StrangerThings](doc/tv_shows/stranger_things.md)
|
|
479
|
+
- [Faker::TvShows::Suits](doc/tv_shows/suits.md)
|
|
480
|
+
- [Faker::TvShows::Supernatural](doc/tv_shows/supernatural.md)
|
|
312
481
|
- [Faker::TvShows::TheExpanse](doc/tv_shows/the_expanse.md)
|
|
313
482
|
- [Faker::TvShows::TheFreshPrinceOfBelAir](doc/tv_shows/the_fresh_prince_of_bel_air.md)
|
|
314
483
|
- [Faker::TvShows::TheITCrowd](doc/tv_shows/the_it_crowd.md)
|
|
315
484
|
- [Faker::TvShows::TheThickOfIt](doc/tv_shows/the_thick_of_it.md)
|
|
316
485
|
- [Faker::TvShows::TwinPeaks](doc/tv_shows/twin_peaks.md)
|
|
317
486
|
- [Faker::TvShows::VentureBros](doc/tv_shows/venture_bros.md)
|
|
487
|
+
</details>
|
|
318
488
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
-
```
|
|
489
|
+
<details>
|
|
490
|
+
<summary>Locations</summary>
|
|
491
|
+
|
|
492
|
+
- [Faker::Locations::Australia](doc/locations/australia.md)
|
|
493
|
+
</details>
|
|
360
494
|
|
|
361
495
|
## Contributing
|
|
362
|
-
See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/master/CONTRIBUTING.md).
|
|
363
496
|
|
|
364
|
-
|
|
365
|
-
|
|
497
|
+
**Note**: We are not accepting proposals for new generators and locales. The [Contributing](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md) guide has a few notes about this decision.
|
|
498
|
+
|
|
499
|
+
Take a look at the [Contributing](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md) document for
|
|
500
|
+
instructions on setting up the repo on your machine, opening bug reports, understanding the codebase,
|
|
501
|
+
and creating a good pull request.
|
|
366
502
|
|
|
367
|
-
|
|
503
|
+
There is a [Discord channel](https://discord.gg/RMumTwB) to discuss anything
|
|
504
|
+
regarding improvements or feature requests.
|
|
505
|
+
|
|
506
|
+
Thank you, contributors!
|
|
507
|
+
|
|
508
|
+
## Versioning
|
|
509
|
+
|
|
510
|
+
Faker follows Semantic Versioning 2.0 as defined at https://semver.org.
|
|
368
511
|
|
|
369
512
|
## License
|
|
513
|
+
|
|
370
514
|
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
|