faker 2.1.2 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +113 -7
  3. data/README.md +4 -4
  4. data/lib/faker.rb +56 -1
  5. data/lib/faker/blockchain/aeternity.rb +70 -0
  6. data/lib/faker/blockchain/bitcoin.rb +26 -0
  7. data/lib/faker/blockchain/ethereum.rb +10 -0
  8. data/lib/faker/blockchain/tezos.rb +62 -6
  9. data/lib/faker/books/book.rb +36 -0
  10. data/lib/faker/books/culture_series.rb +49 -0
  11. data/lib/faker/books/dune.rb +66 -5
  12. data/lib/faker/books/lovecraft.rb +210 -7
  13. data/lib/faker/creature/animal.rb +9 -0
  14. data/lib/faker/creature/cat.rb +27 -0
  15. data/lib/faker/creature/dog.rb +72 -0
  16. data/lib/faker/creature/horse.rb +18 -0
  17. data/lib/faker/default/address.rb +25 -5
  18. data/lib/faker/default/alphanumeric.rb +56 -7
  19. data/lib/faker/default/app.rb +54 -1
  20. data/lib/faker/default/appliance.rb +18 -0
  21. data/lib/faker/default/artist.rb +9 -0
  22. data/lib/faker/default/avatar.rb +42 -1
  23. data/lib/faker/default/bank.rb +10 -2
  24. data/lib/faker/default/boolean.rb +16 -1
  25. data/lib/faker/default/chile_rut.rb +12 -2
  26. data/lib/faker/default/code.rb +16 -3
  27. data/lib/faker/default/commerce.rb +17 -3
  28. data/lib/faker/default/company.rb +10 -2
  29. data/lib/faker/default/crypto_coin.rb +15 -3
  30. data/lib/faker/default/date.rb +37 -5
  31. data/lib/faker/default/demographic.rb +5 -1
  32. data/lib/faker/default/dessert.rb +27 -0
  33. data/lib/faker/default/device.rb +54 -0
  34. data/lib/faker/default/driving_licence.rb +10 -4
  35. data/lib/faker/default/electrical_components.rb +27 -0
  36. data/lib/faker/default/file.rb +19 -2
  37. data/lib/faker/default/fillmurray.rb +9 -1
  38. data/lib/faker/default/finance.rb +5 -1
  39. data/lib/faker/default/gender.rb +18 -0
  40. data/lib/faker/default/greek_philosophers.rb +18 -0
  41. data/lib/faker/default/hacker.rb +59 -1
  42. data/lib/faker/default/hipster.rb +45 -6
  43. data/lib/faker/default/house.rb +18 -0
  44. data/lib/faker/default/id_number.rb +11 -3
  45. data/lib/faker/default/industry_segments.rb +36 -0
  46. data/lib/faker/default/internet.rb +94 -13
  47. data/lib/faker/default/invoice.rb +16 -3
  48. data/lib/faker/default/json.rb +19 -2
  49. data/lib/faker/default/lorem.rb +81 -10
  50. data/lib/faker/default/lorem_flickr.rb +38 -5
  51. data/lib/faker/default/lorem_pixel.rb +10 -1
  52. data/lib/faker/default/markdown.rb +6 -1
  53. data/lib/faker/default/marketing.rb +9 -0
  54. data/lib/faker/default/measurement.rb +40 -8
  55. data/lib/faker/default/military.rb +45 -0
  56. data/lib/faker/default/name.rb +5 -1
  57. data/lib/faker/default/nato_phonetic_alphabet.rb +9 -0
  58. data/lib/faker/default/nhs.rb +5 -1
  59. data/lib/faker/default/number.rb +56 -11
  60. data/lib/faker/default/omniauth.rb +92 -9
  61. data/lib/faker/default/phone_number.rb +5 -1
  62. data/lib/faker/default/placeholdit.rb +11 -1
  63. data/lib/faker/default/programming_language.rb +18 -0
  64. data/lib/faker/default/relationship.rb +5 -1
  65. data/lib/faker/default/science.rb +27 -0
  66. data/lib/faker/default/source.rb +59 -3
  67. data/lib/faker/default/string.rb +5 -1
  68. data/lib/faker/default/stripe.rb +20 -4
  69. data/lib/faker/default/subscription.rb +45 -0
  70. data/lib/faker/default/superhero.rb +45 -0
  71. data/lib/faker/default/time.rb +37 -4
  72. data/lib/faker/default/twitter.rb +32 -18
  73. data/lib/faker/default/types.rb +27 -5
  74. data/lib/faker/default/vehicle.rb +17 -4
  75. data/lib/faker/default/world_cup.rb +11 -2
  76. data/lib/faker/games/dota.rb +52 -1
  77. data/lib/faker/games/elder_scrolls.rb +72 -0
  78. data/lib/faker/games/fallout.rb +37 -0
  79. data/lib/faker/games/game.rb +27 -0
  80. data/lib/faker/games/half_life.rb +27 -0
  81. data/lib/faker/games/heroes.rb +27 -0
  82. data/lib/faker/games/heroes_of_the_storm.rb +36 -0
  83. data/lib/faker/games/league_of_legends.rb +54 -0
  84. data/lib/faker/games/myst.rb +45 -0
  85. data/lib/faker/games/overwatch.rb +27 -0
  86. data/lib/faker/games/pokemon.rb +27 -0
  87. data/lib/faker/games/sonic_the_hedgehog.rb +27 -0
  88. data/lib/faker/games/super_smash_bros.rb +18 -0
  89. data/lib/faker/games/witcher.rb +54 -0
  90. data/lib/faker/games/world_of_warcraft.rb +18 -0
  91. data/lib/faker/games/zelda.rb +36 -0
  92. data/lib/faker/japanese_media/dragon_ball.rb +9 -0
  93. data/lib/faker/japanese_media/sword_art_online.rb +36 -0
  94. data/lib/faker/movies/hobbit.rb +37 -0
  95. data/lib/faker/movies/movie.rb +9 -0
  96. data/lib/faker/movies/star_wars.rb +6 -4
  97. data/lib/faker/music/grateful_dead.rb +18 -0
  98. data/lib/faker/music/phish.rb +9 -0
  99. data/lib/faker/music/rock_band.rb +9 -0
  100. data/lib/faker/tv_shows/breaking_bad.rb +18 -0
  101. data/lib/faker/version.rb +1 -1
  102. data/lib/locales/en-CA.yml +1 -1
  103. data/lib/locales/en/science.yml +1 -1
  104. data/lib/locales/ja.yml +8 -9
  105. metadata +31 -14
