faker 2.12.0 → 2.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +71 -0
  3. data/README.md +3 -0
  4. data/lib/faker.rb +2 -1
  5. data/lib/faker/default/address.rb +30 -0
  6. data/lib/faker/default/bank.rb +1 -1
  7. data/lib/faker/default/blood.rb +3 -3
  8. data/lib/faker/default/chile_rut.rb +44 -1
  9. data/lib/faker/default/company.rb +1 -3
  10. data/lib/faker/default/computer.rb +4 -4
  11. data/lib/faker/default/date.rb +16 -12
  12. data/lib/faker/default/gender.rb +1 -1
  13. data/lib/faker/default/id_number.rb +86 -0
  14. data/lib/faker/default/internet.rb +35 -7
  15. data/lib/faker/default/internet_http.rb +48 -0
  16. data/lib/faker/default/lorem_flickr.rb +65 -0
  17. data/lib/faker/default/lorem_pixel.rb +22 -0
  18. data/lib/faker/default/markdown.rb +89 -0
  19. data/lib/faker/default/name.rb +15 -0
  20. data/lib/faker/default/nhs.rb +19 -0
  21. data/lib/faker/default/number.rb +5 -7
  22. data/lib/faker/default/omniauth.rb +58 -5
  23. data/lib/faker/default/world_cup.rb +4 -4
  24. data/lib/faker/games/control.rb +8 -8
  25. data/lib/faker/games/dnd.rb +4 -4
  26. data/lib/faker/games/heroes_of_the_storm.rb +16 -5
  27. data/lib/faker/games/minecraft.rb +48 -0
  28. data/lib/faker/games/warhammer_fantasy.rb +5 -5
  29. data/lib/faker/movies/departed.rb +3 -3
  30. data/lib/faker/movies/movie.rb +13 -0
  31. data/lib/faker/music/pearl_jam.rb +3 -3
  32. data/lib/faker/music/phish.rb +2 -2
  33. data/lib/faker/music/prince.rb +64 -0
  34. data/lib/faker/music/rush.rb +37 -0
  35. data/lib/faker/music/show.rb +3 -3
  36. data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +13 -0
  37. data/lib/faker/tv_shows/big_bang_theory.rb +37 -0
  38. data/lib/faker/tv_shows/dr_who.rb +1 -1
  39. data/lib/faker/tv_shows/futurama.rb +65 -0
  40. data/lib/faker/tv_shows/simpsons.rb +14 -0
  41. data/lib/faker/tv_shows/suits.rb +2 -2
  42. data/lib/faker/version.rb +1 -1
  43. data/lib/helpers/base58.rb +1 -1
  44. data/lib/helpers/char.rb +20 -26
  45. data/lib/locales/en/aqua_teen_hunger_force.yml +33 -1
  46. data/lib/locales/en/bank.yml +1 -1
  47. data/lib/locales/en/big_bang_theory.yml +38 -0
  48. data/lib/locales/en/futurama.yml +344 -0
  49. data/lib/locales/en/heroes_of_the_storm.yml +1 -1
  50. data/lib/locales/en/minecraft.yml +390 -0
  51. data/lib/locales/en/movie.yml +192 -1
  52. data/lib/locales/en/name.yml +3 -2
  53. data/lib/locales/en/prince.yml +227 -0
  54. data/lib/locales/en/rush.yml +32 -0
  55. data/lib/locales/en/simpsons.yml +668 -0
  56. data/lib/locales/en/star_wars.yml +1 -0
  57. metadata +21 -10
@@ -15,6 +15,16 @@ module Faker
15
15
  end
16
16
 
17
17
  class << self
18
+ ##
19
+ # Generate a mock Omniauth response from Google.
20
+ #
21
+ # @param name [String] A specific name to return in the response.
22
+ # @param email [String] A specific email to return in the response.
23
+ # @param uid [String] A specific UID to return in the response.
24
+ #
25
+ # @return [Hash] An auth hash in the format provided by omniauth-google.
26
+ #
27
+ # @faker.version 1.8.0
18
28
  # rubocop:disable Metrics/ParameterLists
19
29
  def google(legacy_name = NOT_GIVEN, legacy_email = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, email: nil, uid: Number.number(digits: 9).to_s)
20
30
  # rubocop:enable Metrics/ParameterLists
