faker 2.15.1 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/History.md +4 -4
  4. data/README.md +2 -1
  5. data/lib/faker.rb +1 -1
  6. data/lib/faker/blockchain/tezos.rb +28 -0
  7. data/lib/faker/default/app.rb +1 -1
  8. data/lib/faker/default/avatar.rb +1 -1
  9. data/lib/faker/default/barcode.rb +33 -22
  10. data/lib/faker/default/cannabis.rb +10 -0
  11. data/lib/faker/default/chuck_norris.rb +1 -0
  12. data/lib/faker/default/code.rb +2 -2
  13. data/lib/faker/default/company.rb +18 -0
  14. data/lib/faker/default/driving_licence.rb +3 -2
  15. data/lib/faker/default/file.rb +6 -4
  16. data/lib/faker/default/hipster.rb +6 -6
  17. data/lib/faker/default/internet.rb +227 -2
  18. data/lib/faker/default/json.rb +3 -2
  19. data/lib/faker/default/lorem.rb +158 -3
  20. data/lib/faker/default/lorem_flickr.rb +3 -8
  21. data/lib/faker/default/lorem_pixel.rb +2 -1
  22. data/lib/faker/default/markdown.rb +4 -2
  23. data/lib/faker/default/omniauth.rb +3 -10
  24. data/lib/faker/default/placeholdit.rb +3 -2
  25. data/lib/faker/default/string.rb +3 -2
  26. data/lib/faker/games/touhou.rb +75 -0
  27. data/lib/faker/movies/star_wars.rb +72 -0
  28. data/lib/faker/music/rock_band.rb +12 -0
  29. data/lib/faker/quotes/rajnikanth.rb +1 -0
  30. data/lib/faker/quotes/shakespeare.rb +34 -0
  31. data/lib/faker/tv_shows/big_bang_theory.rb +1 -1
  32. data/lib/faker/tv_shows/suits.rb +1 -1
  33. data/lib/faker/version.rb +1 -1
  34. data/lib/locales/en/football.yml +3 -3
  35. data/lib/locales/en/lebowski.yml +1 -1
  36. data/lib/locales/en/rock_band.yml +1 -0
  37. data/lib/locales/en/super_smash_bros.yml +2 -0
  38. data/lib/locales/en/touhou.yml +839 -0
  39. data/lib/locales/fr.yml +4 -4
  40. data/lib/locales/ja.yml +5 -0
  41. metadata +10 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c64eb124941da11f6f02bdf234dcf3fe2b83568e1b951e97d198b458495a4956
4
- data.tar.gz: 2d589426b8f0d7f7845f3e7f0f104ee0258a37a312e7400cf8a0fd3fabd2475b
3
+ metadata.gz: 18002d6c86949152fab3522919844331fc549e8593f46616c165a346cb210abd
4
+ data.tar.gz: db62f2c9507addb919ee639d6f204ca15b604d30d87beeb86cc18a6299bce381
5
5
  SHA512:
6
- metadata.gz: fd8f47c75906cc93e8d45db108478fea154409e86aef1b7d33c4b25c3266c540d91b174ae4cb4e17359fc6ab148cd9751d03db574d94e8726ed0d52f611c9031
7
- data.tar.gz: 4dccd79f0c6b1ed2b9fcd1c765b0276500b03f951b096d81e563cf5dddd0a28f0910c902e3de69233d17042011f41b2372957ccb80a89bf347d7567575129f63
6
+ metadata.gz: 8c9fd6bc54ace68f40dfd9b30618077086389a9447de27fb0ffb062715c9a531da95875ea0c50a9b5d02a7dd4105e80b58bd633aeb98da5cdeec132aba5ccc96
7
+ data.tar.gz: 54016385c84f11b1bb7075d60c9063ca7f02659c7ea13c5cb31b315ece710c9761317a1208b100954426f41ff1d9c133427b52e6728c44ea517e5f6f2a624b40
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.16.0](https://github.com/faker-ruby/faker/tree/v2.16.0) (2020-02-09)
4
+
5
+ ## Chores
6
+
7
+ - [PR #2262](https://github.com/faker-ruby/faker/pull/2262) Workaround build error for ruby-head [@koic](https://github.com/koic)
8
+ - [PR #2257](https://github.com/faker-ruby/faker/pull/2257) Trim trailing white space throughout the project [@koic](https://github.com/koic)
9
+ - [PR #2229](https://github.com/faker-ruby/faker/pull/2229) Use Random.new instead of `Random::DEFAULT` [@connorshea](https://github.com/connorshea)
10
+ - [PR #2226](https://github.com/faker-ruby/faker/pull/2226) Add Ruby 3.0 to CI matrix [@connorshea](https://github.com/connorshea)
11
+
12
+ ## Documentation
13
+
14
+ - [PR #2247](https://github.com/faker-ruby/faker/pull/2247) 2243 yard doc [@sudeeptarlekar](https://github.com/sudeeptarlekar)
15
+ - [PR #2240](https://github.com/faker-ruby/faker/pull/2240) Updated `rock_band.md` to include example for using song generator [@jsca-kwok](https://github.com/jsca-kwok)
16
+ - [PR #2205](https://github.com/faker-ruby/faker/pull/2205) `Faker::Mountain` doc [@bipashant](https://github.com/bipashant)
17
+
18
+ ## Feature Request
19
+
20
+ - [PR #2221](https://github.com/faker-ruby/faker/pull/2221) Added rock band song generator [@jsca-kwok](https://github.com/jsca-kwok)
21
+ - [PR #2208](https://github.com/faker-ruby/faker/pull/2208) Feat/add blockchain Tezos keys [@akettal](https://github.com/akettal) [@Pierre-Michard](https://github.com/Pierre-Michard)
22
+ - [PR #2197](https://github.com/faker-ruby/faker/pull/2197) Add `Faker::Games::Touhou` [@dysnomian](https://github.com/dysnomian)
23
+
24
+ ## Update locales
25
+
26
+ - [PR #2238](https://github.com/faker-ruby/faker/pull/2238) added some data in `fr.yml` and `football.yml` [@MathGL92](https://github.com/MathGL92)
27
+ - [PR #2222](https://github.com/faker-ruby/faker/pull/2222) Add Japanese for `Faker::Book` [@zoshigayan](https://github.com/zoshigayan)
28
+ - [PR #2217](https://github.com/faker-ruby/faker/pull/2217) Add Sephiroth and Northern Cave to `Faker::Games::SuperSmashBros` [@boardfish](https://github.com/boardfish)
29
+ - [PR #2201](https://github.com/faker-ruby/faker/pull/2201) Typo in Lebowski Quote [@rgraff](https://github.com/rgraff)
30
+ - [PR #2197](https://github.com/faker-ruby/faker/pull/2197) Add `Faker::Games::Touhou` [@dysnomian](https://github.com/dysnomian)
31
+
32
+ ------------------------------------------------------------------------------
33
+
3
34
  ## [v2.15.1](https://github.com/faker-ruby/faker/tree/v2.15.1) (2020-11-24)
4
35
 
5
36
  - Rollback PR #2169 and bump 2.15.1 [#2203](https://github.com/faker-ruby/faker/pull/2203) @vbrazo
data/History.md CHANGED
@@ -33,7 +33,7 @@
33
33
  ## v1.6.0 (2015-11-23)
34
34
  * Lots of bug fixes -- most notably, a fix for email addresses and domains in non-en locales
35
35
  * Updated locales: de, en-AU, en-NZ, en-SG, en-US, en-au-ocker, en, es, fr, he, it, ja, nb-NO, pl, pt-BR, sk, and zh-CN
36
- * Updated classes: Address, Avatar, Book, Code, Commerce, Company, Hipster, IDNumber, Internet, Number, Placeholdit, Shakespeare, and Time
36
+ * Updated classes: Address, Avatar, Book, Code, Commerce, Company, Hipster, IDNumber, Internet, Number, Placeholdit, Shakespeare, and Time
37
37
 
38
38
  ## v1.5.0 (2015-08-17)
39
39
  * Added logos
@@ -83,7 +83,7 @@
83
83
  * 1 major change:
84
84
  * Removed deprecated methods from Address: earth_country, us_state, us_state_abbr, uk_postcode, uk_county
85
85
  * Many minor changes (please see github pull requests for credits)
86
- * Added many localizations
86
+ * Added many localizations
87
87
  * Added range and array support for Lorem
88
88
 
89
89
  ## v1.0.1 (2011-09-27)
@@ -117,7 +117,7 @@
117
117
  * Added Canadian translation [igbanam]
118
118
  * Added Norwegian translation [kytrinyx]
119
119
  * Lots of translation-related cleanup [kytrinyx]
120
-
120
+
121
121
 
122
122
  ## v0.9.5 (2011-01-27)
123
123
  * 1 minor bug fix:
@@ -159,7 +159,7 @@
159
159
  * 3 major enhancements:
160
160
  * Added Lorem to generate fake Latin
161
161
  * Added secondary_address to Address, and made inclusion of
162
- secondary address in street_address optional (false by
162
+ secondary address in street_address optional (false by
163
163
  default).
164
164
  * Added UK address methods [Caius Durling]
165
165
 
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  ![logotype a happy-07](https://user-images.githubusercontent.com/36028424/40263395-4318481e-5b44-11e8-92e5-3dcc1ce169b3.png)
3
2
 
4
3
  # Faker
@@ -186,6 +185,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
186
185
  - [Faker::Marketing](doc/default/marketing.md)
187
186
  - [Faker::Measurement](doc/default/measurement.md)
188
187
  - [Faker::Military](doc/default/military.md)
188
+ - [Faker::Mountain](doc/default/mountain.md)
189
189
  - [Faker::Name](doc/default/name.md)
190
190
  - [Faker::Nation](doc/default/nation.md)
191
191
  - [Faker::NatoPhoneticAlphabet](doc/default/nato_phonetic_alphabet.md)
@@ -252,6 +252,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
252
252
  - [Faker::Games::StreetFighter](doc/games/street_fighter.md)
253
253
  - [Faker::Games::SuperMario](doc/games/super_mario.md)
254
254
  - [Faker::Games::SuperSmashBros](doc/games/super_smash_bros.md)
255
+ - [Faker::Games::Touhou](doc/games/touhou.md)
255
256
  - [Faker::Games::WarhammerFantasy](doc/games/warhammer_fantasy.md)
256
257
  - [Faker::Games::Witcher](doc/games/witcher.md)
257
258
  - [Faker::Games::WorldOfWarcraft](doc/games/world_of_warcraft.md)
data/lib/faker.rb CHANGED
@@ -29,7 +29,7 @@ module Faker
29
29
  end
30
30
 
31
31
  def random
32
- @random || Random::DEFAULT
32
+ @random || Random.new
33
33
  end
34
34
  end
35
35
  end
@@ -88,6 +88,34 @@ module Faker
88
88
  encode_tz(:edsig, 64)
89
89
  end
90
90
 
91
+ ##
92
+ # Produces a random Tezos public key
93
+ #
94
+ # @return [String]
95
+ #
96
+ # @example
97
+ # Faker::Blockchain::Tezos.public_key
98
+ # #=> "edpkuib9x8QXRc5nWwHUg7U1dXsVmaUrUNU5sX9pVEEvwbMVdfMCeq"
99
+ #
100
+ # @faker.version 2.15.2
101
+ def public_key
102
+ encode_tz(:edpk, 32)
103
+ end
104
+
105
+ ##
106
+ # Produces a random Tezos public key
107
+ #
108
+ # @return [String]
109
+ #
110
+ # @example
111
+ # Faker::Blockchain::Tezos.secret_key
112
+ # #=> "edsk3HZCAGEGpzQPnQUwQeFY4ESanFhQCgLpKriQw8GHyhKCrjHawv"
113
+ #
114
+ # @faker.version 2.15.2
115
+ def secret_key
116
+ encode_tz(:edsk, 32)
117
+ end
118
+
91
119
  protected
92
120
 
93
121
  ##
@@ -63,7 +63,6 @@ module Faker
63
63
  #
64
64
  # @faker.version 1.4.3
65
65
  def semantic_version(legacy_major = NOT_GIVEN, legacy_minor = NOT_GIVEN, legacy_patch = NOT_GIVEN, major: 0..9, minor: 0..9, patch: 1..9)
66
- # rubocop:enable Metrics/ParameterLists
67
66
  warn_for_deprecated_arguments do |keywords|
68
67
  keywords << :major if legacy_major != NOT_GIVEN
69
68
  keywords << :minor if legacy_minor != NOT_GIVEN
@@ -72,6 +71,7 @@ module Faker
72
71
 
73
72
  [major, minor, patch].map { |chunk| sample(Array(chunk)) }.join('.')
74
73
  end
74
+ # rubocop:enable Metrics/ParameterLists
75
75
  end
76
76
  end
77
77
  end
@@ -39,7 +39,6 @@ module Faker
39
39
  #
40
40
  # @faker.version 1.4.3
41
41
  def image(legacy_slug = NOT_GIVEN, legacy_size = NOT_GIVEN, legacy_format = NOT_GIVEN, legacy_set = NOT_GIVEN, legacy_bgset = NOT_GIVEN, slug: nil, size: '300x300', format: 'png', set: 'set1', bgset: nil)
42
- # rubocop:enable Metrics/ParameterLists
43
42
  warn_for_deprecated_arguments do |keywords|
44
43
  keywords << :slug if legacy_slug != NOT_GIVEN
45
44
  keywords << :size if legacy_size != NOT_GIVEN
@@ -55,6 +54,7 @@ module Faker
55
54
  bgset_query = "&bgset=#{bgset}" if bgset
56
55
  "https://robohash.org/#{slug}.#{format}?size=#{size}&set=#{set}#{bgset_query}"
57
56
  end
57
+ # rubocop:enable Metrics/ParameterLists
58
58
  end
59
59
  end
60
60
  end
@@ -3,8 +3,9 @@
3
3
  module Faker
4
4
  class Barcode < Base
5
5
  class << self
6
- ## Returns a EAN 8 or 13 digit format barcode number with check digit
7
- # @returns [String]
6
+ ##
7
+ # Returns a EAN 8 or 13 digit format barcode number with check digit
8
+ # @return [String]
8
9
  #
9
10
  # @example
10
11
  # Faker::Barcode.ean => "85657526"
@@ -16,8 +17,9 @@ module Faker
16
17
  generate_barcode("barcode.ean_#{Integer(length)}")
17
18
  end
18
19
 
19
- ## Returns a EAN 8 or 13 digit format barcode number with composite string attached with check digit
20
- # @returns [String]
20
+ ##
21
+ # Returns a EAN 8 or 13 digit format barcode number with composite string attached with check digit
22
+ # @return [String]
21
23
  #
22
24
  # @example
23
25
  # Faker::Barcode.ean_with_composite_sumbology => "41007624|JHOC6649"
@@ -29,8 +31,9 @@ module Faker
29
31
  "#{ean(length)}|#{bothify(parse('barcode.composite_symbol'))}"
30
32
  end
31
33
 
32
- ## Returns a UPC_A format barcode number with check digit
33
- # @returns [String]
34
+ ##
35
+ # Returns a UPC_A format barcode number with check digit
36
+ # @return [String]
34
37
  #
35
38
  # @example
36
39
  # Faker::Barcode.upc_a => "766807541831"
@@ -40,8 +43,9 @@ module Faker
40
43
  generate_barcode('barcode.upc_a')
41
44
  end
42
45
 
43
- ## Returns a UPC_E format barcode number with check digit
44
- # @returns [String]
46
+ ##
47
+ # Returns a UPC_E format barcode number with check digit
48
+ # @return [String]
45
49
  #
46
50
  # @example
47
51
  # Faker::Barcode.upc_e => "03746820"
@@ -51,8 +55,9 @@ module Faker
51
55
  generate_barcode('barcode.upc_e')
52
56
  end
53
57
 
54
- ## Returns a UPC_A format barcode number with composite string attached with check digit
55
- # @returns [String]
58
+ ##
59
+ # Returns a UPC_A format barcode number with composite string attached with check digit
60
+ # @return [String]
56
61
  #
57
62
  # @example
58
63
  # Faker::Barcode.upc_a_with_composite_symbology => "790670155765|JOVG6208"
@@ -62,8 +67,9 @@ module Faker
62
67
  "#{upc_a}|#{bothify(parse('barcode.composite_symbol'))}"
63
68
  end
64
69
 
65
- ## Returns a UPC_E format barcode number with composite string attached with check digit
66
- # @returns [String]
70
+ ##
71
+ # Returns a UPC_E format barcode number with composite string attached with check digit
72
+ # @return [String]
67
73
  #
68
74
  # @example
69
75
  # Faker::Barcode.upc_e_with_composite_symbology => "05149247|BKZX9722"
@@ -73,8 +79,9 @@ module Faker
73
79
  "#{upc_e}|#{bothify(parse('barcode.composite_symbol'))}"
74
80
  end
75
81
 
76
- ## Returns a ISBN format barcode number with check digit
77
- # @returns [String]
82
+ ##
83
+ # Returns a ISBN format barcode number with check digit
84
+ # @return [String]
78
85
  #
79
86
  # @example
80
87
  # Faker::Barcode.isbn => "9798363807732"
@@ -84,8 +91,9 @@ module Faker
84
91
  generate_barcode('barcode.isbn')
85
92
  end
86
93
 
87
- ## Returns a ISMN format barcode number with check digit
88
- # @returns [String]
94
+ ##
95
+ # Returns a ISMN format barcode number with check digit
96
+ # @return [String]
89
97
  #
90
98
  # @example
91
99
  # Faker::Barcode.ismn => "9790527672897"
@@ -95,8 +103,9 @@ module Faker
95
103
  generate_barcode('barcode.ismn')
96
104
  end
97
105
 
98
- ## Returns a ISSN format barcode number with check digit
99
- # @returns [String]
106
+ ##
107
+ # Returns a ISSN format barcode number with check digit
108
+ # @return [String]
100
109
  #
101
110
  # @example
102
111
  # Faker::Barcode.issn => "9775541703338"
@@ -114,9 +123,10 @@ module Faker
114
123
  "#{barcode}#{check_digit}"
115
124
  end
116
125
 
117
- ## Returns the sum of even and odd numbers from value passed
126
+ ##
127
+ # Returns the sum of even and odd numbers from value passed
118
128
  #
119
- # @returns [Array]
129
+ # @return [Array]
120
130
  #
121
131
  # @example
122
132
  # Faker::Barcode.send(:sum_even_odd, 12345) => [9, 5]
@@ -137,9 +147,10 @@ module Faker
137
147
  [sum_odd, sum_even]
138
148
  end
139
149
 
140
- ## Generates the check digits from sum passed
150
+ ##
151
+ # Generates the check digits from sum passed
141
152
  #
142
- # @returns [Integer]
153
+ # @return [Integer]
143
154
  #
144
155
  # @example
145
156
  # Faker::Barcode.send(:generate_check_digit, 12, 4) => 0
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Faker
4
4
  class Cannabis < Base
5
+ ##
5
6
  # Produces a random strain.
6
7
  #
7
8
  # @return [String]
@@ -14,6 +15,7 @@ module Faker
14
15
  fetch('cannabis.strains')
15
16
  end
16
17
 
18
+ ##
17
19
  # Produces a random abbreviation.
18
20
  #
19
21
  # @return [String]
@@ -26,6 +28,7 @@ module Faker
26
28
  fetch('cannabis.cannabinoid_abbreviations')
27
29
  end
28
30
 
31
+ ##
29
32
  # Produces a random cannabinoid type.
30
33
  #
31
34
  # @return [String]
@@ -38,6 +41,7 @@ module Faker
38
41
  fetch('cannabis.cannabinoids')
39
42
  end
40
43
 
44
+ ##
41
45
  # Produces a random terpene type.
42
46
  #
43
47
  # @return [String]
@@ -50,6 +54,7 @@ module Faker
50
54
  fetch('cannabis.terpenes')
51
55
  end
52
56
 
57
+ ##
53
58
  # Produces a random kind of medical use.
54
59
  #
55
60
  # @return [String]
@@ -62,6 +67,7 @@ module Faker
62
67
  fetch('cannabis.medical_uses')
63
68
  end
64
69
 
70
+ ##
65
71
  # Produces a random health benefit.
66
72
  #
67
73
  # @return [String]
@@ -74,6 +80,7 @@ module Faker
74
80
  fetch('cannabis.health_benefits')
75
81
  end
76
82
 
83
+ ##
77
84
  # Produces a random category.
78
85
  #
79
86
  # @return [String]
@@ -86,6 +93,7 @@ module Faker
86
93
  fetch('cannabis.categories')
87
94
  end
88
95
 
96
+ ##
89
97
  # Produces a random type.
90
98
  #
91
99
  # @return [String]
@@ -98,6 +106,7 @@ module Faker
98
106
  fetch('cannabis.types')
99
107
  end
100
108
 
109
+ ##
101
110
  # Produces a random buzzword.
102
111
  #
103
112
  # @return [String]
@@ -110,6 +119,7 @@ module Faker
110
119
  fetch('cannabis.buzzwords')
111
120
  end
112
121
 
122
+ ##
113
123
  # Produces a random brand.
114
124
  #
115
125
  # @return [String]
@@ -5,6 +5,7 @@ module Faker
5
5
  flexible :chuck_norris
6
6
 
7
7
  class << self
8
+ ##
8
9
  # Produces a Chuck Norris Fact.
9
10
  # Original list of facts:
10
11
  # https://github.com/jenkinsci/chucknorris-plugin/blob/master/src/main/java/hudson/plugins/chucknorris/FactGenerator.java
@@ -80,11 +80,11 @@ module Faker
80
80
  value << "-#{vd}"
81
81
  end
82
82
 
83
+ ##
84
+ # Produces a random NRIC (National Registry Identity Card) code.
83
85
  # By default generates a Singaporean NRIC ID for someone
84
86
  # who is born between the age of 18 and 65.
85
87
  #
86
- # Produces a random NRIC (National Registry Identity Card) code.
87
- #
88
88
  # @param min_age [Integer] the min age of the person in years
89
89
  # @param max_age [Integer] the max age of the person in years
90
90
  # @return [String]
@@ -404,7 +404,18 @@ module Faker
404
404
  formatted ? format('%s.%s.%s/%s-%s', *number.scan(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/).flatten) : number
405
405
  end
406
406
 
407
+ ##
407
408
  # Get a random Russian tax number.
409
+ # @param region [String] Any region string
410
+ # @param type [Symbol] Legeal or not, defaults to :legal
411
+ #
412
+ # @return [String]
413
+ # @example
414
+ # Faker::Company.russian_tax_number #=> "0415584064"
415
+ # Faker::Company.russian_tax_number(region: 'AZ') #=> "AZ50124562"
416
+ # Faker::Company.russian_tax_number(region: 'AZ', type: false) #=> "AZ8802315465"
417
+ #
418
+ # @faker.version 1.9.4
408
419
  def russian_tax_number(region: nil, type: :legal)
409
420
  inn_number(region, type)
410
421
  end
@@ -507,7 +518,14 @@ module Faker
507
518
  #
508
519
  # Range of regions:
509
520
  # https://ru.wikipedia.org/wiki/Коды_субъектов_Российской_Федерации
521
+ # region [String] Any region string
522
+ # @param type [Symbol] Legeal or not, defaults to :legal
510
523
  #
524
+ # @return [String]
525
+ # @example
526
+ # Faker::Comnpany.russian_tax_number
527
+ # Faker::Comnpany.russian_tax_number(region: 'AZ')
528
+ # Faker::Comnpany.russian_tax_number(region: 'AZ', type: false)
511
529
  # rubocop:enable Style/AsciiComments
512
530
  def inn_number(region, type)
513
531
  n10 = [2, 4, 10, 3, 5, 9, 4, 6, 8]