@@ -4,10 +4,28 @@ module Faker
4
4
  class Games
5
5
  class SuperSmashBros < Base
6
6
  class << self
7
+ ##
8
+ # Produces the name of a fighter from the Smash Bros games.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Games::SuperSmashBros.fighter #=> "Mario"
14
+ #
15
+ # @faker.version 1.9.2
7
16
  def fighter
8
17
  fetch('games.super_smash_bros.fighter')
9
18
  end
10
19
 
20
+ ##
21
+ # Produces the name of a stage from the Smash Bros games.
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Games::SuperSmashBros.stage #=> "Final Destination"
27
+ #
28
+ # @faker.version 1.9.2
11
29
  def stage
12
30
  fetch('games.super_smash_bros.stage')
13
31
  end
@@ -4,26 +4,80 @@ module Faker
4
4
  class Games
5
5
  class Witcher < Base
6
6
  class << self
7
+ ##
8
+ # Produces the name of a character from The Witcher.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Games::Witcher.character #=> "Triss Merigold"
14
+ #
15
+ # @faker.version 1.8.3
7
16
  def character
8
17
  fetch('games.witcher.characters')
9
18
  end
10
19
 
20
+ ##
21
+ # Produces the name of a witcher from The Witcher.
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Games::Witcher.witcher #=> "Geralt of Rivia"
27
+ #
28
+ # @faker.version 1.8.3
11
29
  def witcher