@@ -72,6 +82,17 @@ module Faker
72
82
  }
73
83
  end
74
84
 
85
+ ##
86
+ # Generate a mock Omniauth response from Facebook.
87
+ #
88
+ # @param name [String] A specific name to return in the response.
89
+ # @param email [String] A specific email to return in the response.
90
+ # @param username [String] A specific username to return in the response.
91
+ # @param uid [String] A specific UID to return in the response.
92
+ #
93
+ # @return [Hash] An auth hash in the format provided by omniauth-facebook.
94
+ #
95
+ # @faker.version 1.8.0
75
96
  # rubocop:disable Metrics/ParameterLists
76
97
  def facebook(legacy_name = NOT_GIVEN, legacy_email = NOT_GIVEN, legacy_username = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, email: nil, username: nil, uid: Number.number(digits: 7).to_s)
77
98
  # rubocop:enable Metrics/ParameterLists
@@ -123,6 +144,16 @@ module Faker
123
144
  }
124
145
  end
125
146
 
147
+ ##
148
+ # Generate a mock Omniauth response from Twitter.
149
+ #
150
+ # @param name [String] A specific name to return in the response.
151
+ # @param nickname [String] A specific nickname to return in the response.
152
+ # @param uid [String] A specific UID to return in the response.
153
+ #
154
+ # @return [Hash] An auth hash in the format provided by omniauth-twitter.
155
+ #
156
+ # @faker.version 1.8.0
126
157
  # rubocop:disable Metrics/ParameterLists
127
158
  def twitter(legacy_name = NOT_GIVEN, legacy_nickname = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, nickname: nil, uid: Number.number(digits: 6).to_s)
128
159
  # rubocop:enable Metrics/ParameterLists
@@ -204,6 +235,16 @@ module Faker
204
235
  }
205
236
  end
206
237
 
238
+ ##
239
+ # Generate a mock Omniauth response from LinkedIn.
240
+ #
241
+ # @param name [String] A specific name to return in the response.
242
+ # @param email [String] A specific email to return in the response.
243
+ # @param uid [String] A specific UID to return in the response.
244
+ #
245
+ # @return [Hash] An auth hash in the format provided by omniauth-linkedin.
246
+ #
247
+ # @faker.version 1.8.0
207
248
  # rubocop:disable Metrics/ParameterLists
208
249
  def linkedin(legacy_name = NOT_GIVEN, legacy_email = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, email: nil, uid: Number.number(digits: 6).to_s)
209
250
  # rubocop:enable Metrics/ParameterLists
@@ -275,6 +316,16 @@ module Faker
275
316
  }
276
317
  end
277
318
 
319
+ ##
320
+ # Generate a mock Omniauth response from Github.
321
+ #
322
+ # @param name [String] A specific name to return in the response.
323
+ # @param email [String] A specific email to return in the response.
324
+ # @param uid [String] A specific UID to return in the response.
325
+ #
326
+ # @return [Hash] An auth hash in the format provided by omniauth-github.
327
+ #
328
+ # @faker.version 1.8.0
278
329
  # rubocop:disable Metrics/ParameterLists
279
330
  def github(legacy_name = NOT_GIVEN, legacy_email = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, email: nil, uid: Number.number(digits: 8).to_s)
280
331
  # rubocop:enable Metrics/ParameterLists
@@ -342,13 +393,15 @@ module Faker
342
393
  end
343
394
 
344
395
  ##
345
- # Generate a mock Omniauth response from Apple
396
+ # Generate a mock Omniauth response from Apple.
397
+ #
398
+ # @param name [String] A specific name to return in the response.
399
+ # @param email [String] A specific email to return in the response.
400
+ # @param uid [String] A specific UID to return in the response.
346
401
  #
347
- # @param name [String] A specific name to return in the response
348
- # @param email [String] A specific email to return in the response
349
- # @param uid [String] A specific UID to return in the response
402
+ # @return [Hash] An auth hash in the format provided by omniauth-apple.
350
403
  #
351
- # @return [Hash] An auth hash in the format provided by omniauth-apple
404
+ # @faker.version 2.3.0
352
405
  def apple(name: nil, email: nil, uid: nil)
353
406
  uid ||= "#{Number.number(digits: 6)}.#{Number.hexadecimal(digits: 32)}.#{Number.number(digits: 4)}"
