faker 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +181 -0
- data/License.txt +2 -2
- data/README.md +252 -162
- data/lib/faker.rb +36 -17
- data/lib/faker/blockchain/bitcoin.rb +34 -0
- data/lib/faker/blockchain/ethereum.rb +16 -0
- data/lib/faker/blockchain/tezos.rb +46 -0
- data/lib/faker/{book.rb → books/book.rb} +2 -0
- data/lib/faker/books/culture_series.rb +34 -0
- data/lib/faker/books/dune.rb +58 -0
- data/lib/faker/books/lovecraft.rb +73 -0
- data/lib/faker/creature/animal.rb +13 -0
- data/lib/faker/creature/cat.rb +23 -0
- data/lib/faker/creature/dog.rb +43 -0
- data/lib/faker/{address.rb → default/address.rb} +10 -0
- data/lib/faker/default/alphanumeric.rb +24 -0
- data/lib/faker/{ancient.rb → default/ancient.rb} +2 -0
- data/lib/faker/{app.rb → default/app.rb} +2 -0
- data/lib/faker/{appliance.rb → default/appliance.rb} +2 -0
- data/lib/faker/{artist.rb → default/artist.rb} +2 -0
- data/lib/faker/{avatar.rb → default/avatar.rb} +3 -0
- data/lib/faker/{bank.rb → default/bank.rb} +8 -2
- data/lib/faker/{beer.rb → default/beer.rb} +2 -0
- data/lib/faker/{boolean.rb → default/boolean.rb} +2 -0
- data/lib/faker/{bossa_nova.rb → default/bossa_nova.rb} +2 -0
- data/lib/faker/{business.rb → default/business.rb} +2 -0
- data/lib/faker/{cannabis.rb → default/cannabis.rb} +0 -1
- data/lib/faker/default/chile_rut.rb +44 -0
- data/lib/faker/{chuck_norris.rb → default/chuck_norris.rb} +2 -0
- data/lib/faker/{code.rb → default/code.rb} +3 -1
- data/lib/faker/{coffee.rb → default/coffee.rb} +2 -0
- data/lib/faker/default/coin.rb +15 -0
- data/lib/faker/{color.rb → default/color.rb} +2 -0
- data/lib/faker/{commerce.rb → default/commerce.rb} +3 -0
- data/lib/faker/{company.rb → default/company.rb} +35 -1
- data/lib/faker/{compass.rb → default/compass.rb} +2 -0
- data/lib/faker/default/construction.rb +29 -0
- data/lib/faker/default/cosmere.rb +48 -0
- data/lib/faker/default/creature.rb +6 -0
- data/lib/faker/{crypto.rb → default/crypto.rb} +2 -0
- data/lib/faker/default/crypto_coin.rb +32 -0
- data/lib/faker/{currency.rb → default/currency.rb} +2 -0
- data/lib/faker/{date.rb → default/date.rb} +3 -0
- data/lib/faker/default/dc_comics.rb +25 -0
- data/lib/faker/{demographic.rb → default/demographic.rb} +2 -0
- data/lib/faker/{dessert.rb → default/dessert.rb} +2 -0
- data/lib/faker/{device.rb → default/device.rb} +2 -0
- data/lib/faker/default/driving_licence.rb +59 -0
- data/lib/faker/default/educator.rb +38 -0
- data/lib/faker/{electrical_components.rb → default/electrical_components.rb} +2 -0
- data/lib/faker/{esport.rb → default/esport.rb} +2 -0
- data/lib/faker/{file.rb → default/file.rb} +2 -0
- data/lib/faker/{fillmurray.rb → default/fillmurray.rb} +2 -0
- data/lib/faker/{finance.rb → default/finance.rb} +13 -0
- data/lib/faker/{food.rb → default/food.rb} +4 -0
- data/lib/faker/{football.rb → default/football.rb} +6 -0
- data/lib/faker/{funny_name.rb → default/funny_name.rb} +3 -1
- data/lib/faker/default/games.rb +6 -0
- data/lib/faker/{gender.rb → default/gender.rb} +2 -0
- data/lib/faker/{greek_philosophers.rb → default/greek_philosophers.rb} +2 -0
- data/lib/faker/{hacker.rb → default/hacker.rb} +2 -0
- data/lib/faker/{hipster.rb → default/hipster.rb} +3 -12
- data/lib/faker/default/house.rb +15 -0
- data/lib/faker/default/id_number.rb +119 -0
- data/lib/faker/default/industry_segments.rb +25 -0
- data/lib/faker/{internet.rb → default/internet.rb} +10 -6
- data/lib/faker/{invoice.rb → default/invoice.rb} +3 -1
- data/lib/faker/default/japanese_media.rb +6 -0
- data/lib/faker/{job.rb → default/job.rb} +2 -0
- data/lib/faker/default/json.rb +70 -0
- data/lib/faker/{kpop.rb → default/kpop.rb} +2 -0
- data/lib/faker/{lorem.rb → default/lorem.rb} +5 -17
- data/lib/faker/{lorem_flickr.rb → default/lorem_flickr.rb} +2 -0
- data/lib/faker/{lorem_pixel.rb → default/lorem_pixel.rb} +2 -0
- data/lib/faker/{markdown.rb → default/markdown.rb} +6 -2
- data/lib/faker/default/marketing.rb +13 -0
- data/lib/faker/{measurement.rb → default/measurement.rb} +4 -2
- data/lib/faker/{military.rb → default/military.rb} +2 -0
- data/lib/faker/default/movies.rb +6 -0
- data/lib/faker/{name.rb → default/name.rb} +7 -11
- data/lib/faker/{nation.rb → default/nation.rb} +9 -0
- data/lib/faker/{nato_phonetic_alphabet.rb → default/nato_phonetic_alphabet.rb} +2 -0
- data/lib/faker/default/nhs.rb +34 -0
- data/lib/faker/{number.rb → default/number.rb} +13 -2
- data/lib/faker/{omniauth.rb → default/omniauth.rb} +2 -0
- data/lib/faker/{phone_number.rb → default/phone_number.rb} +14 -0
- data/lib/faker/{placeholdit.rb → default/placeholdit.rb} +4 -2
- data/lib/faker/{programming_language.rb → default/programming_language.rb} +2 -0
- data/lib/faker/default/relationship.rb +42 -0
- data/lib/faker/default/restaurant.rb +11 -0
- data/lib/faker/{science.rb → default/science.rb} +2 -0
- data/lib/faker/{slack_emoji.rb → default/slack_emoji.rb} +2 -0
- data/lib/faker/{source.rb → default/source.rb} +2 -0
- data/lib/faker/default/south_africa.rb +51 -0
- data/lib/faker/{space.rb → default/space.rb} +2 -0
- data/lib/faker/{string.rb → default/string.rb} +0 -0
- data/lib/faker/{stripe.rb → default/stripe.rb} +2 -0
- data/lib/faker/default/subscription.rb +25 -0
- data/lib/faker/{superhero.rb → default/superhero.rb} +2 -0
- data/lib/faker/{team.rb → default/team.rb} +2 -0
- data/lib/faker/{time.rb → default/time.rb} +3 -0
- data/lib/faker/default/tv_shows.rb +6 -0
- data/lib/faker/{twitter.rb → default/twitter.rb} +2 -0
- data/lib/faker/{types.rb → default/types.rb} +5 -15
- data/lib/faker/{university.rb → default/university.rb} +2 -0
- data/lib/faker/default/vehicle.rb +149 -0
- data/lib/faker/{verb.rb → default/verb.rb} +2 -0
- data/lib/faker/{world_cup.rb → default/world_cup.rb} +2 -0
- data/lib/faker/deprecate/aqua_teen_hunger_force.rb +15 -0
- data/lib/faker/deprecate/back_to_the_future.rb +25 -0
- data/lib/faker/deprecate/bitcoin.rb +20 -0
- data/lib/faker/deprecate/bojack_horseman.rb +25 -0
- data/lib/faker/deprecate/breaking_bad.rb +20 -0
- data/lib/faker/deprecate/buffy.rb +35 -0
- data/lib/faker/deprecate/cat.rb +25 -0
- data/lib/faker/deprecate/community.rb +20 -0
- data/lib/faker/deprecate/dog.rb +50 -0
- data/lib/faker/deprecate/dota.rb +35 -0
- data/lib/faker/deprecate/dr_who.rb +45 -0
- data/lib/faker/deprecate/dragon_ball.rb +15 -0
- data/lib/faker/deprecate/dumb_and_dumber.rb +25 -0
- data/lib/faker/deprecate/dune.rb +35 -0
- data/lib/faker/deprecate/elder_scrolls.rb +50 -0
- data/lib/faker/deprecate/ethereum.rb +15 -0
- data/lib/faker/deprecate/fallout.rb +30 -0
- data/lib/faker/deprecate/family_guy.rb +25 -0
- data/lib/faker/deprecate/famous_last_words.rb +15 -0
- data/lib/faker/deprecate/friends.rb +25 -0
- data/lib/faker/deprecate/game_of_thrones.rb +35 -0
- data/lib/faker/deprecate/harry_potter.rb +40 -0
- data/lib/faker/deprecate/heroes_of_the_storm.rb +30 -0
- data/lib/faker/deprecate/hey_arnold.rb +25 -0
- data/lib/faker/deprecate/hitchhikers_guide_to_the_galaxy.rb +44 -0
- data/lib/faker/deprecate/hobbit.rb +30 -0
- data/lib/faker/deprecate/how_i_met_your_mother.rb +30 -0
- data/lib/faker/deprecate/league_of_legends.rb +40 -0
- data/lib/faker/deprecate/lebowski.rb +25 -0
- data/lib/faker/deprecate/lord_of_the_rings.rb +25 -0
- data/lib/faker/deprecate/lovecraft.rb +65 -0
- data/lib/faker/deprecate/matz.rb +15 -0
- data/lib/faker/deprecate/michael_scott.rb +15 -0
- data/lib/faker/deprecate/most_interesting_man_in_the_world.rb +15 -0
- data/lib/faker/deprecate/myst.rb +35 -0
- data/lib/faker/deprecate/new_girl.rb +20 -0
- data/lib/faker/deprecate/one_piece.rb +40 -0
- data/lib/faker/deprecate/overwatch.rb +25 -0
- data/lib/faker/deprecate/parks_and_rec.rb +20 -0
- data/lib/faker/deprecate/pokemon.rb +25 -0
- data/lib/faker/deprecate/princess_bride.rb +20 -0
- data/lib/faker/deprecate/rick_and_morty.rb +25 -0
- data/lib/faker/deprecate/robin.rb +15 -0
- data/lib/faker/deprecate/rock_band.rb +15 -0
- data/lib/faker/deprecate/ru_paul.rb +20 -0
- data/lib/faker/deprecate/seinfeld.rb +25 -0
- data/lib/faker/deprecate/shakespeare.rb +50 -0
- data/lib/faker/deprecate/silicon_valley.rb +50 -0
- data/lib/faker/deprecate/simpsons.rb +25 -0
- data/lib/faker/deprecate/singular_siegler.rb +15 -0
- data/lib/faker/deprecate/south_park.rb +20 -0
- data/lib/faker/deprecate/star_trek.rb +30 -0
- data/lib/faker/deprecate/star_wars.rb +95 -0
- data/lib/faker/deprecate/stargate.rb +25 -0
- data/lib/faker/deprecate/stranger_things.rb +20 -0
- data/lib/faker/deprecate/sword_art_online.rb +30 -0
- data/lib/faker/deprecate/tezos.rb +33 -0
- data/lib/faker/deprecate/the_fresh_prince_of_bel_air.rb +25 -0
- data/lib/faker/deprecate/the_it_crowd.rb +30 -0
- data/lib/faker/deprecate/the_thick_of_it.rb +25 -0
- data/lib/faker/deprecate/twin_peaks.rb +25 -0
- data/lib/faker/deprecate/umphreys_mcgee.rb +15 -0
- data/lib/faker/deprecate/v_for_vendetta.rb +25 -0
- data/lib/faker/deprecate/venture_bros.rb +30 -0
- data/lib/faker/deprecate/witcher.rb +40 -0
- data/lib/faker/deprecate/world_of_warcraft.rb +20 -0
- data/lib/faker/deprecate/yoda.rb +16 -0
- data/lib/faker/deprecate/zelda.rb +30 -0
- data/lib/faker/games/dota.rb +29 -0
- data/lib/faker/games/elder_scrolls.rb +41 -0
- data/lib/faker/games/fallout.rb +25 -0
- data/lib/faker/games/half_life.rb +21 -0
- data/lib/faker/games/heroes.rb +21 -0
- data/lib/faker/games/heroes_of_the_storm.rb +25 -0
- data/lib/faker/games/league_of_legends.rb +33 -0
- data/lib/faker/games/myst.rb +29 -0
- data/lib/faker/games/overwatch.rb +21 -0
- data/lib/faker/games/pokemon.rb +21 -0
- data/lib/faker/games/sonic_the_hedgehog.rb +21 -0
- data/lib/faker/games/super_smash_bros.rb +17 -0
- data/lib/faker/games/witcher.rb +33 -0
- data/lib/faker/games/world_of_warcraft.rb +17 -0
- data/lib/faker/games/zelda.rb +26 -0
- data/lib/faker/japanese_media/dragon_ball.rb +13 -0
- data/lib/faker/japanese_media/one_piece.rb +33 -0
- data/lib/faker/japanese_media/sword_art_online.rb +25 -0
- data/lib/faker/movies/back_to_the_future.rb +21 -0
- data/lib/faker/movies/ghostbusters.rb +21 -0
- data/lib/faker/movies/grateful_dead.rb +17 -0
- data/lib/faker/movies/harry_potter.rb +33 -0
- data/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb +37 -0
- data/lib/faker/movies/hobbit.rb +25 -0
- data/lib/faker/movies/lebowski.rb +21 -0
- data/lib/faker/movies/lord_of_the_rings.rb +21 -0
- data/lib/faker/{movie.rb → movies/movie.rb} +2 -0
- data/lib/faker/movies/princess_bride.rb +17 -0
- data/lib/faker/movies/star_wars.rb +105 -0
- data/lib/faker/movies/v_for_vendetta.rb +21 -0
- data/lib/faker/{music.rb → music/music.rb} +2 -0
- data/lib/faker/music/phish.rb +13 -0
- data/lib/faker/music/rock_band.rb +13 -0
- data/lib/faker/music/umphreys_mcgee.rb +13 -0
- data/lib/faker/quotes/quote.rb +32 -0
- data/lib/faker/quotes/shakespeare.rb +41 -0
- data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +15 -0
- data/lib/faker/tv_shows/bojack_horseman.rb +23 -0
- data/lib/faker/tv_shows/breaking_bad.rb +19 -0
- data/lib/faker/tv_shows/buffy.rb +31 -0
- data/lib/faker/tv_shows/community.rb +19 -0
- data/lib/faker/tv_shows/dr_who.rb +39 -0
- data/lib/faker/tv_shows/dumb_and_dumber.rb +23 -0
- data/lib/faker/tv_shows/family_guy.rb +23 -0
- data/lib/faker/tv_shows/friends.rb +23 -0
- data/lib/faker/tv_shows/game_of_thrones.rb +31 -0
- data/lib/faker/tv_shows/hey_arnold.rb +23 -0
- data/lib/faker/tv_shows/how_i_met_your_mother.rb +27 -0
- data/lib/faker/tv_shows/michael_scott.rb +13 -0
- data/lib/faker/tv_shows/new_girl.rb +19 -0
- data/lib/faker/tv_shows/parks_and_rec.rb +19 -0
- data/lib/faker/tv_shows/rick_and_morty.rb +23 -0
- data/lib/faker/tv_shows/ru_paul.rb +19 -0
- data/lib/faker/tv_shows/seinfeld.rb +23 -0
- data/lib/faker/tv_shows/silicon_valley.rb +43 -0
- data/lib/faker/tv_shows/simpsons.rb +23 -0
- data/lib/faker/tv_shows/south_park.rb +19 -0
- data/lib/faker/tv_shows/star_trek.rb +27 -0
- data/lib/faker/tv_shows/stargate.rb +23 -0
- data/lib/faker/tv_shows/stranger_things.rb +19 -0
- data/lib/faker/tv_shows/the_expanse.rb +27 -0
- data/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +23 -0
- data/lib/faker/tv_shows/the_it_crowd.rb +27 -0
- data/lib/faker/tv_shows/the_thick_of_it.rb +23 -0
- data/lib/faker/tv_shows/twin_peaks.rb +23 -0
- data/lib/faker/tv_shows/venture_bros.rb +27 -0
- data/lib/faker/version.rb +3 -1
- data/lib/helpers/base58.rb +22 -0
- data/lib/helpers/char.rb +2 -0
- data/lib/helpers/i18n_backend.rb +10 -0
- data/lib/helpers/unique_generator.rb +19 -1
- data/lib/locales/README.md +8 -9
- data/lib/locales/ar.yml +102 -0
- data/lib/locales/arm.yml +371 -0
- data/lib/locales/bg.yml +3 -0
- data/lib/locales/ca.yml +6 -0
- data/lib/locales/da-DK.yml +6 -3
- data/lib/locales/de-AT.yml +6 -0
- data/lib/locales/de.yml +10 -3
- data/lib/locales/ee.yml +3 -1
- data/lib/locales/en-AU.yml +2 -0
- data/lib/locales/en-IND.yml +2 -0
- data/lib/locales/en-MS.yml +6 -0
- data/lib/locales/en-NEP.yml +2 -2
- data/lib/locales/en-NG.yml +2 -0
- data/lib/locales/en-NZ.yml +2 -6
- data/lib/locales/en-PAK.yml +2 -1
- data/lib/locales/en-SG.yml +4 -0
- data/lib/locales/en-ZA.yml +114 -17
- data/lib/locales/en.yml +0 -1
- data/lib/locales/en/address.yml +496 -1
- data/lib/locales/en/animal.yml +6 -0
- data/lib/locales/en/beer.yml +2 -1
- data/lib/locales/en/bojack_horseman.yml +2 -2
- data/lib/locales/en/buffy.yml +260 -0
- data/lib/locales/en/cat.yml +5 -4
- data/lib/locales/en/coin.yml +6 -0
- data/lib/locales/en/company.yml +1 -1
- data/lib/locales/en/construction.yml +425 -0
- data/lib/locales/en/cosmere.yml +57 -0
- data/lib/locales/en/crypto_coin.yml +9 -0
- data/lib/locales/en/culture_series.yml +307 -0
- data/lib/locales/en/currency.yml +1 -1
- data/lib/locales/en/dc_comics.yml +52 -0
- data/lib/locales/en/device.yml +3 -3
- data/lib/locales/en/dog.yml +9 -9
- data/lib/locales/en/dota.yml +101 -100
- data/lib/locales/en/dragon_ball.yml +1 -1
- data/lib/locales/en/educator.yml +2 -1
- data/lib/locales/en/elder_scrolls.yml +9 -8
- data/lib/locales/en/esport.yml +5 -5
- data/lib/locales/en/fallout.yml +135 -134
- data/lib/locales/en/finance.yml +63 -0
- data/lib/locales/en/food.yml +3 -2
- data/lib/locales/en/football.yml +1 -0
- data/lib/locales/en/friends.yml +3 -3
- data/lib/locales/en/ghostbusters.yml +91 -0
- data/lib/locales/en/grateful_dead.yml +47 -0
- data/lib/locales/en/half_life.yml +7 -0
- data/lib/locales/en/heroes.yml +6 -0
- data/lib/locales/en/heroes_of_the_storm.yml +7 -0
- data/lib/locales/en/house.yml +5 -0
- data/lib/locales/en/industry_segments.yml +7 -0
- data/lib/locales/en/kpop.yml +2 -2
- data/lib/locales/en/league_of_legends.yml +8 -7
- data/lib/locales/en/lorem.yml +2 -0
- data/lib/locales/en/marketing.yml +4 -0
- data/lib/locales/en/music.yml +3 -3
- data/lib/locales/en/myst.yml +41 -40
- data/lib/locales/en/name.yml +6 -7
- data/lib/locales/en/nation.yml +3 -0
- data/lib/locales/en/overwatch.yml +39 -34
- data/lib/locales/en/phish.yml +4 -0
- data/lib/locales/en/phone_number.yml +1 -0
- data/lib/locales/en/pokemon.yml +5 -4
- data/lib/locales/en/quote.yml +166 -0
- data/lib/locales/en/relationship.yml +10 -0
- data/lib/locales/en/restaurant.yml +129 -0
- data/lib/locales/en/seinfeld.yml +2 -1
- data/lib/locales/en/sonic_the_hedgehog.yml +410 -0
- data/lib/locales/en/south_park.yml +5 -0
- data/lib/locales/en/star_wars.yml +3 -3
- data/lib/locales/en/subscription.yml +8 -0
- data/lib/locales/en/super_smash_bros.yml +197 -0
- data/lib/locales/en/the_expanse.yml +7 -0
- data/lib/locales/en/vehicle.yml +62 -58
- data/lib/locales/en/witcher.yml +8 -7
- data/lib/locales/en/world_of_warcraft.yml +5 -4
- data/lib/locales/en/zelda.yml +6 -5
- data/lib/locales/es-MX.yml +14 -1
- data/lib/locales/es.yml +13 -0
- data/lib/locales/fa.yml +4 -0
- data/lib/locales/fi-FI.yml +4 -3
- data/lib/locales/fr-CA.yml +18 -13
- data/lib/locales/fr-CH.yml +16 -10
- data/lib/locales/fr.yml +45 -1
- data/lib/locales/he.yml +2 -0
- data/lib/locales/id.yml +2 -0
- data/lib/locales/it.yml +12 -1
- data/lib/locales/ja.yml +45 -21
- data/lib/locales/ko.yml +2 -0
- data/lib/locales/lv.yml +2 -0
- data/lib/locales/nb-NO.yml +11 -4
- data/lib/locales/nl.yml +13 -4
- data/lib/locales/pl.yml +11 -1
- data/lib/locales/pt-BR.yml +578 -4
- data/lib/locales/pt.yml +10 -3
- data/lib/locales/ru.yml +3 -1
- data/lib/locales/sk.yml +19 -13
- data/lib/locales/sv.yml +11 -3
- data/lib/locales/tr.yml +6 -0
- data/lib/locales/uk.yml +2 -0
- data/lib/locales/vi.yml +6 -1
- data/lib/locales/zh-CN.yml +3 -0
- data/lib/locales/zh-TW.yml +3 -1
- metadata +271 -164
- data/lib/extensions/array.rb +0 -22
- data/lib/extensions/symbol.rb +0 -8
- data/lib/faker/aqua_teen_hunger_force.rb +0 -9
- data/lib/faker/back_to_the_future.rb +0 -17
- data/lib/faker/bitcoin.rb +0 -47
- data/lib/faker/bojack_horseman.rb +0 -17
- data/lib/faker/breaking_bad.rb +0 -13
- data/lib/faker/cat.rb +0 -19
- data/lib/faker/community.rb +0 -13
- data/lib/faker/dog.rb +0 -39
- data/lib/faker/dota.rb +0 -25
- data/lib/faker/dr_who.rb +0 -33
- data/lib/faker/dragon_ball.rb +0 -9
- data/lib/faker/dumb_and_dumber.rb +0 -17
- data/lib/faker/dune.rb +0 -54
- data/lib/faker/educator.rb +0 -23
- data/lib/faker/elder_scrolls.rb +0 -37
- data/lib/faker/ethereum.rb +0 -12
- data/lib/faker/fallout.rb +0 -21
- data/lib/faker/family_guy.rb +0 -17
- data/lib/faker/famous_last_words.rb +0 -11
- data/lib/faker/friends.rb +0 -17
- data/lib/faker/game_of_thrones.rb +0 -25
- data/lib/faker/harry_potter.rb +0 -29
- data/lib/faker/hey_arnold.rb +0 -17
- data/lib/faker/hitchhikers_guide_to_the_galaxy.rb +0 -33
- data/lib/faker/hobbit.rb +0 -21
- data/lib/faker/how_i_met_your_mother.rb +0 -21
- data/lib/faker/id_number.rb +0 -51
- data/lib/faker/league_of_legends.rb +0 -29
- data/lib/faker/lebowski.rb +0 -17
- data/lib/faker/lord_of_the_rings.rb +0 -17
- data/lib/faker/lovecraft.rb +0 -80
- data/lib/faker/matz.rb +0 -9
- data/lib/faker/michael_scott.rb +0 -9
- data/lib/faker/most_interesting_man_in_the_world.rb +0 -9
- data/lib/faker/myst.rb +0 -25
- data/lib/faker/new_girl.rb +0 -13
- data/lib/faker/one_piece.rb +0 -29
- data/lib/faker/overwatch.rb +0 -17
- data/lib/faker/parks_and_rec.rb +0 -13
- data/lib/faker/pokemon.rb +0 -17
- data/lib/faker/princess_bride.rb +0 -13
- data/lib/faker/rick_and_morty.rb +0 -17
- data/lib/faker/robin.rb +0 -9
- data/lib/faker/rock_band.rb +0 -9
- data/lib/faker/rupaul.rb +0 -15
- data/lib/faker/seinfeld.rb +0 -13
- data/lib/faker/shakespeare.rb +0 -37
- data/lib/faker/silicon_valley.rb +0 -37
- data/lib/faker/simpsons.rb +0 -17
- data/lib/faker/singular_siegler.rb +0 -9
- data/lib/faker/star_trek.rb +0 -21
- data/lib/faker/star_wars.rb +0 -101
- data/lib/faker/stargate.rb +0 -17
- data/lib/faker/stranger_thing.rb +0 -13
- data/lib/faker/sword_art_online.rb +0 -21
- data/lib/faker/the_fresh_prince_of_bel_air.rb +0 -17
- data/lib/faker/the_it_crowd.rb +0 -21
- data/lib/faker/the_thick_of_it.rb +0 -17
- data/lib/faker/twin_peaks.rb +0 -17
- data/lib/faker/umphreys_mcgee.rb +0 -9
- data/lib/faker/v_for_vendetta.rb +0 -17
- data/lib/faker/vehicle.rb +0 -101
- data/lib/faker/venture_bros.rb +0 -21
- data/lib/faker/witcher.rb +0 -29
- data/lib/faker/world_of_warcraft.rb +0 -13
- data/lib/faker/yoda.rb +0 -10
- data/lib/faker/zelda.rb +0 -22
- data/lib/locales/en/famous_last_words.yml +0 -4
- data/lib/locales/en/matz.yml +0 -28
- data/lib/locales/en/most_interesting_man_in_the_world.yml +0 -106
- data/lib/locales/en/robin.yml +0 -4
- data/lib/locales/en/singular_siegler.yml +0 -37
data/lib/faker.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
begin
|
4
4
|
require 'psych'
|
@@ -7,11 +7,11 @@ end
|
|
7
7
|
require 'i18n'
|
8
8
|
require 'set' # Fixes a bug in i18n 0.6.11
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
I18n.
|
10
|
+
# require helper files
|
11
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'helpers', '*.rb')).sort.each { |file| require file }
|
12
|
+
|
13
|
+
# load locales via I18n.backend
|
14
|
+
I18n.backend = I18n::Backend::Chain.new(I18n.backend, Faker::I18nBackend.new)
|
15
15
|
|
16
16
|
module Faker
|
17
17
|
class Config
|
@@ -45,6 +45,7 @@ module Faker
|
|
45
45
|
## by default numerify results do not start with a zero
|
46
46
|
def numerify(number_string, leading_zero: false)
|
47
47
|
return number_string.gsub(/#/) { rand(10).to_s } if leading_zero
|
48
|
+
|
48
49
|
number_string.sub(/#/) { rand(1..9).to_s }.gsub(/#/) { rand(10).to_s }
|
49
50
|
end
|
50
51
|
|
@@ -94,7 +95,7 @@ module Faker
|
|
94
95
|
# with an array of values and selecting one of them.
|
95
96
|
def fetch(key)
|
96
97
|
fetched = sample(translate("faker.#{key}"))
|
97
|
-
if fetched
|
98
|
+
if fetched&.match(%r{^\/}) && fetched&.match(%r{\/$}) # A regex
|
98
99
|
regexify(fetched)
|
99
100
|
else
|
100
101
|
fetched
|
@@ -158,14 +159,19 @@ module Faker
|
|
158
159
|
# Super-simple fallback -- fallback to en if the
|
159
160
|
# translation was missing. If the translation isn't
|
160
161
|
# in en either, then it will raise again.
|
161
|
-
|
162
|
+
disable_enforce_available_locales do
|
163
|
+
I18n.translate(*args.push(opts))
|
164
|
+
end
|
162
165
|
end
|
163
166
|
|
164
167
|
# Executes block with given locale set.
|
165
168
|
def with_locale(tmp_locale = nil)
|
166
169
|
current_locale = Faker::Config.own_locale
|
167
170
|
Faker::Config.locale = tmp_locale
|
168
|
-
|
171
|
+
|
172
|
+
disable_enforce_available_locales do
|
173
|
+
I18n.with_locale(tmp_locale) { yield }
|
174
|
+
end
|
169
175
|
ensure
|
170
176
|
Faker::Config.locale = current_locale
|
171
177
|
end
|
@@ -199,6 +205,16 @@ module Faker
|
|
199
205
|
rand(from..to)
|
200
206
|
end
|
201
207
|
|
208
|
+
# If an array or range is passed, a random value will be selected.
|
209
|
+
# All other values are simply returned.
|
210
|
+
def resolve(value)
|
211
|
+
case value
|
212
|
+
when Array then sample(value)
|
213
|
+
when Range then rand value
|
214
|
+
else value
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
202
218
|
def unique(max_retries = 10_000)
|
203
219
|
@unique ||= UniqueGenerator.new(self, max_retries)
|
204
220
|
end
|
@@ -214,20 +230,23 @@ module Faker
|
|
214
230
|
def rand(max = nil)
|
215
231
|
if max.nil?
|
216
232
|
Faker::Config.random.rand
|
217
|
-
elsif max.is_a?(Range) || max.to_i
|
233
|
+
elsif max.is_a?(Range) || max.to_i.positive?
|
218
234
|
Faker::Config.random.rand(max)
|
219
235
|
else
|
220
236
|
0
|
221
237
|
end
|
222
238
|
end
|
239
|
+
|
240
|
+
def disable_enforce_available_locales
|
241
|
+
old_enforce_available_locales = I18n.enforce_available_locales
|
242
|
+
I18n.enforce_available_locales = false
|
243
|
+
yield
|
244
|
+
ensure
|
245
|
+
I18n.enforce_available_locales = old_enforce_available_locales
|
246
|
+
end
|
223
247
|
end
|
224
248
|
end
|
225
249
|
end
|
226
250
|
|
227
|
-
|
228
|
-
|
229
|
-
require 'extensions/array'
|
230
|
-
require 'extensions/symbol'
|
231
|
-
|
232
|
-
require 'helpers/char'
|
233
|
-
require 'helpers/unique_generator'
|
251
|
+
# require faker objects
|
252
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'faker', '/**/*.rb')).sort.each { |file| require file }
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'digest'
|
4
|
+
require 'securerandom'
|
5
|
+
|
6
|
+
module Faker
|
7
|
+
class Blockchain
|
8
|
+
class Bitcoin < Base
|
9
|
+
class << self
|
10
|
+
PROTOCOL_VERSIONS = {
|
11
|
+
main: 0,
|
12
|
+
testnet: 111
|
13
|
+
}.freeze
|
14
|
+
|
15
|
+
def address
|
16
|
+
address_for(:main)
|
17
|
+
end
|
18
|
+
|
19
|
+
def testnet_address
|
20
|
+
address_for(:testnet)
|
21
|
+
end
|
22
|
+
|
23
|
+
protected
|
24
|
+
|
25
|
+
def address_for(network)
|
26
|
+
version = PROTOCOL_VERSIONS.fetch(network)
|
27
|
+
packed = version.chr + Faker::Config.random.bytes(20)
|
28
|
+
checksum = Digest::SHA2.digest(Digest::SHA2.digest(packed))[0..3]
|
29
|
+
Faker::Base58.encode(packed + checksum)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Faker
|
4
|
+
class Blockchain
|
5
|
+
class Ethereum < Base
|
6
|
+
class << self
|
7
|
+
def address
|
8
|
+
hex_alphabet = '0123456789abcdef'
|
9
|
+
var = +'0x'
|
10
|
+
40.times { var << sample(shuffle(hex_alphabet.split(''))) }
|
11
|
+
var
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'digest'
|
4
|
+
require 'securerandom'
|
5
|
+
|
6
|
+
module Faker
|
7
|
+
class Blockchain
|
8
|
+
class Tezos < Base
|
9
|
+
class << self
|
10
|
+
PREFIXES = {
|
11
|
+
tz1: [6, 161, 159],
|
12
|
+
KT1: [2, 90, 121],
|
13
|
+
edpk: [13, 15, 37, 217],
|
14
|
+
edsk: [13, 15, 58, 7],
|
15
|
+
edsig: [9, 245, 205, 134, 18],
|
16
|
+
o: [5, 116]
|
17
|
+
}.freeze
|
18
|
+
|
19
|
+
def account
|
20
|
+
encode_tz(:tz1, 20)
|
21
|
+
end
|
22
|
+
|
23
|
+
def contract
|
24
|
+
encode_tz(:KT1, 20)
|
25
|
+
end
|
26
|
+
|
27
|
+
def operation
|
28
|
+
encode_tz(:o, 32)
|
29
|
+
end
|
30
|
+
|
31
|
+
def signature
|
32
|
+
encode_tz(:edsig, 64)
|
33
|
+
end
|
34
|
+
|
35
|
+
protected
|
36
|
+
|
37
|
+
def encode_tz(prefix, payload_size)
|
38
|
+
prefix = PREFIXES.fetch(prefix)
|
39
|
+
packed = prefix.map(&:chr).join('') + Faker::Config.random.bytes(payload_size)
|
40
|
+
checksum = Digest::SHA2.digest(Digest::SHA2.digest(packed))[0..3]
|
41
|
+
Faker::Base58.encode(packed + checksum)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Faker
|
4
|
+
class Books
|
5
|
+
class CultureSeries < Base
|
6
|
+
flexible :culture_series
|
7
|
+
class << self
|
8
|
+
def book
|
9
|
+
fetch('culture_series.books')
|
10
|
+
end
|
11
|
+
|
12
|
+
def culture_ship
|
13
|
+
fetch('culture_series.culture_ships')
|
14
|
+
end
|
15
|
+
|
16
|
+
def culture_ship_class
|
17
|
+
fetch('culture_series.culture_ship_classes')
|
18
|
+
end
|
19
|
+
|
20
|
+
def culture_ship_class_abv
|
21
|
+
fetch('culture_series.culture_ship_class_abvs')
|
22
|
+
end
|
23
|
+
|
24
|
+
def civ
|
25
|
+
fetch('culture_series.civs')
|
26
|
+
end
|
27
|
+
|
28
|
+
def planet
|
29
|
+
fetch('culture_series.planets')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Faker
|
4
|
+
class Books
|
5
|
+
class Dune < Base
|
6
|
+
class << self
|
7
|
+
# QUOTED_CHARACTERS = fetch("dune.quotes")
|
8
|
+
# SAYING_SOURCES = %w(translate("faker.dune.sources"))
|
9
|
+
|
10
|
+
def character
|
11
|
+
fetch('dune.characters')
|
12
|
+
end
|
13
|
+
|
14
|
+
def title
|
15
|
+
fetch('dune.titles')
|
16
|
+
end
|
17
|
+
|
18
|
+
def planet
|
19
|
+
fetch('dune.planets')
|
20
|
+
end
|
21
|
+
|
22
|
+
def quote(character = nil)
|
23
|
+
quoted_characters = translate('faker.dune.quotes').keys
|
24
|
+
|
25
|
+
if character.nil?
|
26
|
+
character = sample(quoted_characters).to_s
|
27
|
+
else
|
28
|
+
character = character.to_s.downcase
|
29
|
+
|
30
|
+
unless quoted_characters.include?(character.to_sym)
|
31
|
+
raise ArgumentError,
|
32
|
+
"Characters quoted can be left blank or #{quoted_characters.join(', ')}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
fetch('dune.quotes.' + character)
|
37
|
+
end
|
38
|
+
|
39
|
+
def saying(source = nil)
|
40
|
+
sourced_sayings = translate('faker.dune.sayings').keys
|
41
|
+
|
42
|
+
if source.nil?
|
43
|
+
source = sample(sourced_sayings).to_s
|
44
|
+
else
|
45
|
+
source = source.to_s.downcase
|
46
|
+
|
47
|
+
unless sourced_sayings.include?(source.to_sym)
|
48
|
+
raise ArgumentError,
|
49
|
+
"Sources quoted in sayings can be left blank or #{sourced_sayings.join(', ')}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
fetch('dune.sayings.' + source)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Faker
|
4
|
+
class Books
|
5
|
+
class Lovecraft < Base
|
6
|
+
class << self
|
7
|
+
def location
|
8
|
+
fetch('lovecraft.location')
|
9
|
+
end
|
10
|
+
|
11
|
+
def fhtagn(number_of = 1)
|
12
|
+
Array.new(number_of) { fetch('lovecraft.fhtagn') }.join('. ')
|
13
|
+
end
|
14
|
+
|
15
|
+
def deity
|
16
|
+
fetch('lovecraft.deity')
|
17
|
+
end
|
18
|
+
|
19
|
+
def tome
|
20
|
+
fetch('lovecraft.tome')
|
21
|
+
end
|
22
|
+
|
23
|
+
def sentence(word_count = 4, random_words_to_add = 6)
|
24
|
+
words(word_count + rand(random_words_to_add.to_i).to_i, true).join(' ').capitalize + '.'
|
25
|
+
end
|
26
|
+
|
27
|
+
def word
|
28
|
+
random_word = sample(translate('faker.lovecraft.words'))
|
29
|
+
random_word =~ /\s/ ? word : random_word
|
30
|
+
end
|
31
|
+
|
32
|
+
def words(num = 3, spaces_allowed = false)
|
33
|
+
resolved_num = resolve(num)
|
34
|
+
word_list = translate('faker.lovecraft.words')
|
35
|
+
word_list *= ((resolved_num / word_list.length) + 1)
|
36
|
+
|
37
|
+
return shuffle(word_list)[0, resolved_num] if spaces_allowed
|
38
|
+
|
39
|
+
words = shuffle(word_list)[0, resolved_num]
|
40
|
+
words.each_with_index { |w, i| words[i] = word if w =~ /\s/ }
|
41
|
+
end
|
42
|
+
|
43
|
+
def sentences(sentence_count = 3)
|
44
|
+
[].tap do |sentences|
|
45
|
+
1.upto(resolve(sentence_count)) do
|
46
|
+
sentences << sentence(3)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def paragraph(sentence_count = 3, random_sentences_to_add = 3)
|
52
|
+
sentences(resolve(sentence_count) + rand(random_sentences_to_add.to_i).to_i).join(' ')
|
53
|
+
end
|
54
|
+
|
55
|
+
def paragraphs(paragraph_count = 3)
|
56
|
+
[].tap do |paragraphs|
|
57
|
+
1.upto(resolve(paragraph_count)) do
|
58
|
+
paragraphs << paragraph(3)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def paragraph_by_chars(chars = 256)
|
64
|
+
paragraph = paragraph(3)
|
65
|
+
|
66
|
+
paragraph += ' ' + paragraph(3) while paragraph.length < chars
|
67
|
+
|
68
|
+
paragraph[0...chars - 1] + '.'
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Faker
|
4
|
+
module Creature
|
5
|
+
class Cat < Base
|
6
|
+
flexible :cat
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def name
|
10
|
+
fetch('creature.cat.name')
|
11
|
+
end
|
12
|
+
|
13
|
+
def breed
|
14
|
+
fetch('creature.cat.breed')
|
15
|
+
end
|
16
|
+
|
17
|
+
def registry
|
18
|
+
fetch('creature.cat.registry')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Faker
|
4
|
+
module Creature
|
5
|
+
class Dog < Base
|
6
|
+
flexible :dog
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def name
|
10
|
+
fetch('creature.dog.name')
|
11
|
+
end
|
12
|
+
|
13
|
+
def breed
|
14
|
+
fetch('creature.dog.breed')
|
15
|
+
end
|
16
|
+
|
17
|
+
def sound
|
18
|
+
fetch('creature.dog.sound')
|
19
|
+
end
|
20
|
+
|
21
|
+
def meme_phrase
|
22
|
+
fetch('creature.dog.meme_phrase')
|
23
|
+
end
|
24
|
+
|
25
|
+
def age
|
26
|
+
fetch('creature.dog.age')
|
27
|
+
end
|
28
|
+
|
29
|
+
def gender
|
30
|
+
Faker::Gender.binary_type
|
31
|
+
end
|
32
|
+
|
33
|
+
def coat_length
|
34
|
+
fetch('creature.dog.coat_length')
|
35
|
+
end
|
36
|
+
|
37
|
+
def size
|
38
|
+
fetch('creature.dog.size')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|