12
30
  fetch('games.witcher.witchers')
13
31
  end
14
32
 
33
+ ##
34
+ # Produces the name of a school from The Witcher.
35
+ #
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ # Faker::Games::Witcher.school #=> "Wolf"
40
+ #
41
+ # @faker.version 1.8.3
15
42
  def school
16
43
  fetch('games.witcher.schools')
17
44
  end
18
45
 
46
+ ##
47
+ # Produces the name of a location from The Witcher.
48
+ #
49
+ # @return [String]
50
+ #
51
+ # @example
52
+ # Faker::Games::Witcher.location #=> "Novigrad"
53
+ #
54
+ # @faker.version 1.8.3
19
55
  def location
20
56
  fetch('games.witcher.locations')
21
57
  end
22
58
 
59
+ ##
60
+ # Produces a quote from The Witcher.
61
+ #
62
+ # @return [String]
63
+ #
64
+ # @example
65
+ # Faker::Games::Witcher.quote #=> "No Lollygagin'!"
66
+ #
67
+ # @faker.version 1.8.3
23
68
  def quote
24
69
  fetch('games.witcher.quotes')
25
70
  end
26
71
 
72
+ ##
73
+ # Produces the name of a monster from The Witcher.
74
+ #
75
+ # @return [String]
76
+ #
77
+ # @example
78
+ # Faker::Games::Witcher.monster #=> "Katakan"
79
+ #
80
+ # @faker.version 1.8.3
27
81
  def monster
28
82
  fetch('games.witcher.monsters')
29
83
  end
@@ -4,10 +4,28 @@ module Faker
4
4
  class Games
5
5
  class WorldOfWarcraft < Base
6
6
  class << self
7
+ ##
8
+ # Produces the name of a hero from World of Warcraft.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Games::WorldOfWarcraft.hero #=> "Uther the Lightbringer"
14
+ #
15
+ # @faker.version 1.9.2
7
16
  def hero
8
17
  fetch('games.world_of_warcraft.hero')
9
18
  end
10
19
 
20
+ ##
21
+ # Produces a quote from World of Warcraft.
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Games::WorldOfWarcraft.quote #=> "These are dark times indeed."
27
+ #
28
+ # @faker.version 1.9.2
11
29
  def quote
12
30
  fetch('games.world_of_warcraft.quotes')
13
31
  end
@@ -5,18 +5,54 @@ module Faker
5
5
  class Zelda < Base
6
6
  flexible :space
7
7
  class << self
8
+ ##
9
+ # Produces the name of a Legend of Zelda game.
10
+ #
11
+ # @return [String]
12
+ #
13
+ # @example
14
+ # Faker::Games::Zelda.game #=> "Breath of the Wild"
15
+ #
16
+ # @faker.version 1.7.3
8
17
  def game
9
18
  fetch('games.zelda.games')
10
19
  end
11
20
 
21
+ ##
22
+ # Produces the name of a character from the Legend of Zelda games.
23
+ #
24
+ # @return [String]
25
+ #
26
+ # @example
27
+ # Faker::Games::Zelda.character #=> "Link"
28
+ #
29
+ # @faker.version 1.7.3
12
30
  def character
13
31
  fetch('games.zelda.characters')
14
32
  end
15
33
 
34
+ ##
35
+ # Produces the name of a character from the Legend of Zelda games.
36
+ #
37
+ # @return [String]
38
+ #
39
+ # @example
40
+ # Faker::Games::Zelda.location #=> "Hyrule Castle"
41
+ #
42
+ # @faker.version 1.7.3
16
43
  def location
17
44
  fetch('games.zelda.locations')
18
45
  end
19
46
 