354
407
  auth = Omniauth.new(name: name, email: email)
@@ -24,7 +24,7 @@ module Faker
24
24
  # @example
25
25
  # Faker::WorldCup.city #=> "Moscow"
26
26
  #
27
- # @faker.version next
27
+ # @faker.version 2.13.0
28
28
  def city
29
29
  fetch('world_cup.cities')
30
30
  end
@@ -37,7 +37,7 @@ module Faker
37
37
  # @example
38
38
  # Faker::WorldCup.stadium #=> "Rostov Arena"
39
39
  #
40
- # @faker.version next
40
+ # @faker.version 2.13.0
41
41
  def stadium
42
42
  fetch('world_cup.stadiums')
43
43
  end
@@ -52,7 +52,7 @@ module Faker
52
52
  # @example
53
53
  # Faker::WorldCup.group #=> "Russia"
54
54
  #
55
- # @faker.version next
55
+ # @faker.version 2.13.0
56
56
  def group(legacy_group = NOT_GIVEN, group: 'group_A')
57
57
  warn_for_deprecated_arguments do |keywords|
58
58
  keywords << :group if legacy_group != NOT_GIVEN
@@ -72,7 +72,7 @@ module Faker
72
72
  # @example
73
73
  # Faker::WorldCup.roster(country: 'Spain', type: 'forwards') #=> "Diego Costa"
74
74
  #
75
- # @faker.version next
75
+ # @faker.version 2.13.0
76
76
  def roster(legacy_country = NOT_GIVEN, legacy_type = NOT_GIVEN, country: 'Egypt', type: 'coach')
77
77
  warn_for_deprecated_arguments do |keywords|
78
78
  keywords << :country if legacy_country != NOT_GIVEN
@@ -12,7 +12,7 @@ module Faker
12
12
  # @example
13
13
  # Faker::Games::Control.character #=> "Jesse Faden"
14
14
  #
15
- # @faker.version next
15
+ # @faker.version 2.13.0
16
16
  def character
17
17
  fetch('games.control.character')
18
18
  end
@@ -25,7 +25,7 @@ module Faker
25
25
  # @example
26
26
  # Faker::Games::Control.character #=> "Dimensional Research"
27
27
  #
28
- # @faker.version next
28
+ # @faker.version 2.13.0
29
29
  def location
30
30
  fetch('games.control.location')
31
31
  end
@@ -38,7 +38,7 @@ module Faker
38
38
  # @example
39
39
  # Faker::Games::Control.object_of_power #=> "Hotline"
40
40
  #
41
- # @faker.version next
41
+ # @faker.version 2.13.0
42
42
  def object_of_power
43
43
  fetch('games.control.object_of_power')
44
44
  end
@@ -51,7 +51,7 @@ module Faker
51
51
  # @example
52
52
  # Faker::Games::Control.altered_item #=> "Rubber Duck"
53
53
  #
54
- # @faker.version next
54
+ # @faker.version 2.13.0
55
55
  def altered_item
56
56
  fetch('games.control.altered_item')
57
57
  end
@@ -64,7 +64,7 @@ module Faker
64
64
  # @example
65
65
  # Faker::Games::Control.altered_world_event #=> "Ordinary, Wisconsin"
66
66
  #
67
- # @faker.version next
67
+ # @faker.version 2.13.0
68
68
  def altered_world_event
69
69
  fetch('games.control.altered_world_event')
70
70
  end
@@ -77,7 +77,7 @@ module Faker
77
77
  # @example
78
78
  # Faker::Games::Control.hiss #=> "Push the fingers through the surface into the wet."
79
79
  #
80
- # @faker.version next
80
+ # @faker.version 2.13.0
81
81
  def hiss
82
82
  fetch('games.control.hiss')
83
83
  end
@@ -90,7 +90,7 @@ module Faker
90
90
  # @example
91
91
  # Faker::Games::Control.the_board #=> "< You/We wield the Gun/You. The Board appoints you. Congratulations, Director. >"
92
92
  #
93
- # @faker.version next
93
+ # @faker.version 2.13.0
94
94
  def the_board
95
95
  fetch('games.control.the_board')
96
96
  end
@@ -103,7 +103,7 @@ module Faker
103
103
  # @example
