From 0582d58e2a0843b6962827100f5d3db333c146b4 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 15:13:30 -0700 Subject: [PATCH 01/11] install and configure zeitwerk --- Gemfile.lock | 2 ++ faker.gemspec | 1 + lib/faker.rb | 28 ++++++++++++++++++++++++++-- test/test_i18n_reload.rb | 1 + 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 275b69d382..51e150a9d6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,6 +3,7 @@ PATH specs: faker (3.6.0) i18n (>= 1.8.11, < 2) + zeitwerk (~> 2.7.3) GEM remote: https://rubygems.org/ @@ -93,6 +94,7 @@ GEM unicode-emoji (~> 4.1) unicode-emoji (4.2.0) yard (0.9.38) + zeitwerk (2.7.4) PLATFORMS arm64-darwin diff --git a/faker.gemspec b/faker.gemspec index 9455a5e572..034e0e3388 100644 --- a/faker.gemspec +++ b/faker.gemspec @@ -29,4 +29,5 @@ Gem::Specification.new do |spec| spec.metadata['rubygems_mfa_required'] = 'true' spec.add_dependency('i18n', '>= 1.8.11', '< 2') + spec.add_dependency 'zeitwerk', '~> 2.7.3' end diff --git a/lib/faker.rb b/lib/faker.rb index f44bc26e5b..8b34d61f0e 100644 --- a/lib/faker.rb +++ b/lib/faker.rb @@ -4,6 +4,7 @@ require 'psych' require 'i18n' +require 'zeitwerk' autoload(:OpenSSL, 'openssl') @@ -277,5 +278,28 @@ def disable_enforce_available_locales end end -# require faker objects -Dir.glob(File.join(mydir, 'faker', '/**/*.rb')).each { |file| require file } +if ENV['AUTOLOAD'] == '1' + loader = Zeitwerk::Loader.new + loader.tag = 'faker' + loader.push_dir(File.join(mydir, 'faker'), namespace: Faker) + loader.ignore("#{mydir}/faker/version.rb") + loader.inflector.inflect( + 'dnd' => 'DnD', + 'final_fantasy_xiv' => 'FinalFantasyXIV', + 'html' => 'HTML', + 'the_it_crowd' => 'TheITCrowd', + 'http' => 'HTTP' + ) + loader.collapse( + "#{mydir}/faker/default" + ) + loader.setup +end + +if ENV['AUTOLOAD'] != '1' + rb_files = [] + rb_files << File.join(mydir, 'faker', '*.rb') + rb_files << File.join(mydir, 'faker', '/**/*.rb') + + Dir.glob(rb_files).each { |file| require file } +end diff --git a/test/test_i18n_reload.rb b/test/test_i18n_reload.rb index b86fa47048..c37d12fffd 100644 --- a/test/test_i18n_reload.rb +++ b/test/test_i18n_reload.rb @@ -10,6 +10,7 @@ def test_faker_i18n code = <<-RUBY require 'bundler/inline' require 'test/unit' + require 'zeitwerk' gemfile do source 'https://rubygems.org' From 4487c9c456563930ad6e533ecf5687de82b5247a Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 15:45:58 -0700 Subject: [PATCH 02/11] namespace changes, first pass --- lib/faker/blockchain.rb | 6 + lib/faker/blockchain/aeternity.rb | 2 +- lib/faker/blockchain/bitcoin.rb | 2 +- lib/faker/blockchain/ethereum.rb | 2 +- lib/faker/blockchain/tezos.rb | 2 +- lib/faker/books.rb | 6 + lib/faker/books/culture_series.rb | 2 +- lib/faker/books/dune.rb | 2 +- lib/faker/books/lovecraft.rb | 2 +- lib/faker/books/the_kingkiller_chronicle.rb | 2 +- lib/faker/creature.rb | 6 + lib/faker/creature/animal.rb | 2 +- lib/faker/creature/bird.rb | 2 +- lib/faker/creature/cat.rb | 2 +- lib/faker/creature/dog.rb | 2 +- lib/faker/creature/horse.rb | 2 +- lib/faker/{books => default}/book.rb | 0 lib/faker/{movies => default}/movie.rb | 0 lib/faker/{quotes => default}/quote.rb | 0 lib/faker/{sports => default}/sport.rb | 0 lib/faker/fantasy.rb | 6 + lib/faker/fantasy/tolkien.rb | 2 +- lib/faker/games.rb | 6 + lib/faker/games/clash_of_clans.rb | 2 +- lib/faker/games/control.rb | 2 +- lib/faker/games/dnd.rb | 2 +- lib/faker/games/dota.rb | 2 +- lib/faker/games/elder_scrolls.rb | 2 +- lib/faker/games/fallout.rb | 2 +- lib/faker/games/final_fantasy_xiv.rb | 2 +- lib/faker/games/half_life.rb | 2 +- lib/faker/games/heroes.rb | 2 +- lib/faker/games/heroes_of_the_storm.rb | 2 +- lib/faker/games/league_of_legends.rb | 2 +- lib/faker/games/minecraft.rb | 2 +- lib/faker/games/myst.rb | 2 +- lib/faker/games/overwatch.rb | 2 +- lib/faker/games/pokemon.rb | 2 +- lib/faker/games/sonic_the_hedgehog.rb | 2 +- lib/faker/games/street_fighter.rb | 2 +- lib/faker/games/super_mario.rb | 2 +- lib/faker/games/super_smash_bros.rb | 2 +- lib/faker/games/tarkov.rb | 2 +- lib/faker/games/touhou.rb | 2 +- lib/faker/games/warhammer_fantasy.rb | 2 +- lib/faker/games/witcher.rb | 2 +- lib/faker/games/world_of_warcraft.rb | 2 +- lib/faker/games/zelda.rb | 2 +- lib/faker/japanese_media.rb | 6 + lib/faker/japanese_media/conan.rb | 2 +- lib/faker/japanese_media/cowboy_bebop.rb | 2 +- lib/faker/japanese_media/doraemon.rb | 2 +- lib/faker/japanese_media/dragon_ball.rb | 2 +- .../fullmetal_alchemist_brotherhood.rb | 2 +- lib/faker/japanese_media/kamen_rider.rb | 2 +- lib/faker/japanese_media/naruto.rb | 2 +- lib/faker/japanese_media/one_piece.rb | 2 +- lib/faker/japanese_media/studio_ghibli.rb | 2 +- lib/faker/japanese_media/sword_art_online.rb | 2 +- lib/faker/locations.rb | 6 + lib/faker/locations/australia.rb | 2 +- lib/faker/movies.rb | 6 + lib/faker/movies/avatar.rb | 2 +- lib/faker/movies/back_to_the_future.rb | 2 +- lib/faker/movies/departed.rb | 2 +- lib/faker/movies/ghostbusters.rb | 2 +- lib/faker/movies/hackers.rb | 2 +- lib/faker/movies/harry_potter.rb | 2 +- .../movies/hitchhikers_guide_to_the_galaxy.rb | 2 +- lib/faker/movies/hobbit.rb | 2 +- lib/faker/movies/how_to_train_your_dragon.rb | 2 +- lib/faker/movies/lebowski.rb | 2 +- lib/faker/movies/lord_of_the_rings.rb | 2 +- lib/faker/movies/princess_bride.rb | 2 +- lib/faker/movies/star_wars.rb | 2 +- lib/faker/movies/the_room.rb | 2 +- lib/faker/movies/tron.rb | 2 +- lib/faker/movies/v_for_vendetta.rb | 2 +- lib/faker/music.rb | 144 ++++++++++ lib/faker/music/bossa_nova.rb | 4 +- lib/faker/music/grateful_dead.rb | 4 +- lib/faker/music/hiphop.rb | 2 +- lib/faker/music/music.rb | 145 ----------- lib/faker/music/opera.rb | 2 +- lib/faker/music/pearl_jam.rb | 4 +- lib/faker/music/phish.rb | 2 +- lib/faker/music/prince.rb | 2 +- lib/faker/music/rock_band.rb | 2 +- lib/faker/music/rush.rb | 4 +- lib/faker/music/smashing_pumpkins.rb | 4 +- lib/faker/music/umphreys_mcgee.rb | 2 +- lib/faker/quotes.rb | 6 + lib/faker/quotes/chiquito.rb | 2 +- lib/faker/quotes/rajnikanth.rb | 2 +- lib/faker/quotes/shakespeare.rb | 2 +- lib/faker/religion.rb | 6 + lib/faker/sports.rb | 6 + lib/faker/sports/basketball.rb | 2 +- lib/faker/sports/chess.rb | 2 +- lib/faker/sports/football.rb | 2 +- lib/faker/sports/mountaineering.rb | 2 +- lib/faker/sports/volleyball.rb | 2 +- lib/faker/travel.rb | 6 + lib/faker/travel/airport.rb | 2 +- lib/faker/travel/train_station.rb | 2 +- lib/faker/tv_shows.rb | 6 + lib/faker/tv_shows/aqua_teen_hunger_force.rb | 2 +- lib/faker/tv_shows/archer.rb | 2 +- lib/faker/tv_shows/big_bang_theory.rb | 2 +- lib/faker/tv_shows/bojack_horseman.rb | 2 +- lib/faker/tv_shows/breaking_bad.rb | 2 +- lib/faker/tv_shows/brooklyn_nine_nine.rb | 2 +- lib/faker/tv_shows/buffy.rb | 2 +- lib/faker/tv_shows/community.rb | 2 +- lib/faker/tv_shows/dr_who.rb | 2 +- lib/faker/tv_shows/dumb_and_dumber.rb | 2 +- lib/faker/tv_shows/family_guy.rb | 2 +- lib/faker/tv_shows/final_space.rb | 2 +- lib/faker/tv_shows/friends.rb | 2 +- lib/faker/tv_shows/futurama.rb | 2 +- lib/faker/tv_shows/game_of_thrones.rb | 2 +- lib/faker/tv_shows/hey_arnold.rb | 2 +- lib/faker/tv_shows/how_i_met_your_mother.rb | 2 +- lib/faker/tv_shows/michael_scott.rb | 2 +- lib/faker/tv_shows/new_girl.rb | 2 +- lib/faker/tv_shows/parks_and_rec.rb | 2 +- lib/faker/tv_shows/rick_and_morty.rb | 2 +- lib/faker/tv_shows/ru_paul.rb | 2 +- lib/faker/tv_shows/seinfeld.rb | 2 +- lib/faker/tv_shows/silicon_valley.rb | 2 +- lib/faker/tv_shows/simpsons.rb | 2 +- lib/faker/tv_shows/south_park.rb | 2 +- lib/faker/tv_shows/spongebob.rb | 2 +- lib/faker/tv_shows/star_trek.rb | 2 +- lib/faker/tv_shows/stargate.rb | 2 +- lib/faker/tv_shows/stranger_things.rb | 2 +- lib/faker/tv_shows/suits.rb | 2 +- lib/faker/tv_shows/supernatural.rb | 2 +- lib/faker/tv_shows/the_expanse.rb | 2 +- .../tv_shows/the_fresh_prince_of_bel_air.rb | 2 +- lib/faker/tv_shows/the_it_crowd.rb | 2 +- lib/faker/tv_shows/the_office.rb | 2 +- lib/faker/tv_shows/the_thick_of_it.rb | 2 +- lib/faker/tv_shows/twin_peaks.rb | 2 +- lib/faker/tv_shows/venture_bros.rb | 2 +- test/test_determinism.rb | 246 +++++++++--------- 146 files changed, 471 insertions(+), 404 deletions(-) create mode 100644 lib/faker/blockchain.rb create mode 100644 lib/faker/books.rb create mode 100644 lib/faker/creature.rb rename lib/faker/{books => default}/book.rb (100%) rename lib/faker/{movies => default}/movie.rb (100%) rename lib/faker/{quotes => default}/quote.rb (100%) rename lib/faker/{sports => default}/sport.rb (100%) create mode 100644 lib/faker/fantasy.rb create mode 100644 lib/faker/games.rb create mode 100644 lib/faker/japanese_media.rb create mode 100644 lib/faker/locations.rb create mode 100644 lib/faker/movies.rb create mode 100644 lib/faker/music.rb delete mode 100644 lib/faker/music/music.rb create mode 100644 lib/faker/quotes.rb create mode 100644 lib/faker/religion.rb create mode 100644 lib/faker/sports.rb create mode 100644 lib/faker/travel.rb create mode 100644 lib/faker/tv_shows.rb diff --git a/lib/faker/blockchain.rb b/lib/faker/blockchain.rb new file mode 100644 index 0000000000..34d02f963b --- /dev/null +++ b/lib/faker/blockchain.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Blockchain + end +end diff --git a/lib/faker/blockchain/aeternity.rb b/lib/faker/blockchain/aeternity.rb index 1c019d7766..6f3a14366e 100644 --- a/lib/faker/blockchain/aeternity.rb +++ b/lib/faker/blockchain/aeternity.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Blockchain + module Blockchain class Aeternity < Base class << self ## diff --git a/lib/faker/blockchain/bitcoin.rb b/lib/faker/blockchain/bitcoin.rb index badd2f2bd0..9da252ddd6 100644 --- a/lib/faker/blockchain/bitcoin.rb +++ b/lib/faker/blockchain/bitcoin.rb @@ -3,7 +3,7 @@ require 'securerandom' module Faker - class Blockchain + module Blockchain class Bitcoin < Base class << self # @private diff --git a/lib/faker/blockchain/ethereum.rb b/lib/faker/blockchain/ethereum.rb index 3540698234..63f8527186 100644 --- a/lib/faker/blockchain/ethereum.rb +++ b/lib/faker/blockchain/ethereum.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Blockchain + module Blockchain class Ethereum < Base class << self ## diff --git a/lib/faker/blockchain/tezos.rb b/lib/faker/blockchain/tezos.rb index 94cf94449e..1b5b2c93df 100644 --- a/lib/faker/blockchain/tezos.rb +++ b/lib/faker/blockchain/tezos.rb @@ -3,7 +3,7 @@ require 'securerandom' module Faker - class Blockchain + module Blockchain class Tezos < Base class << self # @private diff --git a/lib/faker/books.rb b/lib/faker/books.rb new file mode 100644 index 0000000000..3b5177c0cb --- /dev/null +++ b/lib/faker/books.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Books + end +end \ No newline at end of file diff --git a/lib/faker/books/culture_series.rb b/lib/faker/books/culture_series.rb index 0dd8243fad..e8e2ffca28 100644 --- a/lib/faker/books/culture_series.rb +++ b/lib/faker/books/culture_series.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Books + module Books class CultureSeries < Base flexible :culture_series diff --git a/lib/faker/books/dune.rb b/lib/faker/books/dune.rb index 9036d879bf..0fcd810132 100644 --- a/lib/faker/books/dune.rb +++ b/lib/faker/books/dune.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Books + module Books ## # A Faker module beyond your dreams, test data beyond your imagination. class Dune < Base diff --git a/lib/faker/books/lovecraft.rb b/lib/faker/books/lovecraft.rb index eb6a9b63e5..b7ffb50a6a 100644 --- a/lib/faker/books/lovecraft.rb +++ b/lib/faker/books/lovecraft.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Books + module Books class Lovecraft < Base class << self ## diff --git a/lib/faker/books/the_kingkiller_chronicle.rb b/lib/faker/books/the_kingkiller_chronicle.rb index fbcd4835ce..298ab1ac47 100644 --- a/lib/faker/books/the_kingkiller_chronicle.rb +++ b/lib/faker/books/the_kingkiller_chronicle.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Books + module Books class TheKingkillerChronicle < Base class << self ## diff --git a/lib/faker/creature.rb b/lib/faker/creature.rb new file mode 100644 index 0000000000..517d20a570 --- /dev/null +++ b/lib/faker/creature.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Creature + end +end diff --git a/lib/faker/creature/animal.rb b/lib/faker/creature/animal.rb index dbb3b6b133..f26fa27506 100644 --- a/lib/faker/creature/animal.rb +++ b/lib/faker/creature/animal.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Creature + module Creature class Animal < Base class << self ## diff --git a/lib/faker/creature/bird.rb b/lib/faker/creature/bird.rb index d1a016d1ea..8ed8911237 100644 --- a/lib/faker/creature/bird.rb +++ b/lib/faker/creature/bird.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Creature + module Creature class Bird < Base flexible :bird diff --git a/lib/faker/creature/cat.rb b/lib/faker/creature/cat.rb index fb0e825569..31231531f4 100644 --- a/lib/faker/creature/cat.rb +++ b/lib/faker/creature/cat.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Creature + module Creature class Cat < Base flexible :cat diff --git a/lib/faker/creature/dog.rb b/lib/faker/creature/dog.rb index 301defe158..6953e76383 100644 --- a/lib/faker/creature/dog.rb +++ b/lib/faker/creature/dog.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Creature + module Creature class Dog < Base flexible :dog diff --git a/lib/faker/creature/horse.rb b/lib/faker/creature/horse.rb index 72e76f579c..9bb9d9e4ab 100644 --- a/lib/faker/creature/horse.rb +++ b/lib/faker/creature/horse.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Creature + module Creature class Horse < Base flexible :horse diff --git a/lib/faker/books/book.rb b/lib/faker/default/book.rb similarity index 100% rename from lib/faker/books/book.rb rename to lib/faker/default/book.rb diff --git a/lib/faker/movies/movie.rb b/lib/faker/default/movie.rb similarity index 100% rename from lib/faker/movies/movie.rb rename to lib/faker/default/movie.rb diff --git a/lib/faker/quotes/quote.rb b/lib/faker/default/quote.rb similarity index 100% rename from lib/faker/quotes/quote.rb rename to lib/faker/default/quote.rb diff --git a/lib/faker/sports/sport.rb b/lib/faker/default/sport.rb similarity index 100% rename from lib/faker/sports/sport.rb rename to lib/faker/default/sport.rb diff --git a/lib/faker/fantasy.rb b/lib/faker/fantasy.rb new file mode 100644 index 0000000000..dd331a80ca --- /dev/null +++ b/lib/faker/fantasy.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Fantasy + end +end diff --git a/lib/faker/fantasy/tolkien.rb b/lib/faker/fantasy/tolkien.rb index 67bc22aaf0..5fa262c4b7 100644 --- a/lib/faker/fantasy/tolkien.rb +++ b/lib/faker/fantasy/tolkien.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Fantasy + module Fantasy class Tolkien < Base flexible :tolkien diff --git a/lib/faker/games.rb b/lib/faker/games.rb new file mode 100644 index 0000000000..cc95d35d9f --- /dev/null +++ b/lib/faker/games.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Games + end +end diff --git a/lib/faker/games/clash_of_clans.rb b/lib/faker/games/clash_of_clans.rb index 2bf192670f..2fac1427f3 100644 --- a/lib/faker/games/clash_of_clans.rb +++ b/lib/faker/games/clash_of_clans.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class ClashOfClans < Base class << self ## diff --git a/lib/faker/games/control.rb b/lib/faker/games/control.rb index ebd8cf296c..794d14a5c4 100644 --- a/lib/faker/games/control.rb +++ b/lib/faker/games/control.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Control < Base class << self ## diff --git a/lib/faker/games/dnd.rb b/lib/faker/games/dnd.rb index 2bb87ee0f9..46a7da7439 100644 --- a/lib/faker/games/dnd.rb +++ b/lib/faker/games/dnd.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class DnD < Base class << self ## diff --git a/lib/faker/games/dota.rb b/lib/faker/games/dota.rb index a8ada9ea98..b7906d252e 100644 --- a/lib/faker/games/dota.rb +++ b/lib/faker/games/dota.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Dota < Base class << self ## diff --git a/lib/faker/games/elder_scrolls.rb b/lib/faker/games/elder_scrolls.rb index 5e8e606a1a..b9d8d7fad4 100644 --- a/lib/faker/games/elder_scrolls.rb +++ b/lib/faker/games/elder_scrolls.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class ElderScrolls < Base class << self ## diff --git a/lib/faker/games/fallout.rb b/lib/faker/games/fallout.rb index b92f539187..c7930dbae6 100644 --- a/lib/faker/games/fallout.rb +++ b/lib/faker/games/fallout.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Fallout < Base class << self ## diff --git a/lib/faker/games/final_fantasy_xiv.rb b/lib/faker/games/final_fantasy_xiv.rb index bf16a8837c..ac37e825e1 100644 --- a/lib/faker/games/final_fantasy_xiv.rb +++ b/lib/faker/games/final_fantasy_xiv.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class FinalFantasyXIV < Base class << self ## diff --git a/lib/faker/games/half_life.rb b/lib/faker/games/half_life.rb index 0a8c7566f4..000784565c 100644 --- a/lib/faker/games/half_life.rb +++ b/lib/faker/games/half_life.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class HalfLife < Base class << self ## diff --git a/lib/faker/games/heroes.rb b/lib/faker/games/heroes.rb index e6dc38d1d9..7f09230c32 100644 --- a/lib/faker/games/heroes.rb +++ b/lib/faker/games/heroes.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Heroes < Base class << self ## diff --git a/lib/faker/games/heroes_of_the_storm.rb b/lib/faker/games/heroes_of_the_storm.rb index 89e7955664..2a203ab3c6 100644 --- a/lib/faker/games/heroes_of_the_storm.rb +++ b/lib/faker/games/heroes_of_the_storm.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class HeroesOfTheStorm < Base class << self ## diff --git a/lib/faker/games/league_of_legends.rb b/lib/faker/games/league_of_legends.rb index 7b40a072b6..933e3326dc 100644 --- a/lib/faker/games/league_of_legends.rb +++ b/lib/faker/games/league_of_legends.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class LeagueOfLegends < Base class << self ## diff --git a/lib/faker/games/minecraft.rb b/lib/faker/games/minecraft.rb index 28ef82b2cd..dae81054e5 100644 --- a/lib/faker/games/minecraft.rb +++ b/lib/faker/games/minecraft.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Minecraft < Base class << self ## diff --git a/lib/faker/games/myst.rb b/lib/faker/games/myst.rb index 7f3e1fd144..f104251e51 100644 --- a/lib/faker/games/myst.rb +++ b/lib/faker/games/myst.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Myst < Base class << self ## diff --git a/lib/faker/games/overwatch.rb b/lib/faker/games/overwatch.rb index 34087991c1..f7803890d8 100644 --- a/lib/faker/games/overwatch.rb +++ b/lib/faker/games/overwatch.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Overwatch < Base class << self ## diff --git a/lib/faker/games/pokemon.rb b/lib/faker/games/pokemon.rb index f2ac903747..24f3364fb1 100644 --- a/lib/faker/games/pokemon.rb +++ b/lib/faker/games/pokemon.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Pokemon < Base class << self ## diff --git a/lib/faker/games/sonic_the_hedgehog.rb b/lib/faker/games/sonic_the_hedgehog.rb index 779306ccb4..9f7ed15d5b 100644 --- a/lib/faker/games/sonic_the_hedgehog.rb +++ b/lib/faker/games/sonic_the_hedgehog.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class SonicTheHedgehog < Base class << self ## diff --git a/lib/faker/games/street_fighter.rb b/lib/faker/games/street_fighter.rb index a3251a25cd..d80813ef98 100644 --- a/lib/faker/games/street_fighter.rb +++ b/lib/faker/games/street_fighter.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class StreetFighter < Base class << self ## diff --git a/lib/faker/games/super_mario.rb b/lib/faker/games/super_mario.rb index 87e8b2867d..593daf588b 100644 --- a/lib/faker/games/super_mario.rb +++ b/lib/faker/games/super_mario.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class SuperMario < Base class << self ## diff --git a/lib/faker/games/super_smash_bros.rb b/lib/faker/games/super_smash_bros.rb index b845e1f93b..99ca4ea668 100644 --- a/lib/faker/games/super_smash_bros.rb +++ b/lib/faker/games/super_smash_bros.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class SuperSmashBros < Base class << self ## diff --git a/lib/faker/games/tarkov.rb b/lib/faker/games/tarkov.rb index 5d32ca66a0..c1511dc58f 100644 --- a/lib/faker/games/tarkov.rb +++ b/lib/faker/games/tarkov.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Tarkov < Base class << self ## diff --git a/lib/faker/games/touhou.rb b/lib/faker/games/touhou.rb index 656b8b8b61..b0ac2706d6 100644 --- a/lib/faker/games/touhou.rb +++ b/lib/faker/games/touhou.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Touhou < Base flexible :touhou class << self diff --git a/lib/faker/games/warhammer_fantasy.rb b/lib/faker/games/warhammer_fantasy.rb index 8e97cd3075..cc4a7f0d6a 100644 --- a/lib/faker/games/warhammer_fantasy.rb +++ b/lib/faker/games/warhammer_fantasy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class WarhammerFantasy < Base class << self ## diff --git a/lib/faker/games/witcher.rb b/lib/faker/games/witcher.rb index e4760b8670..d69678564a 100644 --- a/lib/faker/games/witcher.rb +++ b/lib/faker/games/witcher.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Witcher < Base class << self ## diff --git a/lib/faker/games/world_of_warcraft.rb b/lib/faker/games/world_of_warcraft.rb index 005bb076cb..ebfb3f4734 100644 --- a/lib/faker/games/world_of_warcraft.rb +++ b/lib/faker/games/world_of_warcraft.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class WorldOfWarcraft < Base class << self ## diff --git a/lib/faker/games/zelda.rb b/lib/faker/games/zelda.rb index 352ed8ad47..afeee73ebd 100644 --- a/lib/faker/games/zelda.rb +++ b/lib/faker/games/zelda.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Games + module Games class Zelda < Base flexible :zelda class << self diff --git a/lib/faker/japanese_media.rb b/lib/faker/japanese_media.rb new file mode 100644 index 0000000000..e5b34201c2 --- /dev/null +++ b/lib/faker/japanese_media.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module JapaneseMedia + end +end diff --git a/lib/faker/japanese_media/conan.rb b/lib/faker/japanese_media/conan.rb index 03d688c53f..0c87243ac0 100644 --- a/lib/faker/japanese_media/conan.rb +++ b/lib/faker/japanese_media/conan.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class Conan < Base class << self ## diff --git a/lib/faker/japanese_media/cowboy_bebop.rb b/lib/faker/japanese_media/cowboy_bebop.rb index a8d3f523eb..4a2a5fd5b0 100644 --- a/lib/faker/japanese_media/cowboy_bebop.rb +++ b/lib/faker/japanese_media/cowboy_bebop.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class CowboyBebop < Base class << self ## diff --git a/lib/faker/japanese_media/doraemon.rb b/lib/faker/japanese_media/doraemon.rb index b859468045..aa2905908b 100644 --- a/lib/faker/japanese_media/doraemon.rb +++ b/lib/faker/japanese_media/doraemon.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class Doraemon < Base class << self ## diff --git a/lib/faker/japanese_media/dragon_ball.rb b/lib/faker/japanese_media/dragon_ball.rb index 3b18c5bc06..d00350cf36 100644 --- a/lib/faker/japanese_media/dragon_ball.rb +++ b/lib/faker/japanese_media/dragon_ball.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class DragonBall < Base class << self ## diff --git a/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb b/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb index c112eb7255..612940fa5f 100644 --- a/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb +++ b/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class FullmetalAlchemistBrotherhood < Base class << self ## diff --git a/lib/faker/japanese_media/kamen_rider.rb b/lib/faker/japanese_media/kamen_rider.rb index 8e8205ba12..fdb0bfb7ef 100644 --- a/lib/faker/japanese_media/kamen_rider.rb +++ b/lib/faker/japanese_media/kamen_rider.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class KamenRider < Base class << self ERAS = %i[showa heisei reiwa].freeze diff --git a/lib/faker/japanese_media/naruto.rb b/lib/faker/japanese_media/naruto.rb index 3f2ee615e5..49f48ee85f 100644 --- a/lib/faker/japanese_media/naruto.rb +++ b/lib/faker/japanese_media/naruto.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class Naruto < Base class << self ## diff --git a/lib/faker/japanese_media/one_piece.rb b/lib/faker/japanese_media/one_piece.rb index fe473391aa..e5a2ba9161 100644 --- a/lib/faker/japanese_media/one_piece.rb +++ b/lib/faker/japanese_media/one_piece.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class OnePiece < Base class << self ## diff --git a/lib/faker/japanese_media/studio_ghibli.rb b/lib/faker/japanese_media/studio_ghibli.rb index 4ebbcc9437..3c0ba225d7 100644 --- a/lib/faker/japanese_media/studio_ghibli.rb +++ b/lib/faker/japanese_media/studio_ghibli.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class StudioGhibli < Base class << self ## diff --git a/lib/faker/japanese_media/sword_art_online.rb b/lib/faker/japanese_media/sword_art_online.rb index 30a36c82f4..69c98a9aae 100644 --- a/lib/faker/japanese_media/sword_art_online.rb +++ b/lib/faker/japanese_media/sword_art_online.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class JapaneseMedia + module JapaneseMedia class SwordArtOnline < Base class << self ## diff --git a/lib/faker/locations.rb b/lib/faker/locations.rb new file mode 100644 index 0000000000..b8cda9f246 --- /dev/null +++ b/lib/faker/locations.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Locations + end +end diff --git a/lib/faker/locations/australia.rb b/lib/faker/locations/australia.rb index a0358b93a5..47556d893d 100644 --- a/lib/faker/locations/australia.rb +++ b/lib/faker/locations/australia.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Locations + module Locations class Australia < Base class << self ## diff --git a/lib/faker/movies.rb b/lib/faker/movies.rb new file mode 100644 index 0000000000..ebcd0b3f27 --- /dev/null +++ b/lib/faker/movies.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Movies + end +end diff --git a/lib/faker/movies/avatar.rb b/lib/faker/movies/avatar.rb index 48418118d9..859b850046 100644 --- a/lib/faker/movies/avatar.rb +++ b/lib/faker/movies/avatar.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class Avatar < Base class << self ## diff --git a/lib/faker/movies/back_to_the_future.rb b/lib/faker/movies/back_to_the_future.rb index 8aad8936d2..b5376f5060 100644 --- a/lib/faker/movies/back_to_the_future.rb +++ b/lib/faker/movies/back_to_the_future.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class BackToTheFuture < Base class << self ## diff --git a/lib/faker/movies/departed.rb b/lib/faker/movies/departed.rb index ac241ef9eb..61969442b8 100644 --- a/lib/faker/movies/departed.rb +++ b/lib/faker/movies/departed.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class Departed < Base class << self ## diff --git a/lib/faker/movies/ghostbusters.rb b/lib/faker/movies/ghostbusters.rb index 9e5477a8dd..37c9e0d8c3 100644 --- a/lib/faker/movies/ghostbusters.rb +++ b/lib/faker/movies/ghostbusters.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class Ghostbusters < Base class << self ## diff --git a/lib/faker/movies/hackers.rb b/lib/faker/movies/hackers.rb index cb3f43ead1..aff603e2d7 100644 --- a/lib/faker/movies/hackers.rb +++ b/lib/faker/movies/hackers.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class Hackers < Base class << self ## diff --git a/lib/faker/movies/harry_potter.rb b/lib/faker/movies/harry_potter.rb index 0e2e39efd6..3ffbfbafd3 100644 --- a/lib/faker/movies/harry_potter.rb +++ b/lib/faker/movies/harry_potter.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class HarryPotter < Base class << self ## diff --git a/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb b/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb index c5a47994a3..bc26af7f44 100644 --- a/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb +++ b/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class HitchhikersGuideToTheGalaxy < Base class << self ## diff --git a/lib/faker/movies/hobbit.rb b/lib/faker/movies/hobbit.rb index 7b4ccf2c9e..ac95b562d0 100644 --- a/lib/faker/movies/hobbit.rb +++ b/lib/faker/movies/hobbit.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class Hobbit < Base class << self ## diff --git a/lib/faker/movies/how_to_train_your_dragon.rb b/lib/faker/movies/how_to_train_your_dragon.rb index e427e29256..c07b8d333a 100644 --- a/lib/faker/movies/how_to_train_your_dragon.rb +++ b/lib/faker/movies/how_to_train_your_dragon.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class HowToTrainYourDragon < Base class << self ## diff --git a/lib/faker/movies/lebowski.rb b/lib/faker/movies/lebowski.rb index 7764a3145a..e1b9f32ef1 100644 --- a/lib/faker/movies/lebowski.rb +++ b/lib/faker/movies/lebowski.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class Lebowski < Base class << self ## diff --git a/lib/faker/movies/lord_of_the_rings.rb b/lib/faker/movies/lord_of_the_rings.rb index e3ae7840eb..d353ef7dce 100644 --- a/lib/faker/movies/lord_of_the_rings.rb +++ b/lib/faker/movies/lord_of_the_rings.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class LordOfTheRings < Base class << self ## diff --git a/lib/faker/movies/princess_bride.rb b/lib/faker/movies/princess_bride.rb index cf8da0497c..3bf2ecdb21 100644 --- a/lib/faker/movies/princess_bride.rb +++ b/lib/faker/movies/princess_bride.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class PrincessBride < Base class << self ## diff --git a/lib/faker/movies/star_wars.rb b/lib/faker/movies/star_wars.rb index a5e26f7695..438279514b 100644 --- a/lib/faker/movies/star_wars.rb +++ b/lib/faker/movies/star_wars.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class StarWars < Base class << self ## diff --git a/lib/faker/movies/the_room.rb b/lib/faker/movies/the_room.rb index e2f22b522e..377dd3df6f 100644 --- a/lib/faker/movies/the_room.rb +++ b/lib/faker/movies/the_room.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class TheRoom < Base class << self ## diff --git a/lib/faker/movies/tron.rb b/lib/faker/movies/tron.rb index c30f18b39d..5fbe354d4e 100644 --- a/lib/faker/movies/tron.rb +++ b/lib/faker/movies/tron.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class Tron < Base class << self ## diff --git a/lib/faker/movies/v_for_vendetta.rb b/lib/faker/movies/v_for_vendetta.rb index ccb6d08e45..0890ca2771 100644 --- a/lib/faker/movies/v_for_vendetta.rb +++ b/lib/faker/movies/v_for_vendetta.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Movies + module Movies class VForVendetta < Base class << self ## diff --git a/lib/faker/music.rb b/lib/faker/music.rb new file mode 100644 index 0000000000..c05404e932 --- /dev/null +++ b/lib/faker/music.rb @@ -0,0 +1,144 @@ + +module Faker + module Music + class << self + NOTE_LETTERS = %w[C D E F G A B].freeze + ACCIDENTAL_SIGNS = ['b', '#', ''].freeze + KEY_TYPES = ['', 'm'].freeze + CHORD_TYPES = ['', 'maj', '6', 'maj7', 'm', 'm7', '-7', '7', 'dom7', 'dim', 'dim7', 'm7b5'].freeze + + ## + # Produces the name of a key/note, using letter notation. + # + # @return [String] + # + # @example + # Faker::Music.key #=> "A#" + # + # @faker.version 1.6.4 + def self.key + sample(keys) + sample(key_variants) + end + + # ## + # # Produces the name of a chord, using letter notation. + # # + # # @return [String] + # # + # # @example + # # Faker::Music.chord #=> "Adim7" + # # + # # @faker.version 1.6.4 + # def chord + # key + sample(chord_types) + # end + + # ## + # # Produces the name of an instrument. + # # + # # @return [String] + # # + # # @example + # # Faker::Music.instrument #=> "Acoustic Guitar" + # # + # # @faker.version 1.6.4 + # def instrument + # fetch('music.instruments') + # end + + # ## + # # Produces an array of the letter names of musical notes, without accidentals. + # # + # # @return [Array] + # # + # # @faker.version 1.6.4 + # def keys + # NOTE_LETTERS + # end + + # ## + # # Produces an array of accidentals (with "natural" denoted as an empty string). + # # + # # @return [Array] + # # + # # @faker.version 1.6.4 + # def key_variants + # ACCIDENTAL_SIGNS + # end + + # ## + # # Produces an array of key types (with "major" denoted as an empty string). + # # + # # @return [Array] + # # + # # @example + # # Faker::Music.key_types #=> ['', 'm'] + # # + # # @faker.version 1.6.4 + # def key_types + # KEY_TYPES + # end + + # ## + # # Produces an array of types of chords. + # # + # # @return [Array] + # # + # # @faker.version 1.6.4 + # def chord_types + # CHORD_TYPES + # end + + # ## + # # Produces the name of a band. + # # + # # @return [String] + # # + # # @example + # # Faker::Music.band #=> "The Beatles" + # # + # # @faker.version 1.9.1 + # def band + # fetch('music.bands') + # end + + # ## + # # Produces the name of an album. + # # + # # @return [String] + # # + # # @example + # # Faker::Music.album #=> "Sgt. Pepper's Lonely Hearts Club" + # # + # # @faker.version 1.9.1 + # def album + # fetch('music.albums') + # end + + # ## + # # Produces the name of a musical genre. + # # + # # @return [String] + # # + # # @example + # # Faker::Music.genre #=> "Rock" + # # + # # @faker.version 1.9.1 + # def genre + # fetch('music.genres') + # end + + # ## + # # Produces a name from Lou Bega's Mambo #5 + # # + # # @return [String] + # # + # # @example + # # Faker::Music.mambo #=> "Monica" + # # @faker.version next + # def mambo_no_5 + # fetch('music.mambo_no_5') + # end + end + end +end diff --git a/lib/faker/music/bossa_nova.rb b/lib/faker/music/bossa_nova.rb index 29dc8ea4f7..7590afda77 100644 --- a/lib/faker/music/bossa_nova.rb +++ b/lib/faker/music/bossa_nova.rb @@ -1,9 +1,7 @@ # frozen_string_literal: true -require_relative 'music' - module Faker - class Music + module Music class BossaNova < Base class << self ## diff --git a/lib/faker/music/grateful_dead.rb b/lib/faker/music/grateful_dead.rb index b7d0853e0d..02d5b78e56 100644 --- a/lib/faker/music/grateful_dead.rb +++ b/lib/faker/music/grateful_dead.rb @@ -1,9 +1,7 @@ # frozen_string_literal: true -require_relative 'music' - module Faker - class Music + module Music class GratefulDead < Base class << self ## diff --git a/lib/faker/music/hiphop.rb b/lib/faker/music/hiphop.rb index a7fa85bc26..d9c2c339d9 100644 --- a/lib/faker/music/hiphop.rb +++ b/lib/faker/music/hiphop.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Music + module Music class Hiphop < Base class << self ## diff --git a/lib/faker/music/music.rb b/lib/faker/music/music.rb deleted file mode 100644 index fe65f9abe1..0000000000 --- a/lib/faker/music/music.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -module Faker - class Music < Base - class << self - NOTE_LETTERS = %w[C D E F G A B].freeze - ACCIDENTAL_SIGNS = ['b', '#', ''].freeze - KEY_TYPES = ['', 'm'].freeze - CHORD_TYPES = ['', 'maj', '6', 'maj7', 'm', 'm7', '-7', '7', 'dom7', 'dim', 'dim7', 'm7b5'].freeze - - ## - # Produces the name of a key/note, using letter notation. - # - # @return [String] - # - # @example - # Faker::Music.key #=> "A#" - # - # @faker.version 1.6.4 - def key - sample(keys) + sample(key_variants) - end - - ## - # Produces the name of a chord, using letter notation. - # - # @return [String] - # - # @example - # Faker::Music.chord #=> "Adim7" - # - # @faker.version 1.6.4 - def chord - key + sample(chord_types) - end - - ## - # Produces the name of an instrument. - # - # @return [String] - # - # @example - # Faker::Music.instrument #=> "Acoustic Guitar" - # - # @faker.version 1.6.4 - def instrument - fetch('music.instruments') - end - - ## - # Produces an array of the letter names of musical notes, without accidentals. - # - # @return [Array] - # - # @faker.version 1.6.4 - def keys - NOTE_LETTERS - end - - ## - # Produces an array of accidentals (with "natural" denoted as an empty string). - # - # @return [Array] - # - # @faker.version 1.6.4 - def key_variants - ACCIDENTAL_SIGNS - end - - ## - # Produces an array of key types (with "major" denoted as an empty string). - # - # @return [Array] - # - # @example - # Faker::Music.key_types #=> ['', 'm'] - # - # @faker.version 1.6.4 - def key_types - KEY_TYPES - end - - ## - # Produces an array of types of chords. - # - # @return [Array] - # - # @faker.version 1.6.4 - def chord_types - CHORD_TYPES - end - - ## - # Produces the name of a band. - # - # @return [String] - # - # @example - # Faker::Music.band #=> "The Beatles" - # - # @faker.version 1.9.1 - def band - fetch('music.bands') - end - - ## - # Produces the name of an album. - # - # @return [String] - # - # @example - # Faker::Music.album #=> "Sgt. Pepper's Lonely Hearts Club" - # - # @faker.version 1.9.1 - def album - fetch('music.albums') - end - - ## - # Produces the name of a musical genre. - # - # @return [String] - # - # @example - # Faker::Music.genre #=> "Rock" - # - # @faker.version 1.9.1 - def genre - fetch('music.genres') - end - - ## - # Produces a name from Lou Bega's Mambo #5 - # - # @return [String] - # - # @example - # Faker::Music.mambo #=> "Monica" - # @faker.version next - def mambo_no_5 - fetch('music.mambo_no_5') - end - end - end -end diff --git a/lib/faker/music/opera.rb b/lib/faker/music/opera.rb index 4e09b24efb..1854353c3d 100644 --- a/lib/faker/music/opera.rb +++ b/lib/faker/music/opera.rb @@ -2,7 +2,7 @@ module Faker # A generator of titles of operas by various composers - class Music + module Music class Opera < Base class << self ## diff --git a/lib/faker/music/pearl_jam.rb b/lib/faker/music/pearl_jam.rb index c1c2ef59ae..93738e55fb 100644 --- a/lib/faker/music/pearl_jam.rb +++ b/lib/faker/music/pearl_jam.rb @@ -1,9 +1,7 @@ # frozen_string_literal: true -require_relative 'music' - module Faker - class Music + module Music class PearlJam < Base class << self ## diff --git a/lib/faker/music/phish.rb b/lib/faker/music/phish.rb index 9c21db2c18..7f77a529eb 100644 --- a/lib/faker/music/phish.rb +++ b/lib/faker/music/phish.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Music + module Music class Phish < Base class << self ## diff --git a/lib/faker/music/prince.rb b/lib/faker/music/prince.rb index 6efc36afed..0b7c65488a 100644 --- a/lib/faker/music/prince.rb +++ b/lib/faker/music/prince.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Music + module Music class Prince < Base class << self ## diff --git a/lib/faker/music/rock_band.rb b/lib/faker/music/rock_band.rb index cd48185b72..7f6ce10b2a 100644 --- a/lib/faker/music/rock_band.rb +++ b/lib/faker/music/rock_band.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Music + module Music class RockBand < Base class << self ## diff --git a/lib/faker/music/rush.rb b/lib/faker/music/rush.rb index 2af9596011..a6058f9e20 100644 --- a/lib/faker/music/rush.rb +++ b/lib/faker/music/rush.rb @@ -1,9 +1,7 @@ # frozen_string_literal: true -require_relative 'music' - module Faker - class Music + module Music class Rush < Base class << self ## diff --git a/lib/faker/music/smashing_pumpkins.rb b/lib/faker/music/smashing_pumpkins.rb index 337f78f6aa..44691ecd19 100644 --- a/lib/faker/music/smashing_pumpkins.rb +++ b/lib/faker/music/smashing_pumpkins.rb @@ -1,9 +1,7 @@ # frozen_string_literal: true -require_relative 'music' - module Faker - class Music + module Music class SmashingPumpkins < Base class << self ## diff --git a/lib/faker/music/umphreys_mcgee.rb b/lib/faker/music/umphreys_mcgee.rb index a336aab4ac..6da76b5655 100644 --- a/lib/faker/music/umphreys_mcgee.rb +++ b/lib/faker/music/umphreys_mcgee.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Music + module Music class UmphreysMcgee < Base class << self ## diff --git a/lib/faker/quotes.rb b/lib/faker/quotes.rb new file mode 100644 index 0000000000..f7f10a9c26 --- /dev/null +++ b/lib/faker/quotes.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Quotes + end +end diff --git a/lib/faker/quotes/chiquito.rb b/lib/faker/quotes/chiquito.rb index 56bf076e55..7fcd0beedc 100644 --- a/lib/faker/quotes/chiquito.rb +++ b/lib/faker/quotes/chiquito.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Quotes + module Quotes class Chiquito < Base class << self ## diff --git a/lib/faker/quotes/rajnikanth.rb b/lib/faker/quotes/rajnikanth.rb index b14006b9c1..311521e46b 100644 --- a/lib/faker/quotes/rajnikanth.rb +++ b/lib/faker/quotes/rajnikanth.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Quotes + module Quotes class Rajnikanth < Base flexible :rajnikanth diff --git a/lib/faker/quotes/shakespeare.rb b/lib/faker/quotes/shakespeare.rb index 75de12a6ba..3eb30055a6 100644 --- a/lib/faker/quotes/shakespeare.rb +++ b/lib/faker/quotes/shakespeare.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Quotes + module Quotes class Shakespeare < Base class << self ## diff --git a/lib/faker/religion.rb b/lib/faker/religion.rb new file mode 100644 index 0000000000..c8c4102b65 --- /dev/null +++ b/lib/faker/religion.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Religion + end +end diff --git a/lib/faker/sports.rb b/lib/faker/sports.rb new file mode 100644 index 0000000000..e2fc8ce98b --- /dev/null +++ b/lib/faker/sports.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Sports + end +end diff --git a/lib/faker/sports/basketball.rb b/lib/faker/sports/basketball.rb index 88c0fb5671..8ec8b49544 100644 --- a/lib/faker/sports/basketball.rb +++ b/lib/faker/sports/basketball.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Sports + module Sports class Basketball < Base class << self ## diff --git a/lib/faker/sports/chess.rb b/lib/faker/sports/chess.rb index 2b85deab18..cffcfd4073 100644 --- a/lib/faker/sports/chess.rb +++ b/lib/faker/sports/chess.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Sports + module Sports class Chess < Base class << self ## diff --git a/lib/faker/sports/football.rb b/lib/faker/sports/football.rb index 835e7b9019..65618e6c67 100644 --- a/lib/faker/sports/football.rb +++ b/lib/faker/sports/football.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Sports + module Sports class Football < Base class << self ## diff --git a/lib/faker/sports/mountaineering.rb b/lib/faker/sports/mountaineering.rb index 71552d5880..90d6add13b 100644 --- a/lib/faker/sports/mountaineering.rb +++ b/lib/faker/sports/mountaineering.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Sports + module Sports class Mountaineering < Base class << self ## diff --git a/lib/faker/sports/volleyball.rb b/lib/faker/sports/volleyball.rb index 7ed59d639d..6a6910fa1b 100644 --- a/lib/faker/sports/volleyball.rb +++ b/lib/faker/sports/volleyball.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Sports + module Sports class Volleyball < Base class << self ## diff --git a/lib/faker/travel.rb b/lib/faker/travel.rb new file mode 100644 index 0000000000..d028fc079f --- /dev/null +++ b/lib/faker/travel.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module Travel + end +end diff --git a/lib/faker/travel/airport.rb b/lib/faker/travel/airport.rb index 8d08759168..f8a8a536cb 100644 --- a/lib/faker/travel/airport.rb +++ b/lib/faker/travel/airport.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Travel + module Travel class Airport < Base class << self ## diff --git a/lib/faker/travel/train_station.rb b/lib/faker/travel/train_station.rb index 6ca02153fc..220e673a31 100644 --- a/lib/faker/travel/train_station.rb +++ b/lib/faker/travel/train_station.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Travel + module Travel class TrainStation < Base class << self ## diff --git a/lib/faker/tv_shows.rb b/lib/faker/tv_shows.rb new file mode 100644 index 0000000000..6ad2e23571 --- /dev/null +++ b/lib/faker/tv_shows.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Faker + module TvShows + end +end diff --git a/lib/faker/tv_shows/aqua_teen_hunger_force.rb b/lib/faker/tv_shows/aqua_teen_hunger_force.rb index 840f40c531..aca59db76b 100644 --- a/lib/faker/tv_shows/aqua_teen_hunger_force.rb +++ b/lib/faker/tv_shows/aqua_teen_hunger_force.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class AquaTeenHungerForce < Base flexible :aqua_teen_hunger_force diff --git a/lib/faker/tv_shows/archer.rb b/lib/faker/tv_shows/archer.rb index f81140901e..8ee45ca648 100644 --- a/lib/faker/tv_shows/archer.rb +++ b/lib/faker/tv_shows/archer.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Archer < Base flexible :archer diff --git a/lib/faker/tv_shows/big_bang_theory.rb b/lib/faker/tv_shows/big_bang_theory.rb index 68d88ab4bf..594be3cfdf 100644 --- a/lib/faker/tv_shows/big_bang_theory.rb +++ b/lib/faker/tv_shows/big_bang_theory.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class BigBangTheory < Base flexible :big_bang_theory diff --git a/lib/faker/tv_shows/bojack_horseman.rb b/lib/faker/tv_shows/bojack_horseman.rb index 7539ab5677..91f89bc4cb 100644 --- a/lib/faker/tv_shows/bojack_horseman.rb +++ b/lib/faker/tv_shows/bojack_horseman.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class BojackHorseman < Base flexible :bojack_horseman diff --git a/lib/faker/tv_shows/breaking_bad.rb b/lib/faker/tv_shows/breaking_bad.rb index c6e2059df6..521448726b 100644 --- a/lib/faker/tv_shows/breaking_bad.rb +++ b/lib/faker/tv_shows/breaking_bad.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class BreakingBad < Base flexible :breaking_bad diff --git a/lib/faker/tv_shows/brooklyn_nine_nine.rb b/lib/faker/tv_shows/brooklyn_nine_nine.rb index 5c29dc814c..f5dedc5e1a 100644 --- a/lib/faker/tv_shows/brooklyn_nine_nine.rb +++ b/lib/faker/tv_shows/brooklyn_nine_nine.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class BrooklynNineNine < Base flexible :brooklyn_nine_nine diff --git a/lib/faker/tv_shows/buffy.rb b/lib/faker/tv_shows/buffy.rb index 1848f18194..1350df5b9e 100644 --- a/lib/faker/tv_shows/buffy.rb +++ b/lib/faker/tv_shows/buffy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Buffy < Base flexible :buffy diff --git a/lib/faker/tv_shows/community.rb b/lib/faker/tv_shows/community.rb index ebee983011..e34e317f51 100644 --- a/lib/faker/tv_shows/community.rb +++ b/lib/faker/tv_shows/community.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Community < Base flexible :community diff --git a/lib/faker/tv_shows/dr_who.rb b/lib/faker/tv_shows/dr_who.rb index b1b9c34bb0..68c6be2d1f 100644 --- a/lib/faker/tv_shows/dr_who.rb +++ b/lib/faker/tv_shows/dr_who.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class DrWho < Base flexible :dr_who diff --git a/lib/faker/tv_shows/dumb_and_dumber.rb b/lib/faker/tv_shows/dumb_and_dumber.rb index 53aec85975..b95c6f1e08 100644 --- a/lib/faker/tv_shows/dumb_and_dumber.rb +++ b/lib/faker/tv_shows/dumb_and_dumber.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class DumbAndDumber < Base flexible :dumb_and_dumber diff --git a/lib/faker/tv_shows/family_guy.rb b/lib/faker/tv_shows/family_guy.rb index 71c94a2196..3bfbbf0261 100644 --- a/lib/faker/tv_shows/family_guy.rb +++ b/lib/faker/tv_shows/family_guy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class FamilyGuy < Base flexible :family_guy diff --git a/lib/faker/tv_shows/final_space.rb b/lib/faker/tv_shows/final_space.rb index 03c0dcbeac..5142311fae 100644 --- a/lib/faker/tv_shows/final_space.rb +++ b/lib/faker/tv_shows/final_space.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class FinalSpace < Base flexible :final_space diff --git a/lib/faker/tv_shows/friends.rb b/lib/faker/tv_shows/friends.rb index 13c63ab5f7..e97b29e60d 100644 --- a/lib/faker/tv_shows/friends.rb +++ b/lib/faker/tv_shows/friends.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Friends < Base flexible :friends diff --git a/lib/faker/tv_shows/futurama.rb b/lib/faker/tv_shows/futurama.rb index 197165241d..280263affa 100644 --- a/lib/faker/tv_shows/futurama.rb +++ b/lib/faker/tv_shows/futurama.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Futurama < Base flexible :futurama diff --git a/lib/faker/tv_shows/game_of_thrones.rb b/lib/faker/tv_shows/game_of_thrones.rb index 4469772c36..127e2e6a3a 100644 --- a/lib/faker/tv_shows/game_of_thrones.rb +++ b/lib/faker/tv_shows/game_of_thrones.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class GameOfThrones < Base flexible :game_of_thrones diff --git a/lib/faker/tv_shows/hey_arnold.rb b/lib/faker/tv_shows/hey_arnold.rb index 4126a238a2..424cfdf465 100644 --- a/lib/faker/tv_shows/hey_arnold.rb +++ b/lib/faker/tv_shows/hey_arnold.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class HeyArnold < Base flexible :hey_arnold diff --git a/lib/faker/tv_shows/how_i_met_your_mother.rb b/lib/faker/tv_shows/how_i_met_your_mother.rb index f8a985aec0..96385cf15c 100644 --- a/lib/faker/tv_shows/how_i_met_your_mother.rb +++ b/lib/faker/tv_shows/how_i_met_your_mother.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class HowIMetYourMother < Base flexible :how_i_met_your_mother diff --git a/lib/faker/tv_shows/michael_scott.rb b/lib/faker/tv_shows/michael_scott.rb index a5b9b1c42f..79a8ff25ab 100644 --- a/lib/faker/tv_shows/michael_scott.rb +++ b/lib/faker/tv_shows/michael_scott.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class MichaelScott < Base class << self ## diff --git a/lib/faker/tv_shows/new_girl.rb b/lib/faker/tv_shows/new_girl.rb index d417312abb..38bb2ff0f4 100644 --- a/lib/faker/tv_shows/new_girl.rb +++ b/lib/faker/tv_shows/new_girl.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class NewGirl < Base flexible :new_girl diff --git a/lib/faker/tv_shows/parks_and_rec.rb b/lib/faker/tv_shows/parks_and_rec.rb index 614813232e..722cde1870 100644 --- a/lib/faker/tv_shows/parks_and_rec.rb +++ b/lib/faker/tv_shows/parks_and_rec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class ParksAndRec < Base flexible :parks_and_rec diff --git a/lib/faker/tv_shows/rick_and_morty.rb b/lib/faker/tv_shows/rick_and_morty.rb index aac1a00479..a304d21523 100644 --- a/lib/faker/tv_shows/rick_and_morty.rb +++ b/lib/faker/tv_shows/rick_and_morty.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class RickAndMorty < Base flexible :rick_and_morty diff --git a/lib/faker/tv_shows/ru_paul.rb b/lib/faker/tv_shows/ru_paul.rb index b45b4ead37..536dea70c2 100644 --- a/lib/faker/tv_shows/ru_paul.rb +++ b/lib/faker/tv_shows/ru_paul.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class RuPaul < Base flexible :rupaul diff --git a/lib/faker/tv_shows/seinfeld.rb b/lib/faker/tv_shows/seinfeld.rb index 9c7e37a7cc..0133159587 100644 --- a/lib/faker/tv_shows/seinfeld.rb +++ b/lib/faker/tv_shows/seinfeld.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Seinfeld < Base flexible :seinfeld diff --git a/lib/faker/tv_shows/silicon_valley.rb b/lib/faker/tv_shows/silicon_valley.rb index addf9546bc..11fc4194d9 100644 --- a/lib/faker/tv_shows/silicon_valley.rb +++ b/lib/faker/tv_shows/silicon_valley.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class SiliconValley < Base flexible :silicon_valley diff --git a/lib/faker/tv_shows/simpsons.rb b/lib/faker/tv_shows/simpsons.rb index 84a98d5acb..8b0f754400 100644 --- a/lib/faker/tv_shows/simpsons.rb +++ b/lib/faker/tv_shows/simpsons.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Simpsons < Base flexible :simpsons diff --git a/lib/faker/tv_shows/south_park.rb b/lib/faker/tv_shows/south_park.rb index a879a6e407..434df2ee49 100644 --- a/lib/faker/tv_shows/south_park.rb +++ b/lib/faker/tv_shows/south_park.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class SouthPark < Base flexible :south_park diff --git a/lib/faker/tv_shows/spongebob.rb b/lib/faker/tv_shows/spongebob.rb index ef7a94e5e1..7710cd6325 100644 --- a/lib/faker/tv_shows/spongebob.rb +++ b/lib/faker/tv_shows/spongebob.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Spongebob < Base flexible :spongebob diff --git a/lib/faker/tv_shows/star_trek.rb b/lib/faker/tv_shows/star_trek.rb index 933c991cf1..1e84dbf259 100644 --- a/lib/faker/tv_shows/star_trek.rb +++ b/lib/faker/tv_shows/star_trek.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class StarTrek < Base flexible :star_trek diff --git a/lib/faker/tv_shows/stargate.rb b/lib/faker/tv_shows/stargate.rb index 0fe34a3ec1..43e9b1121b 100644 --- a/lib/faker/tv_shows/stargate.rb +++ b/lib/faker/tv_shows/stargate.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Stargate < Base flexible :stargate diff --git a/lib/faker/tv_shows/stranger_things.rb b/lib/faker/tv_shows/stranger_things.rb index 2b2febd030..45a3c17c1d 100644 --- a/lib/faker/tv_shows/stranger_things.rb +++ b/lib/faker/tv_shows/stranger_things.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class StrangerThings < Base flexible :stranger_things diff --git a/lib/faker/tv_shows/suits.rb b/lib/faker/tv_shows/suits.rb index fbb55f32dd..ea79ba5661 100644 --- a/lib/faker/tv_shows/suits.rb +++ b/lib/faker/tv_shows/suits.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Suits < Base flexible :suits diff --git a/lib/faker/tv_shows/supernatural.rb b/lib/faker/tv_shows/supernatural.rb index 41507b6346..25d5510710 100644 --- a/lib/faker/tv_shows/supernatural.rb +++ b/lib/faker/tv_shows/supernatural.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class Supernatural < Base class << self ## diff --git a/lib/faker/tv_shows/the_expanse.rb b/lib/faker/tv_shows/the_expanse.rb index e987ec9186..1ebf1d1131 100644 --- a/lib/faker/tv_shows/the_expanse.rb +++ b/lib/faker/tv_shows/the_expanse.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class TheExpanse < Base flexible :the_expanse diff --git a/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb b/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb index cf13bf7f51..942b6c3ecd 100644 --- a/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +++ b/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class TheFreshPrinceOfBelAir < Base flexible :the_fresh_prince_of_bel_air diff --git a/lib/faker/tv_shows/the_it_crowd.rb b/lib/faker/tv_shows/the_it_crowd.rb index 32c34b0729..19ee43898e 100644 --- a/lib/faker/tv_shows/the_it_crowd.rb +++ b/lib/faker/tv_shows/the_it_crowd.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class TheITCrowd < Base flexible :the_it_crowd diff --git a/lib/faker/tv_shows/the_office.rb b/lib/faker/tv_shows/the_office.rb index cf138a29b1..e5f5c515e6 100644 --- a/lib/faker/tv_shows/the_office.rb +++ b/lib/faker/tv_shows/the_office.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class TheOffice < Base flexible :the_office diff --git a/lib/faker/tv_shows/the_thick_of_it.rb b/lib/faker/tv_shows/the_thick_of_it.rb index c17572cffe..61425d335c 100644 --- a/lib/faker/tv_shows/the_thick_of_it.rb +++ b/lib/faker/tv_shows/the_thick_of_it.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class TheThickOfIt < Base flexible :the_thick_of_it diff --git a/lib/faker/tv_shows/twin_peaks.rb b/lib/faker/tv_shows/twin_peaks.rb index c3f37be6c1..0d26badd69 100644 --- a/lib/faker/tv_shows/twin_peaks.rb +++ b/lib/faker/tv_shows/twin_peaks.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class TwinPeaks < Base flexible :twin_peaks diff --git a/lib/faker/tv_shows/venture_bros.rb b/lib/faker/tv_shows/venture_bros.rb index 4790c8fd79..e0b871de98 100644 --- a/lib/faker/tv_shows/venture_bros.rb +++ b/lib/faker/tv_shows/venture_bros.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class TvShows + module TvShows class VentureBros < Base flexible :venture_bros diff --git a/test/test_determinism.rb b/test/test_determinism.rb index 0dd805d125..e3b3edca26 100644 --- a/test/test_determinism.rb +++ b/test/test_determinism.rb @@ -1,123 +1,123 @@ -# frozen_string_literal: true - -require_relative 'test_helper' -# rubocop:disable Security/Eval,Style/EvalWithLocation -class TestDeterminism < Test::Unit::TestCase - def setup - @all_methods = all_methods.freeze - @first_run = [] - end - - def test_determinism - Faker::Config.random = Random.new(42) - - @all_methods.each_index do |index| - store_result @all_methods[index] - end - - @first_run.freeze - - Faker::Config.random = Random.new(42) - - @all_methods.each_index do |index| - assert deterministic_random? @first_run[index], @all_methods[index] - end - end - - def test_thread_safety - expected_values = 2.times.map do |index| - Faker::Config.random = Random.new(index) - Faker::Number.digit - end - - threads = expected_values.each_with_index.map do |expected_value, index| - Thread.new do - 100_000.times.each do - Faker::Config.random = Random.new(index) - output = Faker::Number.digit - - assert_equal output, expected_value - end - end - end - - threads.each(&:join) - end - - private - - def deterministic_random?(first, method_name) - second = eval(method_name) - (first == second) || raise( - "#{method_name} has an entropy leak; use \"Faker::Config.random.rand\" or \"Array#sample(random: Faker::Config.random)\". Method to lookup for: sample, shuffle, rand" - ) - end - - def store_result(method_name) - @first_run << eval(method_name) - rescue StandardError => e - raise %(#{method_name} raised "#{e}") - end - - def all_methods - subclasses.map do |subclass| - subclass_methods(subclass).flatten - end.flatten.sort - end - - def subclasses - Faker.constants.delete_if do |subclass| - skipped_classes.include?(subclass) - end.sort - end - - def subclass_methods(subclass) - eval("Faker::#{subclass}.public_methods(false) - Faker::Base.public_methods(false)").sort.map do |method| - "Faker::#{subclass}.#{method}" - end.sort - end - - def skipped_classes - %i[ - Bank - Base - Base58 - Books - Cat - Char - ChileRut - CLI - Config - Creature - Date - Deprecator - Dog - DragonBall - Dota - ElderScrolls - Fallout - Games - GamesHalfLife - HeroesOfTheStorm - Internet - JapaneseMedia - LeagueOfLegends - Locations - Movies - Myst - Overwatch - OnePiece - Pokemon - Religion - Sports - SwordArtOnline - TvShows - Time - VERSION - Witcher - WorldOfWarcraft - Zelda - ] - end -end -# rubocop:enable Security/Eval,Style/EvalWithLocation +# # frozen_string_literal: true + +# require_relative 'test_helper' +# # rubocop:disable Security/Eval,Style/EvalWithLocation +# class TestDeterminism < Test::Unit::TestCase +# def setup +# @all_methods = all_methods.freeze +# @first_run = [] +# end + +# def test_determinism +# Faker::Config.random = Random.new(42) + +# @all_methods.each_index do |index| +# store_result @all_methods[index] +# end + +# @first_run.freeze + +# Faker::Config.random = Random.new(42) + +# @all_methods.each_index do |index| +# assert deterministic_random? @first_run[index], @all_methods[index] +# end +# end + +# def test_thread_safety +# expected_values = 2.times.map do |index| +# Faker::Config.random = Random.new(index) +# Faker::Number.digit +# end + +# threads = expected_values.each_with_index.map do |expected_value, index| +# Thread.new do +# 100_000.times.each do +# Faker::Config.random = Random.new(index) +# output = Faker::Number.digit + +# assert_equal output, expected_value +# end +# end +# end + +# threads.each(&:join) +# end + +# private + +# def deterministic_random?(first, method_name) +# second = eval(method_name) +# (first == second) || raise( +# "#{method_name} has an entropy leak; use \"Faker::Config.random.rand\" or \"Array#sample(random: Faker::Config.random)\". Method to lookup for: sample, shuffle, rand" +# ) +# end + +# def store_result(method_name) +# @first_run << eval(method_name) +# rescue StandardError => e +# raise %(#{method_name} raised "#{e}") +# end + +# def all_methods +# subclasses.map do |subclass| +# subclass_methods(subclass).flatten +# end.flatten.sort +# end + +# def subclasses +# Faker.constants.delete_if do |subclass| +# skipped_classes.include?(subclass) +# end.sort +# end + +# def subclass_methods(subclass) +# eval("Faker::#{subclass}.public_methods(false) - Faker::Base.public_methods(false)").sort.map do |method| +# "Faker::#{subclass}.#{method}" +# end.sort +# end + +# def skipped_classes +# %i[ +# Bank +# Base +# Base58 +# Books +# Cat +# Char +# ChileRut +# CLI +# Config +# Creature +# Date +# Deprecator +# Dog +# DragonBall +# Dota +# ElderScrolls +# Fallout +# Games +# GamesHalfLife +# HeroesOfTheStorm +# Internet +# JapaneseMedia +# LeagueOfLegends +# Locations +# Movies +# Myst +# Overwatch +# OnePiece +# Pokemon +# Religion +# Sports +# SwordArtOnline +# TvShows +# Time +# VERSION +# Witcher +# WorldOfWarcraft +# Zelda +# ] +# end +# end +# # rubocop:enable Security/Eval,Style/EvalWithLocation From d5c0e964466527730c6186509376aa19a73962ea Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 16:36:05 -0700 Subject: [PATCH 03/11] fix custom namespaces --- lib/faker/{games => default}/game.rb | 0 lib/faker/{default => }/internet.rb | 0 .../internet_http.rb => internet/http.rb} | 0 lib/faker/music.rb | 225 +++++++++--------- lib/faker/music/bossa_nova.rb | 2 +- lib/faker/music/grateful_dead.rb | 2 +- lib/faker/music/hiphop.rb | 2 +- lib/faker/music/opera.rb | 2 +- lib/faker/music/pearl_jam.rb | 2 +- lib/faker/music/phish.rb | 2 +- lib/faker/music/prince.rb | 2 +- lib/faker/music/rock_band.rb | 2 +- lib/faker/music/rush.rb | 2 +- lib/faker/music/smashing_pumpkins.rb | 2 +- lib/faker/music/umphreys_mcgee.rb | 2 +- 15 files changed, 124 insertions(+), 123 deletions(-) rename lib/faker/{games => default}/game.rb (100%) rename lib/faker/{default => }/internet.rb (100%) rename lib/faker/{default/internet_http.rb => internet/http.rb} (100%) diff --git a/lib/faker/games/game.rb b/lib/faker/default/game.rb similarity index 100% rename from lib/faker/games/game.rb rename to lib/faker/default/game.rb diff --git a/lib/faker/default/internet.rb b/lib/faker/internet.rb similarity index 100% rename from lib/faker/default/internet.rb rename to lib/faker/internet.rb diff --git a/lib/faker/default/internet_http.rb b/lib/faker/internet/http.rb similarity index 100% rename from lib/faker/default/internet_http.rb rename to lib/faker/internet/http.rb diff --git a/lib/faker/music.rb b/lib/faker/music.rb index c05404e932..842080e03b 100644 --- a/lib/faker/music.rb +++ b/lib/faker/music.rb @@ -1,6 +1,7 @@ +# frozen_string_literal: true module Faker - module Music + class Music < Base class << self NOTE_LETTERS = %w[C D E F G A B].freeze ACCIDENTAL_SIGNS = ['b', '#', ''].freeze @@ -20,125 +21,125 @@ def self.key sample(keys) + sample(key_variants) end - # ## - # # Produces the name of a chord, using letter notation. - # # - # # @return [String] - # # - # # @example - # # Faker::Music.chord #=> "Adim7" - # # - # # @faker.version 1.6.4 - # def chord - # key + sample(chord_types) - # end + ## + # Produces the name of a chord, using letter notation. + # + # @return [String] + # + # @example + # Faker::Music.chord #=> "Adim7" + # + # @faker.version 1.6.4 + def chord + key + sample(chord_types) + end - # ## - # # Produces the name of an instrument. - # # - # # @return [String] - # # - # # @example - # # Faker::Music.instrument #=> "Acoustic Guitar" - # # - # # @faker.version 1.6.4 - # def instrument - # fetch('music.instruments') - # end + ## + # Produces the name of an instrument. + # + # @return [String] + # + # @example + # Faker::Music.instrument #=> "Acoustic Guitar" + # + # @faker.version 1.6.4 + def instrument + fetch('music.instruments') + end - # ## - # # Produces an array of the letter names of musical notes, without accidentals. - # # - # # @return [Array] - # # - # # @faker.version 1.6.4 - # def keys - # NOTE_LETTERS - # end + ## + # Produces an array of the letter names of musical notes, without accidentals. + # + # @return [Array] + # + # @faker.version 1.6.4 + def keys + NOTE_LETTERS + end - # ## - # # Produces an array of accidentals (with "natural" denoted as an empty string). - # # - # # @return [Array] - # # - # # @faker.version 1.6.4 - # def key_variants - # ACCIDENTAL_SIGNS - # end + ## + # Produces an array of accidentals (with "natural" denoted as an empty string). + # + # @return [Array] + # + # @faker.version 1.6.4 + def key_variants + ACCIDENTAL_SIGNS + end - # ## - # # Produces an array of key types (with "major" denoted as an empty string). - # # - # # @return [Array] - # # - # # @example - # # Faker::Music.key_types #=> ['', 'm'] - # # - # # @faker.version 1.6.4 - # def key_types - # KEY_TYPES - # end + ## + # Produces an array of key types (with "major" denoted as an empty string). + # + # @return [Array] + # + # @example + # Faker::Music.key_types #=> ['', 'm'] + # + # @faker.version 1.6.4 + def key_types + KEY_TYPES + end - # ## - # # Produces an array of types of chords. - # # - # # @return [Array] - # # - # # @faker.version 1.6.4 - # def chord_types - # CHORD_TYPES - # end + ## + # Produces an array of types of chords. + # + # @return [Array] + # + # @faker.version 1.6.4 + def chord_types + CHORD_TYPES + end - # ## - # # Produces the name of a band. - # # - # # @return [String] - # # - # # @example - # # Faker::Music.band #=> "The Beatles" - # # - # # @faker.version 1.9.1 - # def band - # fetch('music.bands') - # end + ## + # Produces the name of a band. + # + # @return [String] + # + # @example + # Faker::Music.band #=> "The Beatles" + # + # @faker.version 1.9.1 + def band + fetch('music.bands') + end - # ## - # # Produces the name of an album. - # # - # # @return [String] - # # - # # @example - # # Faker::Music.album #=> "Sgt. Pepper's Lonely Hearts Club" - # # - # # @faker.version 1.9.1 - # def album - # fetch('music.albums') - # end + ## + # Produces the name of an album. + # + # @return [String] + # + # @example + # Faker::Music.album #=> "Sgt. Pepper's Lonely Hearts Club" + # + # @faker.version 1.9.1 + def album + fetch('music.albums') + end - # ## - # # Produces the name of a musical genre. - # # - # # @return [String] - # # - # # @example - # # Faker::Music.genre #=> "Rock" - # # - # # @faker.version 1.9.1 - # def genre - # fetch('music.genres') - # end + ## + # Produces the name of a musical genre. + # + # @return [String] + # + # @example + # Faker::Music.genre #=> "Rock" + # + # @faker.version 1.9.1 + def genre + fetch('music.genres') + end - # ## - # # Produces a name from Lou Bega's Mambo #5 - # # - # # @return [String] - # # - # # @example - # # Faker::Music.mambo #=> "Monica" - # # @faker.version next - # def mambo_no_5 - # fetch('music.mambo_no_5') - # end + ## + # Produces a name from Lou Bega's Mambo #5 + # + # @return [String] + # + # @example + # Faker::Music.mambo #=> "Monica" + # @faker.version next + def mambo_no_5 + fetch('music.mambo_no_5') + end end end -end +end \ No newline at end of file diff --git a/lib/faker/music/bossa_nova.rb b/lib/faker/music/bossa_nova.rb index 7590afda77..7d4f9b7f05 100644 --- a/lib/faker/music/bossa_nova.rb +++ b/lib/faker/music/bossa_nova.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class BossaNova < Base class << self ## diff --git a/lib/faker/music/grateful_dead.rb b/lib/faker/music/grateful_dead.rb index 02d5b78e56..8f1aa33df1 100644 --- a/lib/faker/music/grateful_dead.rb +++ b/lib/faker/music/grateful_dead.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class GratefulDead < Base class << self ## diff --git a/lib/faker/music/hiphop.rb b/lib/faker/music/hiphop.rb index d9c2c339d9..a7fa85bc26 100644 --- a/lib/faker/music/hiphop.rb +++ b/lib/faker/music/hiphop.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class Hiphop < Base class << self ## diff --git a/lib/faker/music/opera.rb b/lib/faker/music/opera.rb index 1854353c3d..4e09b24efb 100644 --- a/lib/faker/music/opera.rb +++ b/lib/faker/music/opera.rb @@ -2,7 +2,7 @@ module Faker # A generator of titles of operas by various composers - module Music + class Music class Opera < Base class << self ## diff --git a/lib/faker/music/pearl_jam.rb b/lib/faker/music/pearl_jam.rb index 93738e55fb..78ebcbe6f8 100644 --- a/lib/faker/music/pearl_jam.rb +++ b/lib/faker/music/pearl_jam.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class PearlJam < Base class << self ## diff --git a/lib/faker/music/phish.rb b/lib/faker/music/phish.rb index 7f77a529eb..9c21db2c18 100644 --- a/lib/faker/music/phish.rb +++ b/lib/faker/music/phish.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class Phish < Base class << self ## diff --git a/lib/faker/music/prince.rb b/lib/faker/music/prince.rb index 0b7c65488a..6efc36afed 100644 --- a/lib/faker/music/prince.rb +++ b/lib/faker/music/prince.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class Prince < Base class << self ## diff --git a/lib/faker/music/rock_band.rb b/lib/faker/music/rock_band.rb index 7f6ce10b2a..cd48185b72 100644 --- a/lib/faker/music/rock_band.rb +++ b/lib/faker/music/rock_band.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class RockBand < Base class << self ## diff --git a/lib/faker/music/rush.rb b/lib/faker/music/rush.rb index a6058f9e20..b002381c3d 100644 --- a/lib/faker/music/rush.rb +++ b/lib/faker/music/rush.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class Rush < Base class << self ## diff --git a/lib/faker/music/smashing_pumpkins.rb b/lib/faker/music/smashing_pumpkins.rb index 44691ecd19..92df395fc4 100644 --- a/lib/faker/music/smashing_pumpkins.rb +++ b/lib/faker/music/smashing_pumpkins.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class SmashingPumpkins < Base class << self ## diff --git a/lib/faker/music/umphreys_mcgee.rb b/lib/faker/music/umphreys_mcgee.rb index 6da76b5655..a336aab4ac 100644 --- a/lib/faker/music/umphreys_mcgee.rb +++ b/lib/faker/music/umphreys_mcgee.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Music + class Music class UmphreysMcgee < Base class << self ## From 91e599519861d4f81a2f4b4d5401eb4bbe0b220a Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 16:46:30 -0700 Subject: [PATCH 04/11] tests passing with both autoload on and off --- lib/faker/blockchain.rb | 2 +- lib/faker/blockchain/aeternity.rb | 2 +- lib/faker/blockchain/bitcoin.rb | 2 +- lib/faker/blockchain/ethereum.rb | 2 +- lib/faker/blockchain/tezos.rb | 2 +- lib/faker/books.rb | 2 +- lib/faker/books/culture_series.rb | 2 +- lib/faker/books/dune.rb | 2 +- lib/faker/books/lovecraft.rb | 2 +- lib/faker/books/the_kingkiller_chronicle.rb | 2 +- lib/faker/creature.rb | 2 +- lib/faker/creature/animal.rb | 2 +- lib/faker/creature/bird.rb | 2 +- lib/faker/creature/cat.rb | 2 +- lib/faker/creature/dog.rb | 2 +- lib/faker/creature/horse.rb | 2 +- lib/faker/fantasy.rb | 2 +- lib/faker/fantasy/tolkien.rb | 2 +- lib/faker/games.rb | 2 +- lib/faker/games/clash_of_clans.rb | 2 +- lib/faker/games/control.rb | 2 +- lib/faker/games/dnd.rb | 2 +- lib/faker/games/dota.rb | 2 +- lib/faker/games/elder_scrolls.rb | 2 +- lib/faker/games/fallout.rb | 2 +- lib/faker/games/final_fantasy_xiv.rb | 2 +- lib/faker/games/half_life.rb | 2 +- lib/faker/games/heroes.rb | 2 +- lib/faker/games/heroes_of_the_storm.rb | 2 +- lib/faker/games/league_of_legends.rb | 2 +- lib/faker/games/minecraft.rb | 2 +- lib/faker/games/myst.rb | 2 +- lib/faker/games/overwatch.rb | 2 +- lib/faker/games/pokemon.rb | 2 +- lib/faker/games/sonic_the_hedgehog.rb | 2 +- lib/faker/games/street_fighter.rb | 2 +- lib/faker/games/super_mario.rb | 2 +- lib/faker/games/super_smash_bros.rb | 2 +- lib/faker/games/tarkov.rb | 2 +- lib/faker/games/touhou.rb | 2 +- lib/faker/games/warhammer_fantasy.rb | 2 +- lib/faker/games/witcher.rb | 2 +- lib/faker/games/world_of_warcraft.rb | 2 +- lib/faker/games/zelda.rb | 2 +- lib/faker/japanese_media.rb | 2 +- lib/faker/japanese_media/conan.rb | 2 +- lib/faker/japanese_media/cowboy_bebop.rb | 2 +- lib/faker/japanese_media/doraemon.rb | 2 +- lib/faker/japanese_media/dragon_ball.rb | 2 +- .../fullmetal_alchemist_brotherhood.rb | 2 +- lib/faker/japanese_media/kamen_rider.rb | 2 +- lib/faker/japanese_media/naruto.rb | 2 +- lib/faker/japanese_media/one_piece.rb | 2 +- lib/faker/japanese_media/studio_ghibli.rb | 2 +- lib/faker/japanese_media/sword_art_online.rb | 2 +- lib/faker/locations.rb | 2 +- lib/faker/locations/australia.rb | 2 +- lib/faker/movies.rb | 2 +- lib/faker/movies/avatar.rb | 2 +- lib/faker/movies/back_to_the_future.rb | 2 +- lib/faker/movies/departed.rb | 2 +- lib/faker/movies/ghostbusters.rb | 2 +- lib/faker/movies/hackers.rb | 2 +- lib/faker/movies/harry_potter.rb | 2 +- .../movies/hitchhikers_guide_to_the_galaxy.rb | 2 +- lib/faker/movies/hobbit.rb | 2 +- lib/faker/movies/how_to_train_your_dragon.rb | 2 +- lib/faker/movies/lebowski.rb | 2 +- lib/faker/movies/lord_of_the_rings.rb | 2 +- lib/faker/movies/princess_bride.rb | 2 +- lib/faker/movies/star_wars.rb | 2 +- lib/faker/movies/the_room.rb | 2 +- lib/faker/movies/tron.rb | 2 +- lib/faker/movies/v_for_vendetta.rb | 2 +- lib/faker/music.rb | 2 +- lib/faker/quotes.rb | 2 +- lib/faker/quotes/chiquito.rb | 2 +- lib/faker/quotes/rajnikanth.rb | 2 +- lib/faker/quotes/shakespeare.rb | 2 +- lib/faker/sports.rb | 2 +- lib/faker/sports/basketball.rb | 2 +- lib/faker/sports/chess.rb | 2 +- lib/faker/sports/football.rb | 2 +- lib/faker/sports/mountaineering.rb | 2 +- lib/faker/sports/volleyball.rb | 2 +- lib/faker/travel.rb | 2 +- lib/faker/travel/airport.rb | 2 +- lib/faker/travel/train_station.rb | 2 +- lib/faker/tv_shows.rb | 2 +- lib/faker/tv_shows/aqua_teen_hunger_force.rb | 2 +- lib/faker/tv_shows/archer.rb | 2 +- lib/faker/tv_shows/big_bang_theory.rb | 2 +- lib/faker/tv_shows/bojack_horseman.rb | 2 +- lib/faker/tv_shows/breaking_bad.rb | 2 +- lib/faker/tv_shows/brooklyn_nine_nine.rb | 2 +- lib/faker/tv_shows/buffy.rb | 2 +- lib/faker/tv_shows/community.rb | 2 +- lib/faker/tv_shows/dr_who.rb | 2 +- lib/faker/tv_shows/dumb_and_dumber.rb | 2 +- lib/faker/tv_shows/family_guy.rb | 2 +- lib/faker/tv_shows/final_space.rb | 2 +- lib/faker/tv_shows/friends.rb | 2 +- lib/faker/tv_shows/futurama.rb | 2 +- lib/faker/tv_shows/game_of_thrones.rb | 2 +- lib/faker/tv_shows/hey_arnold.rb | 2 +- lib/faker/tv_shows/how_i_met_your_mother.rb | 2 +- lib/faker/tv_shows/michael_scott.rb | 2 +- lib/faker/tv_shows/new_girl.rb | 2 +- lib/faker/tv_shows/parks_and_rec.rb | 2 +- lib/faker/tv_shows/rick_and_morty.rb | 2 +- lib/faker/tv_shows/ru_paul.rb | 2 +- lib/faker/tv_shows/seinfeld.rb | 2 +- lib/faker/tv_shows/silicon_valley.rb | 2 +- lib/faker/tv_shows/simpsons.rb | 2 +- lib/faker/tv_shows/south_park.rb | 2 +- lib/faker/tv_shows/spongebob.rb | 2 +- lib/faker/tv_shows/star_trek.rb | 2 +- lib/faker/tv_shows/stargate.rb | 2 +- lib/faker/tv_shows/stranger_things.rb | 2 +- lib/faker/tv_shows/suits.rb | 2 +- lib/faker/tv_shows/supernatural.rb | 2 +- lib/faker/tv_shows/the_expanse.rb | 2 +- .../tv_shows/the_fresh_prince_of_bel_air.rb | 2 +- lib/faker/tv_shows/the_it_crowd.rb | 2 +- lib/faker/tv_shows/the_office.rb | 2 +- lib/faker/tv_shows/the_thick_of_it.rb | 2 +- lib/faker/tv_shows/twin_peaks.rb | 2 +- lib/faker/tv_shows/venture_bros.rb | 2 +- test/test_determinism.rb | 247 +++++++++--------- 129 files changed, 252 insertions(+), 251 deletions(-) diff --git a/lib/faker/blockchain.rb b/lib/faker/blockchain.rb index 34d02f963b..9ec09ea789 100644 --- a/lib/faker/blockchain.rb +++ b/lib/faker/blockchain.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Blockchain + class Blockchain end end diff --git a/lib/faker/blockchain/aeternity.rb b/lib/faker/blockchain/aeternity.rb index 6f3a14366e..1c019d7766 100644 --- a/lib/faker/blockchain/aeternity.rb +++ b/lib/faker/blockchain/aeternity.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Blockchain + class Blockchain class Aeternity < Base class << self ## diff --git a/lib/faker/blockchain/bitcoin.rb b/lib/faker/blockchain/bitcoin.rb index 9da252ddd6..badd2f2bd0 100644 --- a/lib/faker/blockchain/bitcoin.rb +++ b/lib/faker/blockchain/bitcoin.rb @@ -3,7 +3,7 @@ require 'securerandom' module Faker - module Blockchain + class Blockchain class Bitcoin < Base class << self # @private diff --git a/lib/faker/blockchain/ethereum.rb b/lib/faker/blockchain/ethereum.rb index 63f8527186..3540698234 100644 --- a/lib/faker/blockchain/ethereum.rb +++ b/lib/faker/blockchain/ethereum.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Blockchain + class Blockchain class Ethereum < Base class << self ## diff --git a/lib/faker/blockchain/tezos.rb b/lib/faker/blockchain/tezos.rb index 1b5b2c93df..94cf94449e 100644 --- a/lib/faker/blockchain/tezos.rb +++ b/lib/faker/blockchain/tezos.rb @@ -3,7 +3,7 @@ require 'securerandom' module Faker - module Blockchain + class Blockchain class Tezos < Base class << self # @private diff --git a/lib/faker/books.rb b/lib/faker/books.rb index 3b5177c0cb..9109200ec9 100644 --- a/lib/faker/books.rb +++ b/lib/faker/books.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Books + class Books end end \ No newline at end of file diff --git a/lib/faker/books/culture_series.rb b/lib/faker/books/culture_series.rb index e8e2ffca28..0dd8243fad 100644 --- a/lib/faker/books/culture_series.rb +++ b/lib/faker/books/culture_series.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Books + class Books class CultureSeries < Base flexible :culture_series diff --git a/lib/faker/books/dune.rb b/lib/faker/books/dune.rb index 0fcd810132..9036d879bf 100644 --- a/lib/faker/books/dune.rb +++ b/lib/faker/books/dune.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Books + class Books ## # A Faker module beyond your dreams, test data beyond your imagination. class Dune < Base diff --git a/lib/faker/books/lovecraft.rb b/lib/faker/books/lovecraft.rb index b7ffb50a6a..eb6a9b63e5 100644 --- a/lib/faker/books/lovecraft.rb +++ b/lib/faker/books/lovecraft.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Books + class Books class Lovecraft < Base class << self ## diff --git a/lib/faker/books/the_kingkiller_chronicle.rb b/lib/faker/books/the_kingkiller_chronicle.rb index 298ab1ac47..fbcd4835ce 100644 --- a/lib/faker/books/the_kingkiller_chronicle.rb +++ b/lib/faker/books/the_kingkiller_chronicle.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Books + class Books class TheKingkillerChronicle < Base class << self ## diff --git a/lib/faker/creature.rb b/lib/faker/creature.rb index 517d20a570..a408289772 100644 --- a/lib/faker/creature.rb +++ b/lib/faker/creature.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Creature + class Creature end end diff --git a/lib/faker/creature/animal.rb b/lib/faker/creature/animal.rb index f26fa27506..dbb3b6b133 100644 --- a/lib/faker/creature/animal.rb +++ b/lib/faker/creature/animal.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Creature + class Creature class Animal < Base class << self ## diff --git a/lib/faker/creature/bird.rb b/lib/faker/creature/bird.rb index 8ed8911237..d1a016d1ea 100644 --- a/lib/faker/creature/bird.rb +++ b/lib/faker/creature/bird.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Creature + class Creature class Bird < Base flexible :bird diff --git a/lib/faker/creature/cat.rb b/lib/faker/creature/cat.rb index 31231531f4..fb0e825569 100644 --- a/lib/faker/creature/cat.rb +++ b/lib/faker/creature/cat.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Creature + class Creature class Cat < Base flexible :cat diff --git a/lib/faker/creature/dog.rb b/lib/faker/creature/dog.rb index 6953e76383..301defe158 100644 --- a/lib/faker/creature/dog.rb +++ b/lib/faker/creature/dog.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Creature + class Creature class Dog < Base flexible :dog diff --git a/lib/faker/creature/horse.rb b/lib/faker/creature/horse.rb index 9bb9d9e4ab..72e76f579c 100644 --- a/lib/faker/creature/horse.rb +++ b/lib/faker/creature/horse.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Creature + class Creature class Horse < Base flexible :horse diff --git a/lib/faker/fantasy.rb b/lib/faker/fantasy.rb index dd331a80ca..263e9eaedc 100644 --- a/lib/faker/fantasy.rb +++ b/lib/faker/fantasy.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Fantasy + class Fantasy end end diff --git a/lib/faker/fantasy/tolkien.rb b/lib/faker/fantasy/tolkien.rb index 5fa262c4b7..67bc22aaf0 100644 --- a/lib/faker/fantasy/tolkien.rb +++ b/lib/faker/fantasy/tolkien.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Fantasy + class Fantasy class Tolkien < Base flexible :tolkien diff --git a/lib/faker/games.rb b/lib/faker/games.rb index cc95d35d9f..89fa1e5831 100644 --- a/lib/faker/games.rb +++ b/lib/faker/games.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Games + class Games end end diff --git a/lib/faker/games/clash_of_clans.rb b/lib/faker/games/clash_of_clans.rb index 2fac1427f3..2bf192670f 100644 --- a/lib/faker/games/clash_of_clans.rb +++ b/lib/faker/games/clash_of_clans.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class ClashOfClans < Base class << self ## diff --git a/lib/faker/games/control.rb b/lib/faker/games/control.rb index 794d14a5c4..ebd8cf296c 100644 --- a/lib/faker/games/control.rb +++ b/lib/faker/games/control.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Control < Base class << self ## diff --git a/lib/faker/games/dnd.rb b/lib/faker/games/dnd.rb index 46a7da7439..2bb87ee0f9 100644 --- a/lib/faker/games/dnd.rb +++ b/lib/faker/games/dnd.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class DnD < Base class << self ## diff --git a/lib/faker/games/dota.rb b/lib/faker/games/dota.rb index b7906d252e..a8ada9ea98 100644 --- a/lib/faker/games/dota.rb +++ b/lib/faker/games/dota.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Dota < Base class << self ## diff --git a/lib/faker/games/elder_scrolls.rb b/lib/faker/games/elder_scrolls.rb index b9d8d7fad4..5e8e606a1a 100644 --- a/lib/faker/games/elder_scrolls.rb +++ b/lib/faker/games/elder_scrolls.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class ElderScrolls < Base class << self ## diff --git a/lib/faker/games/fallout.rb b/lib/faker/games/fallout.rb index c7930dbae6..b92f539187 100644 --- a/lib/faker/games/fallout.rb +++ b/lib/faker/games/fallout.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Fallout < Base class << self ## diff --git a/lib/faker/games/final_fantasy_xiv.rb b/lib/faker/games/final_fantasy_xiv.rb index ac37e825e1..bf16a8837c 100644 --- a/lib/faker/games/final_fantasy_xiv.rb +++ b/lib/faker/games/final_fantasy_xiv.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class FinalFantasyXIV < Base class << self ## diff --git a/lib/faker/games/half_life.rb b/lib/faker/games/half_life.rb index 000784565c..0a8c7566f4 100644 --- a/lib/faker/games/half_life.rb +++ b/lib/faker/games/half_life.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class HalfLife < Base class << self ## diff --git a/lib/faker/games/heroes.rb b/lib/faker/games/heroes.rb index 7f09230c32..e6dc38d1d9 100644 --- a/lib/faker/games/heroes.rb +++ b/lib/faker/games/heroes.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Heroes < Base class << self ## diff --git a/lib/faker/games/heroes_of_the_storm.rb b/lib/faker/games/heroes_of_the_storm.rb index 2a203ab3c6..89e7955664 100644 --- a/lib/faker/games/heroes_of_the_storm.rb +++ b/lib/faker/games/heroes_of_the_storm.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class HeroesOfTheStorm < Base class << self ## diff --git a/lib/faker/games/league_of_legends.rb b/lib/faker/games/league_of_legends.rb index 933e3326dc..7b40a072b6 100644 --- a/lib/faker/games/league_of_legends.rb +++ b/lib/faker/games/league_of_legends.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class LeagueOfLegends < Base class << self ## diff --git a/lib/faker/games/minecraft.rb b/lib/faker/games/minecraft.rb index dae81054e5..28ef82b2cd 100644 --- a/lib/faker/games/minecraft.rb +++ b/lib/faker/games/minecraft.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Minecraft < Base class << self ## diff --git a/lib/faker/games/myst.rb b/lib/faker/games/myst.rb index f104251e51..7f3e1fd144 100644 --- a/lib/faker/games/myst.rb +++ b/lib/faker/games/myst.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Myst < Base class << self ## diff --git a/lib/faker/games/overwatch.rb b/lib/faker/games/overwatch.rb index f7803890d8..34087991c1 100644 --- a/lib/faker/games/overwatch.rb +++ b/lib/faker/games/overwatch.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Overwatch < Base class << self ## diff --git a/lib/faker/games/pokemon.rb b/lib/faker/games/pokemon.rb index 24f3364fb1..f2ac903747 100644 --- a/lib/faker/games/pokemon.rb +++ b/lib/faker/games/pokemon.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Pokemon < Base class << self ## diff --git a/lib/faker/games/sonic_the_hedgehog.rb b/lib/faker/games/sonic_the_hedgehog.rb index 9f7ed15d5b..779306ccb4 100644 --- a/lib/faker/games/sonic_the_hedgehog.rb +++ b/lib/faker/games/sonic_the_hedgehog.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class SonicTheHedgehog < Base class << self ## diff --git a/lib/faker/games/street_fighter.rb b/lib/faker/games/street_fighter.rb index d80813ef98..a3251a25cd 100644 --- a/lib/faker/games/street_fighter.rb +++ b/lib/faker/games/street_fighter.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class StreetFighter < Base class << self ## diff --git a/lib/faker/games/super_mario.rb b/lib/faker/games/super_mario.rb index 593daf588b..87e8b2867d 100644 --- a/lib/faker/games/super_mario.rb +++ b/lib/faker/games/super_mario.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class SuperMario < Base class << self ## diff --git a/lib/faker/games/super_smash_bros.rb b/lib/faker/games/super_smash_bros.rb index 99ca4ea668..b845e1f93b 100644 --- a/lib/faker/games/super_smash_bros.rb +++ b/lib/faker/games/super_smash_bros.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class SuperSmashBros < Base class << self ## diff --git a/lib/faker/games/tarkov.rb b/lib/faker/games/tarkov.rb index c1511dc58f..5d32ca66a0 100644 --- a/lib/faker/games/tarkov.rb +++ b/lib/faker/games/tarkov.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Tarkov < Base class << self ## diff --git a/lib/faker/games/touhou.rb b/lib/faker/games/touhou.rb index b0ac2706d6..656b8b8b61 100644 --- a/lib/faker/games/touhou.rb +++ b/lib/faker/games/touhou.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Touhou < Base flexible :touhou class << self diff --git a/lib/faker/games/warhammer_fantasy.rb b/lib/faker/games/warhammer_fantasy.rb index cc4a7f0d6a..8e97cd3075 100644 --- a/lib/faker/games/warhammer_fantasy.rb +++ b/lib/faker/games/warhammer_fantasy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class WarhammerFantasy < Base class << self ## diff --git a/lib/faker/games/witcher.rb b/lib/faker/games/witcher.rb index d69678564a..e4760b8670 100644 --- a/lib/faker/games/witcher.rb +++ b/lib/faker/games/witcher.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Witcher < Base class << self ## diff --git a/lib/faker/games/world_of_warcraft.rb b/lib/faker/games/world_of_warcraft.rb index ebfb3f4734..005bb076cb 100644 --- a/lib/faker/games/world_of_warcraft.rb +++ b/lib/faker/games/world_of_warcraft.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class WorldOfWarcraft < Base class << self ## diff --git a/lib/faker/games/zelda.rb b/lib/faker/games/zelda.rb index afeee73ebd..352ed8ad47 100644 --- a/lib/faker/games/zelda.rb +++ b/lib/faker/games/zelda.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Games + class Games class Zelda < Base flexible :zelda class << self diff --git a/lib/faker/japanese_media.rb b/lib/faker/japanese_media.rb index e5b34201c2..92c03de479 100644 --- a/lib/faker/japanese_media.rb +++ b/lib/faker/japanese_media.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia end end diff --git a/lib/faker/japanese_media/conan.rb b/lib/faker/japanese_media/conan.rb index 0c87243ac0..03d688c53f 100644 --- a/lib/faker/japanese_media/conan.rb +++ b/lib/faker/japanese_media/conan.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class Conan < Base class << self ## diff --git a/lib/faker/japanese_media/cowboy_bebop.rb b/lib/faker/japanese_media/cowboy_bebop.rb index 4a2a5fd5b0..a8d3f523eb 100644 --- a/lib/faker/japanese_media/cowboy_bebop.rb +++ b/lib/faker/japanese_media/cowboy_bebop.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class CowboyBebop < Base class << self ## diff --git a/lib/faker/japanese_media/doraemon.rb b/lib/faker/japanese_media/doraemon.rb index aa2905908b..b859468045 100644 --- a/lib/faker/japanese_media/doraemon.rb +++ b/lib/faker/japanese_media/doraemon.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class Doraemon < Base class << self ## diff --git a/lib/faker/japanese_media/dragon_ball.rb b/lib/faker/japanese_media/dragon_ball.rb index d00350cf36..3b18c5bc06 100644 --- a/lib/faker/japanese_media/dragon_ball.rb +++ b/lib/faker/japanese_media/dragon_ball.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class DragonBall < Base class << self ## diff --git a/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb b/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb index 612940fa5f..c112eb7255 100644 --- a/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb +++ b/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class FullmetalAlchemistBrotherhood < Base class << self ## diff --git a/lib/faker/japanese_media/kamen_rider.rb b/lib/faker/japanese_media/kamen_rider.rb index fdb0bfb7ef..8e8205ba12 100644 --- a/lib/faker/japanese_media/kamen_rider.rb +++ b/lib/faker/japanese_media/kamen_rider.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class KamenRider < Base class << self ERAS = %i[showa heisei reiwa].freeze diff --git a/lib/faker/japanese_media/naruto.rb b/lib/faker/japanese_media/naruto.rb index 49f48ee85f..3f2ee615e5 100644 --- a/lib/faker/japanese_media/naruto.rb +++ b/lib/faker/japanese_media/naruto.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class Naruto < Base class << self ## diff --git a/lib/faker/japanese_media/one_piece.rb b/lib/faker/japanese_media/one_piece.rb index e5a2ba9161..fe473391aa 100644 --- a/lib/faker/japanese_media/one_piece.rb +++ b/lib/faker/japanese_media/one_piece.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class OnePiece < Base class << self ## diff --git a/lib/faker/japanese_media/studio_ghibli.rb b/lib/faker/japanese_media/studio_ghibli.rb index 3c0ba225d7..4ebbcc9437 100644 --- a/lib/faker/japanese_media/studio_ghibli.rb +++ b/lib/faker/japanese_media/studio_ghibli.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class StudioGhibli < Base class << self ## diff --git a/lib/faker/japanese_media/sword_art_online.rb b/lib/faker/japanese_media/sword_art_online.rb index 69c98a9aae..30a36c82f4 100644 --- a/lib/faker/japanese_media/sword_art_online.rb +++ b/lib/faker/japanese_media/sword_art_online.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module JapaneseMedia + class JapaneseMedia class SwordArtOnline < Base class << self ## diff --git a/lib/faker/locations.rb b/lib/faker/locations.rb index b8cda9f246..b441b141bb 100644 --- a/lib/faker/locations.rb +++ b/lib/faker/locations.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Locations + class Locations end end diff --git a/lib/faker/locations/australia.rb b/lib/faker/locations/australia.rb index 47556d893d..a0358b93a5 100644 --- a/lib/faker/locations/australia.rb +++ b/lib/faker/locations/australia.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Locations + class Locations class Australia < Base class << self ## diff --git a/lib/faker/movies.rb b/lib/faker/movies.rb index ebcd0b3f27..ec6cdfbe0b 100644 --- a/lib/faker/movies.rb +++ b/lib/faker/movies.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Movies + class Movies end end diff --git a/lib/faker/movies/avatar.rb b/lib/faker/movies/avatar.rb index 859b850046..48418118d9 100644 --- a/lib/faker/movies/avatar.rb +++ b/lib/faker/movies/avatar.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class Avatar < Base class << self ## diff --git a/lib/faker/movies/back_to_the_future.rb b/lib/faker/movies/back_to_the_future.rb index b5376f5060..8aad8936d2 100644 --- a/lib/faker/movies/back_to_the_future.rb +++ b/lib/faker/movies/back_to_the_future.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class BackToTheFuture < Base class << self ## diff --git a/lib/faker/movies/departed.rb b/lib/faker/movies/departed.rb index 61969442b8..ac241ef9eb 100644 --- a/lib/faker/movies/departed.rb +++ b/lib/faker/movies/departed.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class Departed < Base class << self ## diff --git a/lib/faker/movies/ghostbusters.rb b/lib/faker/movies/ghostbusters.rb index 37c9e0d8c3..9e5477a8dd 100644 --- a/lib/faker/movies/ghostbusters.rb +++ b/lib/faker/movies/ghostbusters.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class Ghostbusters < Base class << self ## diff --git a/lib/faker/movies/hackers.rb b/lib/faker/movies/hackers.rb index aff603e2d7..cb3f43ead1 100644 --- a/lib/faker/movies/hackers.rb +++ b/lib/faker/movies/hackers.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class Hackers < Base class << self ## diff --git a/lib/faker/movies/harry_potter.rb b/lib/faker/movies/harry_potter.rb index 3ffbfbafd3..0e2e39efd6 100644 --- a/lib/faker/movies/harry_potter.rb +++ b/lib/faker/movies/harry_potter.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class HarryPotter < Base class << self ## diff --git a/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb b/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb index bc26af7f44..c5a47994a3 100644 --- a/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb +++ b/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class HitchhikersGuideToTheGalaxy < Base class << self ## diff --git a/lib/faker/movies/hobbit.rb b/lib/faker/movies/hobbit.rb index ac95b562d0..7b4ccf2c9e 100644 --- a/lib/faker/movies/hobbit.rb +++ b/lib/faker/movies/hobbit.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class Hobbit < Base class << self ## diff --git a/lib/faker/movies/how_to_train_your_dragon.rb b/lib/faker/movies/how_to_train_your_dragon.rb index c07b8d333a..e427e29256 100644 --- a/lib/faker/movies/how_to_train_your_dragon.rb +++ b/lib/faker/movies/how_to_train_your_dragon.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class HowToTrainYourDragon < Base class << self ## diff --git a/lib/faker/movies/lebowski.rb b/lib/faker/movies/lebowski.rb index e1b9f32ef1..7764a3145a 100644 --- a/lib/faker/movies/lebowski.rb +++ b/lib/faker/movies/lebowski.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class Lebowski < Base class << self ## diff --git a/lib/faker/movies/lord_of_the_rings.rb b/lib/faker/movies/lord_of_the_rings.rb index d353ef7dce..e3ae7840eb 100644 --- a/lib/faker/movies/lord_of_the_rings.rb +++ b/lib/faker/movies/lord_of_the_rings.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class LordOfTheRings < Base class << self ## diff --git a/lib/faker/movies/princess_bride.rb b/lib/faker/movies/princess_bride.rb index 3bf2ecdb21..cf8da0497c 100644 --- a/lib/faker/movies/princess_bride.rb +++ b/lib/faker/movies/princess_bride.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class PrincessBride < Base class << self ## diff --git a/lib/faker/movies/star_wars.rb b/lib/faker/movies/star_wars.rb index 438279514b..a5e26f7695 100644 --- a/lib/faker/movies/star_wars.rb +++ b/lib/faker/movies/star_wars.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class StarWars < Base class << self ## diff --git a/lib/faker/movies/the_room.rb b/lib/faker/movies/the_room.rb index 377dd3df6f..e2f22b522e 100644 --- a/lib/faker/movies/the_room.rb +++ b/lib/faker/movies/the_room.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class TheRoom < Base class << self ## diff --git a/lib/faker/movies/tron.rb b/lib/faker/movies/tron.rb index 5fbe354d4e..c30f18b39d 100644 --- a/lib/faker/movies/tron.rb +++ b/lib/faker/movies/tron.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class Tron < Base class << self ## diff --git a/lib/faker/movies/v_for_vendetta.rb b/lib/faker/movies/v_for_vendetta.rb index 0890ca2771..ccb6d08e45 100644 --- a/lib/faker/movies/v_for_vendetta.rb +++ b/lib/faker/movies/v_for_vendetta.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Movies + class Movies class VForVendetta < Base class << self ## diff --git a/lib/faker/music.rb b/lib/faker/music.rb index 842080e03b..6c45a05ee4 100644 --- a/lib/faker/music.rb +++ b/lib/faker/music.rb @@ -17,7 +17,7 @@ class << self # Faker::Music.key #=> "A#" # # @faker.version 1.6.4 - def self.key + def key sample(keys) + sample(key_variants) end diff --git a/lib/faker/quotes.rb b/lib/faker/quotes.rb index f7f10a9c26..a6062cdd1a 100644 --- a/lib/faker/quotes.rb +++ b/lib/faker/quotes.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Quotes + class Quotes end end diff --git a/lib/faker/quotes/chiquito.rb b/lib/faker/quotes/chiquito.rb index 7fcd0beedc..56bf076e55 100644 --- a/lib/faker/quotes/chiquito.rb +++ b/lib/faker/quotes/chiquito.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Quotes + class Quotes class Chiquito < Base class << self ## diff --git a/lib/faker/quotes/rajnikanth.rb b/lib/faker/quotes/rajnikanth.rb index 311521e46b..b14006b9c1 100644 --- a/lib/faker/quotes/rajnikanth.rb +++ b/lib/faker/quotes/rajnikanth.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Quotes + class Quotes class Rajnikanth < Base flexible :rajnikanth diff --git a/lib/faker/quotes/shakespeare.rb b/lib/faker/quotes/shakespeare.rb index 3eb30055a6..75de12a6ba 100644 --- a/lib/faker/quotes/shakespeare.rb +++ b/lib/faker/quotes/shakespeare.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Quotes + class Quotes class Shakespeare < Base class << self ## diff --git a/lib/faker/sports.rb b/lib/faker/sports.rb index e2fc8ce98b..61d6ae127c 100644 --- a/lib/faker/sports.rb +++ b/lib/faker/sports.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Sports + class Sports end end diff --git a/lib/faker/sports/basketball.rb b/lib/faker/sports/basketball.rb index 8ec8b49544..88c0fb5671 100644 --- a/lib/faker/sports/basketball.rb +++ b/lib/faker/sports/basketball.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Sports + class Sports class Basketball < Base class << self ## diff --git a/lib/faker/sports/chess.rb b/lib/faker/sports/chess.rb index cffcfd4073..2b85deab18 100644 --- a/lib/faker/sports/chess.rb +++ b/lib/faker/sports/chess.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Sports + class Sports class Chess < Base class << self ## diff --git a/lib/faker/sports/football.rb b/lib/faker/sports/football.rb index 65618e6c67..835e7b9019 100644 --- a/lib/faker/sports/football.rb +++ b/lib/faker/sports/football.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Sports + class Sports class Football < Base class << self ## diff --git a/lib/faker/sports/mountaineering.rb b/lib/faker/sports/mountaineering.rb index 90d6add13b..71552d5880 100644 --- a/lib/faker/sports/mountaineering.rb +++ b/lib/faker/sports/mountaineering.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Sports + class Sports class Mountaineering < Base class << self ## diff --git a/lib/faker/sports/volleyball.rb b/lib/faker/sports/volleyball.rb index 6a6910fa1b..7ed59d639d 100644 --- a/lib/faker/sports/volleyball.rb +++ b/lib/faker/sports/volleyball.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Sports + class Sports class Volleyball < Base class << self ## diff --git a/lib/faker/travel.rb b/lib/faker/travel.rb index d028fc079f..6aab06871e 100644 --- a/lib/faker/travel.rb +++ b/lib/faker/travel.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module Travel + class Travel end end diff --git a/lib/faker/travel/airport.rb b/lib/faker/travel/airport.rb index f8a8a536cb..8d08759168 100644 --- a/lib/faker/travel/airport.rb +++ b/lib/faker/travel/airport.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Travel + class Travel class Airport < Base class << self ## diff --git a/lib/faker/travel/train_station.rb b/lib/faker/travel/train_station.rb index 220e673a31..6ca02153fc 100644 --- a/lib/faker/travel/train_station.rb +++ b/lib/faker/travel/train_station.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module Travel + class Travel class TrainStation < Base class << self ## diff --git a/lib/faker/tv_shows.rb b/lib/faker/tv_shows.rb index 6ad2e23571..bc16b3f022 100644 --- a/lib/faker/tv_shows.rb +++ b/lib/faker/tv_shows.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows end end diff --git a/lib/faker/tv_shows/aqua_teen_hunger_force.rb b/lib/faker/tv_shows/aqua_teen_hunger_force.rb index aca59db76b..840f40c531 100644 --- a/lib/faker/tv_shows/aqua_teen_hunger_force.rb +++ b/lib/faker/tv_shows/aqua_teen_hunger_force.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class AquaTeenHungerForce < Base flexible :aqua_teen_hunger_force diff --git a/lib/faker/tv_shows/archer.rb b/lib/faker/tv_shows/archer.rb index 8ee45ca648..f81140901e 100644 --- a/lib/faker/tv_shows/archer.rb +++ b/lib/faker/tv_shows/archer.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Archer < Base flexible :archer diff --git a/lib/faker/tv_shows/big_bang_theory.rb b/lib/faker/tv_shows/big_bang_theory.rb index 594be3cfdf..68d88ab4bf 100644 --- a/lib/faker/tv_shows/big_bang_theory.rb +++ b/lib/faker/tv_shows/big_bang_theory.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class BigBangTheory < Base flexible :big_bang_theory diff --git a/lib/faker/tv_shows/bojack_horseman.rb b/lib/faker/tv_shows/bojack_horseman.rb index 91f89bc4cb..7539ab5677 100644 --- a/lib/faker/tv_shows/bojack_horseman.rb +++ b/lib/faker/tv_shows/bojack_horseman.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class BojackHorseman < Base flexible :bojack_horseman diff --git a/lib/faker/tv_shows/breaking_bad.rb b/lib/faker/tv_shows/breaking_bad.rb index 521448726b..c6e2059df6 100644 --- a/lib/faker/tv_shows/breaking_bad.rb +++ b/lib/faker/tv_shows/breaking_bad.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class BreakingBad < Base flexible :breaking_bad diff --git a/lib/faker/tv_shows/brooklyn_nine_nine.rb b/lib/faker/tv_shows/brooklyn_nine_nine.rb index f5dedc5e1a..5c29dc814c 100644 --- a/lib/faker/tv_shows/brooklyn_nine_nine.rb +++ b/lib/faker/tv_shows/brooklyn_nine_nine.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class BrooklynNineNine < Base flexible :brooklyn_nine_nine diff --git a/lib/faker/tv_shows/buffy.rb b/lib/faker/tv_shows/buffy.rb index 1350df5b9e..1848f18194 100644 --- a/lib/faker/tv_shows/buffy.rb +++ b/lib/faker/tv_shows/buffy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Buffy < Base flexible :buffy diff --git a/lib/faker/tv_shows/community.rb b/lib/faker/tv_shows/community.rb index e34e317f51..ebee983011 100644 --- a/lib/faker/tv_shows/community.rb +++ b/lib/faker/tv_shows/community.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Community < Base flexible :community diff --git a/lib/faker/tv_shows/dr_who.rb b/lib/faker/tv_shows/dr_who.rb index 68c6be2d1f..b1b9c34bb0 100644 --- a/lib/faker/tv_shows/dr_who.rb +++ b/lib/faker/tv_shows/dr_who.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class DrWho < Base flexible :dr_who diff --git a/lib/faker/tv_shows/dumb_and_dumber.rb b/lib/faker/tv_shows/dumb_and_dumber.rb index b95c6f1e08..53aec85975 100644 --- a/lib/faker/tv_shows/dumb_and_dumber.rb +++ b/lib/faker/tv_shows/dumb_and_dumber.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class DumbAndDumber < Base flexible :dumb_and_dumber diff --git a/lib/faker/tv_shows/family_guy.rb b/lib/faker/tv_shows/family_guy.rb index 3bfbbf0261..71c94a2196 100644 --- a/lib/faker/tv_shows/family_guy.rb +++ b/lib/faker/tv_shows/family_guy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class FamilyGuy < Base flexible :family_guy diff --git a/lib/faker/tv_shows/final_space.rb b/lib/faker/tv_shows/final_space.rb index 5142311fae..03c0dcbeac 100644 --- a/lib/faker/tv_shows/final_space.rb +++ b/lib/faker/tv_shows/final_space.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class FinalSpace < Base flexible :final_space diff --git a/lib/faker/tv_shows/friends.rb b/lib/faker/tv_shows/friends.rb index e97b29e60d..13c63ab5f7 100644 --- a/lib/faker/tv_shows/friends.rb +++ b/lib/faker/tv_shows/friends.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Friends < Base flexible :friends diff --git a/lib/faker/tv_shows/futurama.rb b/lib/faker/tv_shows/futurama.rb index 280263affa..197165241d 100644 --- a/lib/faker/tv_shows/futurama.rb +++ b/lib/faker/tv_shows/futurama.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Futurama < Base flexible :futurama diff --git a/lib/faker/tv_shows/game_of_thrones.rb b/lib/faker/tv_shows/game_of_thrones.rb index 127e2e6a3a..4469772c36 100644 --- a/lib/faker/tv_shows/game_of_thrones.rb +++ b/lib/faker/tv_shows/game_of_thrones.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class GameOfThrones < Base flexible :game_of_thrones diff --git a/lib/faker/tv_shows/hey_arnold.rb b/lib/faker/tv_shows/hey_arnold.rb index 424cfdf465..4126a238a2 100644 --- a/lib/faker/tv_shows/hey_arnold.rb +++ b/lib/faker/tv_shows/hey_arnold.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class HeyArnold < Base flexible :hey_arnold diff --git a/lib/faker/tv_shows/how_i_met_your_mother.rb b/lib/faker/tv_shows/how_i_met_your_mother.rb index 96385cf15c..f8a985aec0 100644 --- a/lib/faker/tv_shows/how_i_met_your_mother.rb +++ b/lib/faker/tv_shows/how_i_met_your_mother.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class HowIMetYourMother < Base flexible :how_i_met_your_mother diff --git a/lib/faker/tv_shows/michael_scott.rb b/lib/faker/tv_shows/michael_scott.rb index 79a8ff25ab..a5b9b1c42f 100644 --- a/lib/faker/tv_shows/michael_scott.rb +++ b/lib/faker/tv_shows/michael_scott.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class MichaelScott < Base class << self ## diff --git a/lib/faker/tv_shows/new_girl.rb b/lib/faker/tv_shows/new_girl.rb index 38bb2ff0f4..d417312abb 100644 --- a/lib/faker/tv_shows/new_girl.rb +++ b/lib/faker/tv_shows/new_girl.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class NewGirl < Base flexible :new_girl diff --git a/lib/faker/tv_shows/parks_and_rec.rb b/lib/faker/tv_shows/parks_and_rec.rb index 722cde1870..614813232e 100644 --- a/lib/faker/tv_shows/parks_and_rec.rb +++ b/lib/faker/tv_shows/parks_and_rec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class ParksAndRec < Base flexible :parks_and_rec diff --git a/lib/faker/tv_shows/rick_and_morty.rb b/lib/faker/tv_shows/rick_and_morty.rb index a304d21523..aac1a00479 100644 --- a/lib/faker/tv_shows/rick_and_morty.rb +++ b/lib/faker/tv_shows/rick_and_morty.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class RickAndMorty < Base flexible :rick_and_morty diff --git a/lib/faker/tv_shows/ru_paul.rb b/lib/faker/tv_shows/ru_paul.rb index 536dea70c2..b45b4ead37 100644 --- a/lib/faker/tv_shows/ru_paul.rb +++ b/lib/faker/tv_shows/ru_paul.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class RuPaul < Base flexible :rupaul diff --git a/lib/faker/tv_shows/seinfeld.rb b/lib/faker/tv_shows/seinfeld.rb index 0133159587..9c7e37a7cc 100644 --- a/lib/faker/tv_shows/seinfeld.rb +++ b/lib/faker/tv_shows/seinfeld.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Seinfeld < Base flexible :seinfeld diff --git a/lib/faker/tv_shows/silicon_valley.rb b/lib/faker/tv_shows/silicon_valley.rb index 11fc4194d9..addf9546bc 100644 --- a/lib/faker/tv_shows/silicon_valley.rb +++ b/lib/faker/tv_shows/silicon_valley.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class SiliconValley < Base flexible :silicon_valley diff --git a/lib/faker/tv_shows/simpsons.rb b/lib/faker/tv_shows/simpsons.rb index 8b0f754400..84a98d5acb 100644 --- a/lib/faker/tv_shows/simpsons.rb +++ b/lib/faker/tv_shows/simpsons.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Simpsons < Base flexible :simpsons diff --git a/lib/faker/tv_shows/south_park.rb b/lib/faker/tv_shows/south_park.rb index 434df2ee49..a879a6e407 100644 --- a/lib/faker/tv_shows/south_park.rb +++ b/lib/faker/tv_shows/south_park.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class SouthPark < Base flexible :south_park diff --git a/lib/faker/tv_shows/spongebob.rb b/lib/faker/tv_shows/spongebob.rb index 7710cd6325..ef7a94e5e1 100644 --- a/lib/faker/tv_shows/spongebob.rb +++ b/lib/faker/tv_shows/spongebob.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Spongebob < Base flexible :spongebob diff --git a/lib/faker/tv_shows/star_trek.rb b/lib/faker/tv_shows/star_trek.rb index 1e84dbf259..933c991cf1 100644 --- a/lib/faker/tv_shows/star_trek.rb +++ b/lib/faker/tv_shows/star_trek.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class StarTrek < Base flexible :star_trek diff --git a/lib/faker/tv_shows/stargate.rb b/lib/faker/tv_shows/stargate.rb index 43e9b1121b..0fe34a3ec1 100644 --- a/lib/faker/tv_shows/stargate.rb +++ b/lib/faker/tv_shows/stargate.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Stargate < Base flexible :stargate diff --git a/lib/faker/tv_shows/stranger_things.rb b/lib/faker/tv_shows/stranger_things.rb index 45a3c17c1d..2b2febd030 100644 --- a/lib/faker/tv_shows/stranger_things.rb +++ b/lib/faker/tv_shows/stranger_things.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class StrangerThings < Base flexible :stranger_things diff --git a/lib/faker/tv_shows/suits.rb b/lib/faker/tv_shows/suits.rb index ea79ba5661..fbb55f32dd 100644 --- a/lib/faker/tv_shows/suits.rb +++ b/lib/faker/tv_shows/suits.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Suits < Base flexible :suits diff --git a/lib/faker/tv_shows/supernatural.rb b/lib/faker/tv_shows/supernatural.rb index 25d5510710..41507b6346 100644 --- a/lib/faker/tv_shows/supernatural.rb +++ b/lib/faker/tv_shows/supernatural.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class Supernatural < Base class << self ## diff --git a/lib/faker/tv_shows/the_expanse.rb b/lib/faker/tv_shows/the_expanse.rb index 1ebf1d1131..e987ec9186 100644 --- a/lib/faker/tv_shows/the_expanse.rb +++ b/lib/faker/tv_shows/the_expanse.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class TheExpanse < Base flexible :the_expanse diff --git a/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb b/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb index 942b6c3ecd..cf13bf7f51 100644 --- a/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +++ b/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class TheFreshPrinceOfBelAir < Base flexible :the_fresh_prince_of_bel_air diff --git a/lib/faker/tv_shows/the_it_crowd.rb b/lib/faker/tv_shows/the_it_crowd.rb index 19ee43898e..32c34b0729 100644 --- a/lib/faker/tv_shows/the_it_crowd.rb +++ b/lib/faker/tv_shows/the_it_crowd.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class TheITCrowd < Base flexible :the_it_crowd diff --git a/lib/faker/tv_shows/the_office.rb b/lib/faker/tv_shows/the_office.rb index e5f5c515e6..cf138a29b1 100644 --- a/lib/faker/tv_shows/the_office.rb +++ b/lib/faker/tv_shows/the_office.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class TheOffice < Base flexible :the_office diff --git a/lib/faker/tv_shows/the_thick_of_it.rb b/lib/faker/tv_shows/the_thick_of_it.rb index 61425d335c..c17572cffe 100644 --- a/lib/faker/tv_shows/the_thick_of_it.rb +++ b/lib/faker/tv_shows/the_thick_of_it.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class TheThickOfIt < Base flexible :the_thick_of_it diff --git a/lib/faker/tv_shows/twin_peaks.rb b/lib/faker/tv_shows/twin_peaks.rb index 0d26badd69..c3f37be6c1 100644 --- a/lib/faker/tv_shows/twin_peaks.rb +++ b/lib/faker/tv_shows/twin_peaks.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class TwinPeaks < Base flexible :twin_peaks diff --git a/lib/faker/tv_shows/venture_bros.rb b/lib/faker/tv_shows/venture_bros.rb index e0b871de98..4790c8fd79 100644 --- a/lib/faker/tv_shows/venture_bros.rb +++ b/lib/faker/tv_shows/venture_bros.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - module TvShows + class TvShows class VentureBros < Base flexible :venture_bros diff --git a/test/test_determinism.rb b/test/test_determinism.rb index e3b3edca26..fff8b911bd 100644 --- a/test/test_determinism.rb +++ b/test/test_determinism.rb @@ -1,123 +1,124 @@ -# # frozen_string_literal: true - -# require_relative 'test_helper' -# # rubocop:disable Security/Eval,Style/EvalWithLocation -# class TestDeterminism < Test::Unit::TestCase -# def setup -# @all_methods = all_methods.freeze -# @first_run = [] -# end - -# def test_determinism -# Faker::Config.random = Random.new(42) - -# @all_methods.each_index do |index| -# store_result @all_methods[index] -# end - -# @first_run.freeze - -# Faker::Config.random = Random.new(42) - -# @all_methods.each_index do |index| -# assert deterministic_random? @first_run[index], @all_methods[index] -# end -# end - -# def test_thread_safety -# expected_values = 2.times.map do |index| -# Faker::Config.random = Random.new(index) -# Faker::Number.digit -# end - -# threads = expected_values.each_with_index.map do |expected_value, index| -# Thread.new do -# 100_000.times.each do -# Faker::Config.random = Random.new(index) -# output = Faker::Number.digit - -# assert_equal output, expected_value -# end -# end -# end - -# threads.each(&:join) -# end - -# private - -# def deterministic_random?(first, method_name) -# second = eval(method_name) -# (first == second) || raise( -# "#{method_name} has an entropy leak; use \"Faker::Config.random.rand\" or \"Array#sample(random: Faker::Config.random)\". Method to lookup for: sample, shuffle, rand" -# ) -# end - -# def store_result(method_name) -# @first_run << eval(method_name) -# rescue StandardError => e -# raise %(#{method_name} raised "#{e}") -# end - -# def all_methods -# subclasses.map do |subclass| -# subclass_methods(subclass).flatten -# end.flatten.sort -# end - -# def subclasses -# Faker.constants.delete_if do |subclass| -# skipped_classes.include?(subclass) -# end.sort -# end - -# def subclass_methods(subclass) -# eval("Faker::#{subclass}.public_methods(false) - Faker::Base.public_methods(false)").sort.map do |method| -# "Faker::#{subclass}.#{method}" -# end.sort -# end - -# def skipped_classes -# %i[ -# Bank -# Base -# Base58 -# Books -# Cat -# Char -# ChileRut -# CLI -# Config -# Creature -# Date -# Deprecator -# Dog -# DragonBall -# Dota -# ElderScrolls -# Fallout -# Games -# GamesHalfLife -# HeroesOfTheStorm -# Internet -# JapaneseMedia -# LeagueOfLegends -# Locations -# Movies -# Myst -# Overwatch -# OnePiece -# Pokemon -# Religion -# Sports -# SwordArtOnline -# TvShows -# Time -# VERSION -# Witcher -# WorldOfWarcraft -# Zelda -# ] -# end -# end -# # rubocop:enable Security/Eval,Style/EvalWithLocation +# frozen_string_literal: true + +require_relative 'test_helper' + +# rubocop:disable Security/Eval,Style/EvalWithLocation +class TestDeterminism < Test::Unit::TestCase + def setup + @all_methods = all_methods.freeze + @first_run = [] + end +# + def test_determinism + Faker::Config.random = Random.new(42) + + @all_methods.each_index do |index| + store_result @all_methods[index] + end + + @first_run.freeze + + Faker::Config.random = Random.new(42) + + @all_methods.each_index do |index| + assert deterministic_random? @first_run[index], @all_methods[index] + end + end + + def test_thread_safety + expected_values = 2.times.map do |index| + Faker::Config.random = Random.new(index) + Faker::Number.digit + end + + threads = expected_values.each_with_index.map do |expected_value, index| + Thread.new do + 100_000.times.each do + Faker::Config.random = Random.new(index) + output = Faker::Number.digit + + assert_equal output, expected_value + end + end + end + + threads.each(&:join) + end + + private + + def deterministic_random?(first, method_name) + second = eval(method_name) + (first == second) || raise( + "#{method_name} has an entropy leak; use \"Faker::Config.random.rand\" or \"Array#sample(random: Faker::Config.random)\". Method to lookup for: sample, shuffle, rand" + ) + end + + def store_result(method_name) + @first_run << eval(method_name) + rescue StandardError => e + raise %(#{method_name} raised "#{e}") + end + + def all_methods + subclasses.map do |subclass| + subclass_methods(subclass).flatten + end.flatten.sort + end + + def subclasses + Faker.constants.delete_if do |subclass| + skipped_classes.include?(subclass) + end.sort + end + + def subclass_methods(subclass) + eval("Faker::#{subclass}.public_methods(false) - Faker::Base.public_methods(false)").sort.map do |method| + "Faker::#{subclass}.#{method}" + end.sort + end + + def skipped_classes + %i[ + Bank + Base + Base58 + Books + Cat + Char + ChileRut + CLI + Config + Creature + Date + Deprecator + Dog + DragonBall + Dota + ElderScrolls + Fallout + Games + GamesHalfLife + HeroesOfTheStorm + Internet + JapaneseMedia + LeagueOfLegends + Locations + Movies + Myst + Overwatch + OnePiece + Pokemon + Religion + Sports + SwordArtOnline + TvShows + Time + VERSION + Witcher + WorldOfWarcraft + Zelda + ] + end +end +# rubocop:enable Security/Eval,Style/EvalWithLocation From 98558fe7d554faf6de2344c2d8feba3c74a026c5 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 16:52:51 -0700 Subject: [PATCH 05/11] rubocop offenses --- .rubocop.yml | 3 +++ lib/faker.rb | 2 +- lib/faker/blockchain.rb | 1 + lib/faker/books.rb | 3 ++- lib/faker/creature.rb | 1 + lib/faker/fantasy.rb | 1 + lib/faker/games.rb | 1 + lib/faker/japanese_media.rb | 1 + lib/faker/locations.rb | 1 + lib/faker/movies.rb | 1 + lib/faker/music.rb | 2 +- lib/faker/quotes.rb | 1 + lib/faker/religion.rb | 1 + lib/faker/sports.rb | 1 + lib/faker/travel.rb | 1 + lib/faker/tv_shows.rb | 1 + test/test_determinism.rb | 2 +- 17 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 7fffa274c6..ac2f959625 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -37,6 +37,9 @@ Metrics/CyclomaticComplexity: Enabled: false Max: 6 +Lint/EmptyClass: + AllowComments: true + Metrics/MethodLength: Description: This cop checks if the length of a method exceeds some maximum value. Enabled: false diff --git a/lib/faker.rb b/lib/faker.rb index 8b34d61f0e..564483e410 100644 --- a/lib/faker.rb +++ b/lib/faker.rb @@ -301,5 +301,5 @@ def disable_enforce_available_locales rb_files << File.join(mydir, 'faker', '*.rb') rb_files << File.join(mydir, 'faker', '/**/*.rb') - Dir.glob(rb_files).each { |file| require file } + Dir.glob(rb_files).each { |file| require file } end diff --git a/lib/faker/blockchain.rb b/lib/faker/blockchain.rb index 9ec09ea789..3a06e540da 100644 --- a/lib/faker/blockchain.rb +++ b/lib/faker/blockchain.rb @@ -2,5 +2,6 @@ module Faker class Blockchain + # reopening class end end diff --git a/lib/faker/books.rb b/lib/faker/books.rb index 9109200ec9..95465e956f 100644 --- a/lib/faker/books.rb +++ b/lib/faker/books.rb @@ -2,5 +2,6 @@ module Faker class Books + # reopening class end -end \ No newline at end of file +end diff --git a/lib/faker/creature.rb b/lib/faker/creature.rb index a408289772..e05d2ed54e 100644 --- a/lib/faker/creature.rb +++ b/lib/faker/creature.rb @@ -2,5 +2,6 @@ module Faker class Creature + # reopening class end end diff --git a/lib/faker/fantasy.rb b/lib/faker/fantasy.rb index 263e9eaedc..ac82223023 100644 --- a/lib/faker/fantasy.rb +++ b/lib/faker/fantasy.rb @@ -2,5 +2,6 @@ module Faker class Fantasy + # reopening class end end diff --git a/lib/faker/games.rb b/lib/faker/games.rb index 89fa1e5831..c6f882ae6a 100644 --- a/lib/faker/games.rb +++ b/lib/faker/games.rb @@ -2,5 +2,6 @@ module Faker class Games + # reopening class end end diff --git a/lib/faker/japanese_media.rb b/lib/faker/japanese_media.rb index 92c03de479..00f2c54dcb 100644 --- a/lib/faker/japanese_media.rb +++ b/lib/faker/japanese_media.rb @@ -2,5 +2,6 @@ module Faker class JapaneseMedia + # reopening class end end diff --git a/lib/faker/locations.rb b/lib/faker/locations.rb index b441b141bb..32c698f7c0 100644 --- a/lib/faker/locations.rb +++ b/lib/faker/locations.rb @@ -2,5 +2,6 @@ module Faker class Locations + # reopening class end end diff --git a/lib/faker/movies.rb b/lib/faker/movies.rb index ec6cdfbe0b..f73fa1e665 100644 --- a/lib/faker/movies.rb +++ b/lib/faker/movies.rb @@ -2,5 +2,6 @@ module Faker class Movies + # reopening class end end diff --git a/lib/faker/music.rb b/lib/faker/music.rb index 6c45a05ee4..fe65f9abe1 100644 --- a/lib/faker/music.rb +++ b/lib/faker/music.rb @@ -142,4 +142,4 @@ def mambo_no_5 end end end -end \ No newline at end of file +end diff --git a/lib/faker/quotes.rb b/lib/faker/quotes.rb index a6062cdd1a..a1cb98a9e0 100644 --- a/lib/faker/quotes.rb +++ b/lib/faker/quotes.rb @@ -2,5 +2,6 @@ module Faker class Quotes + # reopening class end end diff --git a/lib/faker/religion.rb b/lib/faker/religion.rb index c8c4102b65..a082e8f6ad 100644 --- a/lib/faker/religion.rb +++ b/lib/faker/religion.rb @@ -2,5 +2,6 @@ module Faker module Religion + # reopening class end end diff --git a/lib/faker/sports.rb b/lib/faker/sports.rb index 61d6ae127c..2299705be4 100644 --- a/lib/faker/sports.rb +++ b/lib/faker/sports.rb @@ -2,5 +2,6 @@ module Faker class Sports + # reopening class end end diff --git a/lib/faker/travel.rb b/lib/faker/travel.rb index 6aab06871e..468d156dd4 100644 --- a/lib/faker/travel.rb +++ b/lib/faker/travel.rb @@ -2,5 +2,6 @@ module Faker class Travel + # reopening class end end diff --git a/lib/faker/tv_shows.rb b/lib/faker/tv_shows.rb index bc16b3f022..fa207dcbf7 100644 --- a/lib/faker/tv_shows.rb +++ b/lib/faker/tv_shows.rb @@ -2,5 +2,6 @@ module Faker class TvShows + # reopening class end end diff --git a/test/test_determinism.rb b/test/test_determinism.rb index fff8b911bd..959eb9e042 100644 --- a/test/test_determinism.rb +++ b/test/test_determinism.rb @@ -8,7 +8,7 @@ def setup @all_methods = all_methods.freeze @first_run = [] end -# + def test_determinism Faker::Config.random = Random.new(42) From 76a9d16da5ae3ff31eaf2459cde45434ee60d202 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 18:16:28 -0700 Subject: [PATCH 06/11] run benchmarks and profiler, and document results --- benchmark/load.rb | 10 ++++++++ benchmark/load_faker.rb | 8 ++++++ experiments/autoload.md | 56 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 benchmark/load.rb create mode 100644 benchmark/load_faker.rb create mode 100644 experiments/autoload.md diff --git a/benchmark/load.rb b/benchmark/load.rb new file mode 100644 index 0000000000..7e828246ca --- /dev/null +++ b/benchmark/load.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +require 'benchmark/ips' + +Benchmark.ips do |x| + x.report('require') { system('ruby load_faker.rb') } + x.report('autoload') { system('AUTOLOAD=1 ruby load_faker.rb') } + + x.compare!(order: :baseline) +end diff --git a/benchmark/load_faker.rb b/benchmark/load_faker.rb new file mode 100644 index 0000000000..3d1c146253 --- /dev/null +++ b/benchmark/load_faker.rb @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +if defined?(Faker) + raise 'fake is already defined...' +end + +load('/Users/stefannibrasil/projects/faker/lib/faker.rb') diff --git a/experiments/autoload.md b/experiments/autoload.md new file mode 100644 index 0000000000..b8bb22bd32 --- /dev/null +++ b/experiments/autoload.md @@ -0,0 +1,56 @@ +# Autoload with zeitwerk experiment results + +Branch: [sb-autoload-zeitwerk-experiment-3207]() +Date: February 17th, 2026 +Owner(s): Stefanni Brasil and Thiago Araujo + +## Impact + +We want to compare improving faker's performance by lazy loading the generators or autoloading with Zeitwerk. This document shows the benchmarks, and other changes needed to configure Zeitwerk. + +With the experiments documented, we can assess the pros and cons of maintainability, fewer breaking changes, easier adoption factors as guiding points for choosing the strategy we will move forward. + +### Changes needed + +- load and require generators in the correct order + +Similarly to the [lazy load experiment](./lazy_load.md), it would be required to load `faker/music` and `faker/internet` first, before the nested namespaces such as `Faker::Music::BossaNova`, as they inherit from class `Music`, for example. + +- added a runtime dependency for the library + +#### File location changes + +To prevent other generators from erroring out due to namespace clashing, some generators have to be moved around (ex. `Faker::Quote` was moved from `/faker/quotes/quote` to `faker/default/quote`). Users can still use the generators as before, their namespaces didn't change. + +### Benefits + +- less code changes than lazy loading, and lots of customization options available (i.e., eager loading) +- no breaking changes +- code is extremely faster, but a bit slower than lazy loading +- we can enable this as an opt-in configuration + +## Results + +Machine specs: Apple M1 Pro 16GB memory on MacOS Sequoia 15.7.3. + +profiler: + +[AUTOLOAD=1 bundle exec vernier run -- ruby -e "require 'faker'"](https://share.firefox.dev/4aAJJee) +[bundle exec vernier run -- ruby -e "require 'faker'"](https://share.firefox.dev/4bWViih) + +benchmark: + +```sh +benchmark % ruby load.rb +ruby 3.3.10 (2025-10-23 revision 343ea05002) [arm64-darwin24] +Warming up -------------------------------------- + require 1.000 i/100ms + autoload 1.000 i/100ms +Calculating ------------------------------------- + require 6.026 (± 0.0%) i/s (165.96 ms/i) - 31.000 in 5.145463s + autoload 11.730 (± 0.0%) i/s (85.25 ms/i) - 59.000 in 5.032426s + +Comparison: + require: 6.0 i/s + autoload: 11.7 i/s - 1.95x faster +``` From b95a731fad19b414e2de064c9186e0e8fa5a75df Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 18:16:35 -0700 Subject: [PATCH 07/11] cleaning up --- experiments/lazy_load.md | 7 ++++--- test/test_determinism.rb | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/experiments/lazy_load.md b/experiments/lazy_load.md index 43009c7f30..4aba6c9217 100644 --- a/experiments/lazy_load.md +++ b/experiments/lazy_load.md @@ -1,6 +1,6 @@ # Lazy load experiment results -Branch: sb-ta/lazy-load-experiment +Branch: [sb-ta/lazy-load-experiment](https://github.com/faker-ruby/faker/compare/main...sb-ta/lazy-load-experiment) Date: February 10th, 2026 Owner(s): Stefanni Brasil and Thiago Araujo @@ -21,11 +21,12 @@ To prevent other generators from erroring out due to namespace clashing, some ge - no additional dependencies needed - code is extremely faster -- we can enable this as an opt-in configuration +- no breaking changes +- we can enable this as an opt-in configuration, but any other customization would need to be implemented ## Results -Machine specs: Apple M1 Pro 16GB memory on MacOS Sequoia 15.7.3.. +Machine specs: Apple M1 Pro 16GB memory on MacOS Sequoia 15.7.3. profiler: diff --git a/test/test_determinism.rb b/test/test_determinism.rb index 959eb9e042..0dd805d125 100644 --- a/test/test_determinism.rb +++ b/test/test_determinism.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require_relative 'test_helper' - # rubocop:disable Security/Eval,Style/EvalWithLocation class TestDeterminism < Test::Unit::TestCase def setup From ab4a5351261f81af15fa6a8facaeeb5d7c2b4642 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 18:17:09 -0700 Subject: [PATCH 08/11] run CI with autoload enabled --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 283959e203..dc22715ae7 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -58,4 +58,4 @@ jobs: bundler-cache: true - name: Run tests - run: bundle exec rake test + run: AUTOLOAD=1 bundle exec rake test From a229ffdf19497c20e6b23e931815a6e0dfecfd32 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 18:18:03 -0700 Subject: [PATCH 09/11] oops --- experiments/autoload.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experiments/autoload.md b/experiments/autoload.md index b8bb22bd32..35df5924ba 100644 --- a/experiments/autoload.md +++ b/experiments/autoload.md @@ -1,6 +1,6 @@ # Autoload with zeitwerk experiment results -Branch: [sb-autoload-zeitwerk-experiment-3207]() +Branch: [sb-autoload-zeitwerk-experiment-3207](https://github.com/faker-ruby/faker/compare/sb-autoload-zeitwerk-experiment-3207?expand=1) Date: February 17th, 2026 Owner(s): Stefanni Brasil and Thiago Araujo From d65715770c50f77a0c46bedb254b720ba53b9246 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 17 Feb 2026 18:23:26 -0700 Subject: [PATCH 10/11] zeitwerk with ruby 3.1 fails --- experiments/autoload.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/experiments/autoload.md b/experiments/autoload.md index 35df5924ba..61e2fe411b 100644 --- a/experiments/autoload.md +++ b/experiments/autoload.md @@ -18,6 +18,8 @@ Similarly to the [lazy load experiment](./lazy_load.md), it would be required to - added a runtime dependency for the library +- Zeitwerk 2.7 requires Ruby >= 3.2. This isn't a deal breaker because we will remove EOL Ruby 3.1 soon, but it would require releasing that version separately. + #### File location changes To prevent other generators from erroring out due to namespace clashing, some generators have to be moved around (ex. `Faker::Quote` was moved from `/faker/quotes/quote` to `faker/default/quote`). Users can still use the generators as before, their namespaces didn't change. @@ -25,7 +27,6 @@ To prevent other generators from erroring out due to namespace clashing, some ge ### Benefits - less code changes than lazy loading, and lots of customization options available (i.e., eager loading) -- no breaking changes - code is extremely faster, but a bit slower than lazy loading - we can enable this as an opt-in configuration From a93c7e6fa265b567480d4d4019c157631768a114 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Thu, 19 Feb 2026 10:46:20 -0700 Subject: [PATCH 11/11] Add one limitation of using zeitwerk [skip-ci] Talked with Jeremy Evans via email and this important aspect needs to be documented. --- experiments/autoload.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/experiments/autoload.md b/experiments/autoload.md index 61e2fe411b..4613fa825d 100644 --- a/experiments/autoload.md +++ b/experiments/autoload.md @@ -20,6 +20,8 @@ Similarly to the [lazy load experiment](./lazy_load.md), it would be required to - Zeitwerk 2.7 requires Ruby >= 3.2. This isn't a deal breaker because we will remove EOL Ruby 3.1 soon, but it would require releasing that version separately. +- our other goal besides improving performance, is allowing users to create their own Faker generators. Zeitwerk scans the file systems to setup the autoloads, so it would not setup autoloads for these external generators. + #### File location changes To prevent other generators from erroring out due to namespace clashing, some generators have to be moved around (ex. `Faker::Quote` was moved from `/faker/quotes/quote` to `faker/default/quote`). Users can still use the generators as before, their namespaces didn't change.