47
+ ##
48
+ # Produces the name of an item from the Legend of Zelda games.
49
+ #
50
+ # @return [String]
51
+ #
52
+ # @example
53
+ # Faker::Games::Zelda.item #=> "Boomerang"
54
+ #
55
+ # @faker.version 1.7.3
20
56
  def item
21
57
  fetch('games.zelda.items')
22
58
  end
@@ -4,6 +4,15 @@ module Faker
4
4
  class JapaneseMedia
5
5
  class DragonBall < Base
6
6
  class << self
7
+ ##
8
+ # Produces the name of a character from Dragon Ball.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Games::DragonBall.character #=> "Goku"
14
+ #
15
+ # @faker.version 1.8.0
7
16
  def character
8
17
  fetch('dragon_ball.characters')
9
18
  end
@@ -4,18 +4,54 @@ module Faker
4
4
  class JapaneseMedia
5
5
  class SwordArtOnline < Base
6
6
  class << self
7
+ ##
8
+ # Produces the real name of a character from Sword Art Online.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::JapaneseMedia::SwordArtOnline.real_name #=> "Kirigaya Kazuto"
14
+ #
15
+ # @faker.version 1.9.0
7
16
  def real_name
8
17
  fetch('sword_art_online.real_name')
9
18
  end
10
19
 
20
+ ##
21
+ # Produces the in-game name of a character from Sword Art Online.
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::JapaneseMedia::SwordArtOnline.game_name #=> "Silica"
27
+ #
28
+ # @faker.version 1.9.0
11
29
  def game_name
12
30
  fetch('sword_art_online.game_name')
13
31
  end
14
32
 
33
+ ##
34
+ # Produces the name of a location from Sword Art Online.
35
+ #
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ # Faker::JapaneseMedia::SwordArtOnline.location #=> "Ruby Palace"
40
+ #
41
+ # @faker.version 1.9.0
15
42
  def location
16
43
  fetch('sword_art_online.location')
17
44
  end
18
45
 
46
+ ##
47
+ # Produces the name of an item from Sword Art Online.
48
+ #
49
+ # @return [String]
50
+ #
51
+ # @example
52
+ # Faker::JapaneseMedia::SwordArtOnline.item #=> "Blackwyrm Coat"
53
+ #
54
+ # @faker.version 1.9.0
19
55
  def item
20
56
  fetch('sword_art_online.item')
21
57
  end
@@ -4,18 +4,55 @@ module Faker
4
4
  class Movies
5
5
  class Hobbit < Base
6
6
  class << self
7
+ ##
8
+ # Produces the name of a character from The Hobbit.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Movies::Hobbit.character #=> "Gandalf the Grey"
14
+ #
15
+ # @faker.version 1.8.0
7
16
  def character
8
17
  fetch('hobbit.character')
9
18
  end
10
19
 
20
+ ##
21
+ # Produces the name of one of the 13 dwarves from the Company, or Gandalf or Bilbo.
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Movies::Hobbit.thorins_company #=> "Thorin Oakenshield"
27
+ #
28
+ # @faker.version 1.8.0
11
29
  def thorins_company
12
30
  fetch('hobbit.thorins_company')
13
31
  end
14
32
 
33
+ ##
34
+ # Produces a quote from The Hobbit.
35
+ #
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ # Faker::Movies::Hobbit.quote
40
+ # #=> "Never laugh at live dragons, Bilbo you fool!"
41
+ #
42
+ # @faker.version 1.8.0
15
43
  def quote
16
44
  fetch('hobbit.quote')
17
45
  end
18
46
 
47
+ ##
48
+ # Produces the name of a location from The Hobbit.
49
+ #
50
+ # @return [String]
51
+ #
52
+ # @example
53
+ # Faker::Movies::Hobbit.location #=> "The Shire"
54
+ #
55
+ # @faker.version 1.8.0
19
56
  def location
20
57
  fetch('hobbit.location')
21
58
  end
@@ -3,6 +3,15 @@
3
3
  module Faker
4
4
  class Movie < Base
5
5
  class << self