104
104
  # Faker::Games::Control.quote #=> "He never liked fridge duty"
105
105
  #
106
- # @faker.version next
106
+ # @faker.version 2.13.0
107
107
  def quote
108
108
  fetch('games.control.quote')
109
109
  end
@@ -12,7 +12,7 @@ module Faker
12
12
  # @example
13
13
  # Faker::Games::DnD.race #=> "Dwarf"
14
14
  #
15
- # @faker.version next
15
+ # @faker.version 2.13.0
16
16
  def species
17
17
  fetch('dnd.species')
18
18
  end
@@ -25,7 +25,7 @@ module Faker
25
25
  # @example
26
26
  # Faker::Games::DnD.klass #=> "Warlock"
27
27
  #
28
- # @faker.version next
28
+ # @faker.version 2.13.0
29
29
  def klass
30
30
  fetch('dnd.klasses')
31
31
  end
@@ -38,7 +38,7 @@ module Faker
38
38
  # @example
39
39
  # Faker::Games::DnD.background #=> "Urchin"
40
40
  #
41
- # @faker.version next
41
+ # @faker.version 2.13.0
42
42
  def background
43
43
  fetch('dnd.backgrounds')
44
44
  end
@@ -51,7 +51,7 @@ module Faker
51
51
  # @example
52
52
  # Faker::Games::DnD.alignment #=> "Lawful Neutral"
53
53
  #
54
- # @faker.version next
54
+ # @faker.version 2.13.0
55
55
  def alignment
56
56
  fetch('dnd.alignments')
57
57
  end
@@ -18,16 +18,27 @@ module Faker
18
18
  end
19
19
 
20
20
  ##
21
- # Produces a class from Heroes of the Storm.
21
+ # This method is deprecated. The implementation will be removed in a near future release.
22
+ # Use `HeroesOfTheStorm.class_name` instead.
23
+ #
24
+ # @deprecated Use {#class_name} instead.
25
+ def class
26
+ warn '`HeroesOfTheStorm.class` is deprecated. Use `HeroesOfTheStorm.class_name` instead.'
27
+
28
+ super
29
+ end
30
+
31
+ ##
32
+ # Produces a class name from Heroes of the Storm.
22
33
  #
23
34
  # @return [String]
24
35
  #
25
36
  # @example
26
- # Faker::Games::HeroesOfTheStorm.class #=> "Support"
37
+ # Faker::Games::HeroesOfTheStorm.class_name #=> "Support"
27
38
  #
28
- # @faker.version 1.9.2
29
- def class
30
- fetch('heroes_of_the_storm.classes')
39
+ # @faker.version 2.13.0
40
+ def class_name
41
+ fetch('heroes_of_the_storm.class_names')
31
42
  end
32
43
 
33
44
  ##
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Faker
4
+ class Games
5
+ class Minecraft < Base
6
+ class << self
7
+ ##
8
+ # Produces the name of a block from Minecraft.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Games::Minecraft.block #=> "Stone"
14
+ #
15
+ # @faker.version 2.13.0
16
+ def block
17
+ fetch('games.minecraft.blocks')
18
+ end
19
+
20
+ ##
21
+ # Produces the name of an item from Minecraft.
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Games::Minecraft.item #=> "Iron Shovel"
27
+ #
28
+ # @faker.version 2.13.0
29
+ def item
30
+ fetch('games.minecraft.items')
31
+ end
32
+
33
+ ##
34
+ # Produces the name of a mob from Minecraft.
35
+ #
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ # Faker::Games::Minecraft.item #=> "Sheep"
40
+ #
41
+ # @faker.version 2.13.0
42
+ def mob
43
+ fetch('games.minecraft.mobs')
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -12,7 +12,7 @@ module Faker
12
12
  # @example
13
13
  # Faker::Games::WarhammerFantasy.hero #=> "Sigmar Heldenhammer"
14
14
  #
15
- # @faker.version next
15
+ # @faker.version 2.13.0
16
16
  def hero
17
17
  fetch('games.warhammer_fantasy.heros')
18
18
  end
@@ -25,7 +25,7 @@ module Faker
25
25
  # @example
26
26
  # Faker::Games::WarhammerFantasy.quote #=> "The softest part of a castle is the belly of the man inside."
27
27
  #
28
- # @faker.version next
28
+ # @faker.version 2.13.0
29
29
  def quote
