diff --git a/doc/unreleased/games/game.md b/doc/unreleased/games/game.md new file mode 100644 index 0000000000..c16a0188ce --- /dev/null +++ b/doc/unreleased/games/game.md @@ -0,0 +1,12 @@ +# Faker::Game + +```ruby +# Random Game Title +Faker::Game.title #=> "Half-Life" + +# Random Game Genre +Faker::Game.genre #=> "First-person shooter" + +# Random Game Platform +Faker::Game.platform #=> "Nintendo DS" +``` diff --git a/lib/faker/games/game.rb b/lib/faker/games/game.rb new file mode 100644 index 0000000000..12cd9c1e0d --- /dev/null +++ b/lib/faker/games/game.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Faker + class Game < Base + flexible :game + + class << self + def title + fetch('game.title') + end + + def genre + fetch('game.genre') + end + + def platform + fetch('game.platform') + end + end + end +end diff --git a/lib/locales/en/game.yml b/lib/locales/en/game.yml new file mode 100644 index 0000000000..defe7bba8f --- /dev/null +++ b/lib/locales/en/game.yml @@ -0,0 +1,251 @@ +en: + faker: + game: + title: + - 'Half-Life' + - 'Half-Life: Opposing Force' + - 'Half-Life: Blue Shift' + - 'Half-Life 2' + - 'Half-Life 2: Episode One' + - 'Half-Life 2: Episode Two' + - 'Half-Life 2: Lost Coast' + - 'Portal' + - 'Portal 2' + - 'Team Fortress Classic' + - 'Team Fortress 2' + - 'Left 4 Dead' + - 'Left 4 Dead 2' + - 'Day of Defeat' + - 'Ricochet' + - 'Dota 2' + - 'Counter-Strike' + - 'Counter-Strike: Source' + - 'Counter-Strike: Global Offensive' + - "Garry's Mod" + - 'Super Mario Bros.' + - 'Super Mario Bros. 2' + - 'Super Mario Bros. 3' + - 'Super Mario World' + - 'Super Mario Sunshine' + - 'Super Mario Galaxy' + - 'Super Mario Galaxy 2' + - 'Super Mario Odyssey' + - 'Mario Kart 64' + - 'Mario Kart: Double Dash' + - 'Mario Kart DS' + - 'Mario Kart Wii' + - 'Mario Kart 7' + - 'Mario Kart 8' + - 'Mario Kart 8 Deluxe' + - "Luigi's Mansion" + - 'Animal Crossing' + - 'Animal Crossing: Wild World' + - 'Animal Crossing: City Folk' + - 'Animal Crossing: New Leaf' + - 'Civilization III' + - 'Civilization IV' + - 'Civilization V' + - 'Civilization VI' + - 'The Legend of Zelda' + - 'The Legend of Zelda: Ocarina of Time' + - "The Legend of Zelda: Majora's Mask" + - 'The Legend of Zelda: Twilight Princess' + - 'The Legend of Zelda: Skyward Sword' + - 'The Legend of Zelda: Breath of the Wild' + - 'Pong' + - 'Pac-Man' + - 'Starcraft' + - 'Starcraft II' + - 'Overwatch' + - 'Hearthstone' + - 'Halo: Combat Evolved' + - 'Halo 2' + - 'Halo 3' + - 'Halo 3: ODST' + - 'Halo: Reach' + - 'Halo 4' + - 'Halo 5: Guardians' + - 'Wii Sports' + - 'Wii Sports Resort' + - 'Wii Play' + - 'Wii Music' + - 'Pokémon Red' + - 'Pokémon Blue' + - 'Pokémon Yellow' + - 'Pokémon Gold' + - 'Pokémon Silver' + - 'Pokémon Crystal' + - 'Pokémon Ruby' + - 'Pokémon Sapphire' + - 'Pokémon FireRed' + - 'Pokémon LeafGreen' + - 'Pokémon Emerald' + - 'Pokémon Diamond' + - 'Pokémon Pearl' + - 'Pokémon Platinum' + - 'Pokémon HeartGold' + - 'Pokémon SoulSilver' + - 'Pokémon Black' + - 'Pokémon White' + - 'Pokémon Black 2' + - 'Pokémon White 2' + - 'Pokémon X' + - 'Pokémon Y' + - 'Pokémon Omega Ruby' + - 'Pokémon Alpha Sapphire' + - 'Pokémon Sun' + - 'Pokémon Moon' + - 'Pokémon Ultra Sun' + - 'Pokémon Ultra Moon' + - "Pokémon: Let's Go Pikachu!" + - "Pokémon: Let's Go Eevee!" + - 'Pokémon Sword' + - 'Pokémon Shield' + - 'Doom' + - 'Doom II' + - 'Doom 3: BFG' + - 'Quake' + - 'Wolfenstein 3D' + - 'Wolfenstein: The New Order' + - 'Wolfenstein: The Old Blood' + - 'Wolfenstein 2: The New Colossus' + - 'Puyo Puyo Tetris' + - 'Katamari Damacy' + - 'Bastion' + - 'Transistor' + - 'System Shock' + - 'BioShock' + - 'BioShock Infinite' + - 'Deus Ex' + - 'Metroid Prime' + - 'Metroid Prime 2: Echoes' + - 'Metroid Prime 3: Corruption' + - 'Super Meat Boy' + - 'Super Smash Bros. Brawl' + - 'Super Smash Bros. Melee' + - 'Super Smash Bros. Ultimate' + - 'Thief II' + - 'Vampire: The Masquerade – Bloodlines' + - 'Myst' + - 'Batman: Arkham Asylum' + - 'Batman: Arkham City' + - 'Dishonored' + - 'God of War' + - 'LittleBigPlanet' + - 'Grim Fandango' + - 'Day of the Tentacle' + - 'Kingdom Hearts' + - 'Kingdom Hearts II' + - 'The Last of Us' + - 'Perfect Dark' + - 'Shadow of the Colossus' + - 'Fallout: New Vegas' + - 'Fire Emblem Awakening' + - "Banjo-Kazooie: Grunty's Revenge" + - 'Banjo-Kazooie: Nuts & Bolts' + - 'Firewatch' + - 'Mass Effect' + - 'Mass Effect 2' + - 'Mass Effect 3' + - 'Mega Man' + - 'Mega Man Battle Network' + - 'Bayonetta' + - 'Bayonetta 2' + - 'The Wonderful 101' + - 'Sleeping Dogs' + - 'Battletoads' + - 'Brütal Legend' + - 'Halo Wars' + - 'Clannad' + - 'Highway Blossoms' + - 'Infamous' + - 'Crash Bandicoot' + - 'Just Cause' + - 'Just Cause 2' + - 'Devil May Cry' + - 'Life is Strange' + - 'WarioWare: Smooth Moves' + - 'WarioWare: Touched!' + - 'Dwarf Fortress' + - 'Dungeon Keeper' + - 'Minecraft' + - 'Fortnite' + - "PlayerUnknown's Battlegrounds" + - "Kirby's Adventure" + - "Kirby's Dream Land" + - "Kirby's Epic Yarn" + - "Yoshi's Wooly World" + - 'L.A. Noire' + - 'Kid Icarus' + - 'Ice Climbers' + - 'Crysis' + - 'Crysis 2' + - 'Hitman: Absolution' + - 'Metal Gear Solid' + - 'F-Zero' + - 'F.E.A.R.' + - 'Max Payne' + - 'Max Payne 2: The Fall of Max Payne' + - 'Max Payne 3' + - 'Far Cry' + - 'Castle Crashers' + - 'Sonic Unleashed' + - "Mirror's Edge" + - 'The Witcher' + - 'The Witcher 2: Assassins of Kings' + - 'The Witcher 3: Wild Hunt' + - 'Monster Hunter: World' + genre: + - 'First-person shooter' + - 'Puzzle' + - 'Platformer' + - 'Action' + - 'Adventure' + - 'Strategy' + - 'Role-playing game' + - 'Sports' + - 'Simulation' + - 'Fighting' + - 'Massively multiplayer online' + - 'Stealth' + - 'Survival' + - 'Rhythm' + - 'Survival horror' + - 'Text adventure' + - 'Visual novel' + - 'Real-time strategy' + - 'Multiplayer online battle arena' + - 'Tower defense' + - 'Trivia' + platform: + - 'Xbox' + - 'Xbox 360' + - 'Xbox One' + - 'PlayStation' + - 'PlayStation 2' + - 'PlayStation 3' + - 'PlayStation 4' + - 'PlayStation Portable' + - 'PlayStation Vita' + - 'Game Boy' + - 'Game Boy Color' + - 'Game Boy Advance' + - 'Nintendo DS' + - 'Nintendo DSi' + - 'Nintendo 3DS' + - 'Nintendo Entertainment System' + - 'Super Nintendo Entertainment System' + - 'Nintendo 64' + - 'GameCube' + - 'Wii' + - 'Wii U' + - 'Nintendo Switch' + - 'Windows' + - 'macOS' + - 'Linux' + - 'Sega Genesis' + - 'Sega Master System' + - 'Game Gear' + - 'Sega Saturn' + - 'Sega Dreamcast' + - 'Virtual Boy' diff --git a/test/faker/games/test_game.rb b/test/faker/games/test_game.rb new file mode 100644 index 0000000000..7983837b7b --- /dev/null +++ b/test/faker/games/test_game.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +class TestFakerGame < Test::Unit::TestCase + def setup + @tester = Faker::Game + end + + def test_title + assert @tester.title.match(/\w+/) + end + + def test_genre + assert @tester.genre.match(/\w+/) + end + + def test_platform + assert @tester.platform.match(/\w+/) + end +end diff --git a/unreleased_README.md b/unreleased_README.md index cdfa656222..da318f3e34 100644 --- a/unreleased_README.md +++ b/unreleased_README.md @@ -231,6 +231,7 @@ gem 'faker', :git => 'https://github.com/stympy/faker.git', :branch => 'master' - [Faker::Creature::Horse](doc/unreleased/creature/horse.md) ### Games + - [Faker::Game](doc/games/game.md) - [Faker::Games::Dota](doc/unreleased/games/dota.md) - [Faker::Games::ElderScrolls](doc/unreleased/games/elder_scrolls.md) - [Faker::Games::Fallout](doc/unreleased/games/fallout.md)