6
+ ##
7
+ # Produces a quote from a movie.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::Movie.quote #=> "Bumble bee tuna"
13
+ #
14
+ # @faker.version 1.8.1
6
15
  def quote
7
16
  fetch('movie.quote')
8
17
  end
@@ -44,7 +44,11 @@ module Faker
44
44
  sentence + sample(['.', '?', '!'])
45
45
  end
46
46
 
47
- def quote(character: nil)
47
+ def quote(legacy_character = NOT_GIVEN, character: nil)
48
+ warn_for_deprecated_arguments do |keywords|
49
+ keywords << :character if legacy_character != NOT_GIVEN
50
+ end
51
+
48
52
  quoted_characters = translate('faker.star_wars.quotes')
49
53
 
50
54
  if character.nil?
@@ -57,9 +61,7 @@ module Faker
57
61
  character = k.to_s if v.include?(character)
58
62
  end
59
63
 
60
- unless quoted_characters.key?(character.to_sym)
61
- raise ArgumentError, "Character for quotes can be left blank or #{quoted_characters.keys.join(', ')}"
62
- end
64
+ raise ArgumentError, "Character for quotes can be left blank or #{quoted_characters.keys.join(', ')}" unless quoted_characters.key?(character.to_sym)
63
65
  end
64
66
 
65
67
  fetch('star_wars.quotes.' + character)
@@ -6,10 +6,28 @@ module Faker
6
6
  class Music
7
7
  class GratefulDead < Base
8
8
  class << self
9
+ ##
10
+ # Produces the name of a member of The Grateful Dead.
11
+ #
12
+ # @return [String]
13
+ #
14
+ # @example
15
+ # Faker::Music::GratefulDead.player #=> "Jerry Garcia"
16
+ #
17
+ # @faker.version 1.9.2
9
18
  def player
10
19
  fetch('grateful_dead.players')
11
20
  end
12
21
 
22
+ ##
23
+ # Produces the name of a song by The Grateful Dead.
24
+ #
25
+ # @return [String]
26
+ #
27
+ # @example
28
+ # Faker::Music::GratefulDead.song #=> "Cassidy"
29
+ #
30
+ # @faker.version 1.9.2
13
31
  def song
14
32
  fetch('grateful_dead.songs')
15
33
  end
@@ -4,6 +4,15 @@ module Faker
4
4
  class Music
5
5
  class Phish < Base
6
6
  class << self
7
+ ##
8
+ # Produces the name of a song by Phish.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Music::Phish.song #=> "Tweezer"
14
+ #
15
+ # @faker.version 1.9.2
7
16
  def song
8
17
  fetch('phish.song')
9
18
  end
@@ -4,6 +4,15 @@ module Faker
4
4
  class Music
5
5
  class RockBand < Base
6
6
  class << self
7
+ ##
8
+ # Produces the name of a rock band.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Music::RockBand.name #=> "Led Zeppelin"
14
+ #
15
+ # @faker.version 1.7.0
7
16
  def name
8
17
  fetch('rock_band.name')
9
18
  end
@@ -6,10 +6,28 @@ module Faker
6
6
  flexible :breaking_bad
7
7
 
8
8
  class << self
9
+ ##
10
+ # Produces the name of a character from Breaking Bad.
11
+ #
12
+ # @return [String]
13
+ #
14
+ # @example
15
+ # Faker::TvShows::BreakingBad.character #=> "Walter White"
16
+ #
17
+ # @faker.version 1.8.8
9
18
  def character
10
19
  fetch('breaking_bad.character')
11
20
  end
12
21
 
22
+ ##
23
+ # Produces the name of an episode from Breaking Bad.
24
+ #
25
+ # @return [String]
26
+ #
27
+ # @example
28
+ # Faker::TvShows::BreakingBad.episode #=> "Fly"
29
+ #
30
+ # @faker.version 1.8.8
13
31
  def episode
14
32
  fetch('breaking_bad.episode')
15
33
  end