30
30
  fetch('games.warhammer_fantasy.quotes')
31
31
  end
@@ -38,7 +38,7 @@ module Faker
38
38
  # @example
39
39
  # Faker::Games::WarhammerFantasy.location #=> "Lustria"
40
40
  #
41
- # @faker.version next
41
+ # @faker.version 2.13.0
42
42
  def location
43
43
  fetch('games.warhammer_fantasy.locations')
44
44
  end
@@ -51,7 +51,7 @@ module Faker
51
51
  # @example
52
52
  # Faker::Games::WarhammerFantasy.faction #=> "Bretonnia"
53
53
  #
54
- # @faker.version next
54
+ # @faker.version 2.13.0
55
55
  def faction
56
56
  fetch('games.warhammer_fantasy.factions')
57
57
  end
@@ -64,7 +64,7 @@ module Faker
64
64
  # @example
65
65
  # Faker::Games::WarhammerFantasy.creature #=> "Hydra"
66
66
  #
67
- # @faker.version next
67
+ # @faker.version 2.13.0
68
68
  def creature
69
69
  fetch('games.warhammer_fantasy.creatures')
70
70
  end
@@ -12,7 +12,7 @@ module Faker
12
12
  # @example
13
13
  # Faker::Movies::Departed.actor #=> "Matt Damon"
14
14
  #
15
- # @faker.version next
15
+ # @faker.version 2.13.0
16
16
  def actor
17
17
  fetch('departed.actors')
18
18
  end
@@ -25,7 +25,7 @@ module Faker
25
25
  # @example
26
26
  # Faker::Movies::Departed.character #=> "Frank Costello"
27
27
  #
28
- # @faker.version next
28
+ # @faker.version 2.13.0
29
29
  def character
30
30
  fetch('departed.characters')
31
31
  end
@@ -39,7 +39,7 @@ module Faker
39
39
  # Faker::Movies::Departed.quote
40
40
  # #=> "I'm the guy who does his job. You must be the other guy"
41
41
  #
42
- # @faker.version next
42
+ # @faker.version 2.13.0
43
43
  def quote
44
44
  fetch('departed.quotes')
45
45
  end
@@ -3,6 +3,19 @@
3
3
  module Faker
4
4
  class Movie < Base
5
5
  class << self
6
+ ##
7
+ # Produces a title from a movie.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::Movie.title #=> "The Lord of the Rings: The Two Towers"
13
+ #
14
+ # @faker.version 2.13.0
15
+ def title
16
+ fetch('movie.title')
17
+ end
18
+
6
19
  ##
7
20
  # Produces a quote from a movie.
8
21
  #
@@ -14,7 +14,7 @@ module Faker
14
14
  # @example
15
15
  # Faker::Music::PearlJam.musician #=> "Eddie Vedder"
16
16
  #
17
- # @faker.version next
17
+ # @faker.version 2.13.0
18
18
  def musician
19
19
  fetch('pearl_jam.musicians')
20
20
  end
@@ -27,7 +27,7 @@ module Faker
27
27
  # @example
28
28
  # Faker::Music::PearlJam.album #=> "Ten"
29
29
  #
30
- # @faker.version next
30
+ # @faker.version 2.13.0
31
31
  def album
32
32
  fetch('pearl_jam.albums')
33
33
  end
@@ -40,7 +40,7 @@ module Faker
40
40
  # @example
41
41
  # Faker::Music::PearlJam.song #=> "Even Flow"
42
42
  #
43
- # @faker.version next
43
+ # @faker.version 2.13.0
44
44
  def song
45
45
  fetch('pearl_jam.songs')
46
46
  end
@@ -12,7 +12,7 @@ module Faker
12
12
  # @example
13
13
  # Faker::Music::Phish.album #=> "Fuego"
14
14
  #
15
- # @faker.version next
15
+ # @faker.version 2.13.0
16
16
  def album
17
17
  fetch('phish.albums')
18
18
  end
@@ -25,7 +25,7 @@ module Faker
25
25
  # @example
26
26
  # Faker::Music::Phish.musician #=> "Trey Anastasio"
27
27
  #
28
- # @faker.version next
28
+ # @faker.version 2.13.0
29
29
  def musician
30
30
  fetch('phish.musicians')
31
31
  end