faker 2.3.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +158 -2
  3. data/README.md +5 -1
  4. data/lib/faker/blockchain/aeternity.rb +70 -0
  5. data/lib/faker/default/app.rb +2 -1
  6. data/lib/faker/default/appliance.rb +18 -0
  7. data/lib/faker/default/avatar.rb +2 -1
  8. data/lib/faker/default/bank.rb +13 -7
  9. data/lib/faker/default/chuck_norris.rb +1 -1
  10. data/lib/faker/default/coffee.rb +45 -0
  11. data/lib/faker/default/coin.rb +18 -0
  12. data/lib/faker/default/date.rb +83 -2
  13. data/lib/faker/default/dessert.rb +27 -0
  14. data/lib/faker/default/device.rb +54 -0
  15. data/lib/faker/default/driving_licence.rb +2 -2
  16. data/lib/faker/default/electrical_components.rb +27 -0
  17. data/lib/faker/default/greek_philosophers.rb +18 -0
  18. data/lib/faker/default/id_number.rb +29 -0
  19. data/lib/faker/default/industry_segments.rb +36 -0
  20. data/lib/faker/default/internet.rb +11 -7
  21. data/lib/faker/default/marketing.rb +9 -0
  22. data/lib/faker/default/military.rb +45 -0
  23. data/lib/faker/default/nation.rb +48 -5
  24. data/lib/faker/default/nato_phonetic_alphabet.rb +9 -0
  25. data/lib/faker/default/number.rb +124 -0
  26. data/lib/faker/default/relationship.rb +45 -0
  27. data/lib/faker/default/restaurant.rb +54 -2
  28. data/lib/faker/default/science.rb +27 -0
  29. data/lib/faker/default/subscription.rb +45 -0
  30. data/lib/faker/default/superhero.rb +45 -0
  31. data/lib/faker/default/time.rb +85 -8
  32. data/lib/faker/default/world_cup.rb +50 -0
  33. data/lib/faker/games/dota.rb +47 -0
  34. data/lib/faker/games/heroes.rb +27 -0
  35. data/lib/faker/games/heroes_of_the_storm.rb +36 -0
  36. data/lib/faker/games/league_of_legends.rb +54 -0
  37. data/lib/faker/games/myst.rb +45 -0
  38. data/lib/faker/games/pokemon.rb +27 -0
  39. data/lib/faker/games/sonic_the_hedgehog.rb +27 -0
  40. data/lib/faker/games/witcher.rb +54 -0
  41. data/lib/faker/games/world_of_warcraft.rb +18 -0
  42. data/lib/faker/games/zelda.rb +1 -1
  43. data/lib/faker/japanese_media/dragon_ball.rb +9 -0
  44. data/lib/faker/japanese_media/one_piece.rb +54 -0
  45. data/lib/faker/japanese_media/sword_art_online.rb +36 -0
  46. data/lib/faker/movies/back_to_the_future.rb +28 -0
  47. data/lib/faker/movies/ghostbusters.rb +28 -0
  48. data/lib/faker/movies/harry_potter.rb +54 -0
  49. data/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb +69 -0
  50. data/lib/faker/movies/hobbit.rb +37 -0
  51. data/lib/faker/movies/lebowski.rb +27 -0
  52. data/lib/faker/movies/lord_of_the_rings.rb +28 -0
  53. data/lib/faker/movies/movie.rb +9 -0
  54. data/lib/faker/movies/princess_bride.rb +19 -0
  55. data/lib/faker/movies/star_wars.rb +94 -0
  56. data/lib/faker/movies/v_for_vendetta.rb +29 -0
  57. data/lib/faker/music/grateful_dead.rb +18 -0
  58. data/lib/faker/music/phish.rb +9 -0
  59. data/lib/faker/music/rock_band.rb +9 -0
  60. data/lib/faker/music/umphreys_mcgee.rb +9 -0
  61. data/lib/faker/sports/basketball.rb +36 -0
  62. data/lib/faker/sports/football.rb +45 -0
  63. data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +9 -0
  64. data/lib/faker/tv_shows/bojack_horseman.rb +28 -0
  65. data/lib/faker/tv_shows/buffy.rb +45 -0
  66. data/lib/faker/tv_shows/community.rb +19 -0
  67. data/lib/faker/tv_shows/dr_who.rb +78 -2
  68. data/lib/faker/tv_shows/dumb_and_dumber.rb +28 -0
  69. data/lib/faker/tv_shows/family_guy.rb +28 -0
  70. data/lib/faker/tv_shows/friends.rb +27 -0
  71. data/lib/faker/tv_shows/game_of_thrones.rb +46 -0
  72. data/lib/faker/tv_shows/hey_arnold.rb +27 -0
  73. data/lib/faker/tv_shows/how_i_met_your_mother.rb +37 -0
  74. data/lib/faker/tv_shows/michael_scott.rb +13 -0
  75. data/lib/faker/tv_shows/new_girl.rb +19 -0
  76. data/lib/faker/tv_shows/parks_and_rec.rb +18 -0
  77. data/lib/faker/tv_shows/rick_and_morty.rb +28 -0
  78. data/lib/faker/tv_shows/ru_paul.rb +18 -0
  79. data/lib/faker/tv_shows/seinfeld.rb +28 -0
  80. data/lib/faker/tv_shows/silicon_valley.rb +75 -0
  81. data/lib/faker/tv_shows/simpsons.rb +28 -0
  82. data/lib/faker/tv_shows/south_park.rb +19 -0
  83. data/lib/faker/tv_shows/star_trek.rb +36 -0
  84. data/lib/faker/tv_shows/stargate.rb +28 -0
  85. data/lib/faker/tv_shows/stranger_things.rb +19 -0
  86. data/lib/faker/tv_shows/the_expanse.rb +36 -0
  87. data/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +28 -0
  88. data/lib/faker/tv_shows/the_it_crowd.rb +37 -0
  89. data/lib/faker/tv_shows/the_thick_of_it.rb +28 -0
  90. data/lib/faker/tv_shows/twin_peaks.rb +28 -0
  91. data/lib/faker/tv_shows/venture_bros.rb +38 -0
  92. data/lib/faker/version.rb +1 -1
  93. data/lib/locales/en-CA.yml +1 -0
  94. data/lib/locales/en-TH.yml +360 -0
  95. data/lib/locales/en/color.yml +1 -1
  96. data/lib/locales/en/dr_who.yml +1 -1
  97. data/lib/locales/en/overwatch.yml +2617 -32
  98. data/lib/locales/en/science.yml +1 -1
  99. data/lib/locales/en/super_smash_bros.yml +1 -0
  100. data/lib/locales/fr-CA.yml +1 -1
  101. data/lib/locales/ja.yml +13 -10
  102. data/lib/locales/th.yml +380 -0
  103. metadata +26 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bec55e97c49aba2834c60f979ddfbbba32d561b6300640059e10b74f4f64a11
4
- data.tar.gz: 60197e5cfab12ef29607bfb817a86fb14db6757d3868afbc5dd2a2751412e070
3
+ metadata.gz: 29798f78b1587b989eb395b41be5d0851b1e8ce2ee6488d1a4291dcaca7e8713
4
+ data.tar.gz: 67694fb9ec2495bd11a85278962b5941326e24891fce2f9f9fb5a9baa4efa424
5
5
  SHA512:
6
- metadata.gz: 6163f75344392f843e01d14ff8ddb484c40ad7b8b055a1e7a3be1cfebb972b5e5244ac4f61b424862d997bee39c4d3b61d1b605aebad6f6534e771acb32ca380
7
- data.tar.gz: 93310c967dc3daa9a664d456978a636b7bc01122fbbe4a1c565206db401bfcdadee214d01c0e4b2b22be4c001cdf255de5f46762df2cb16d9f4e5fcb2c006418
6
+ metadata.gz: 2e968a3d663d459014b85287e0e2867cbcd8198acf82efe1e342af18990aadf090ba60c3771af8d79587a2ee95e16638922993f061f1f8437e45464f5bfd7a60
7
+ data.tar.gz: 2a66801d474d23dfae78a6fb4c0b74b3a59f2af066b679d31ef6ad9862037151c85a429beda138d771d76d5ae3e7aa111b27ccd85e0a0fb4984c7b304fe8fe22
@@ -1,5 +1,161 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.8.0](https://github.com/faker-ruby/faker/tree/v2.8.0) (2019-12-01)
4
+
5
+ ## Bugfixes
6
+
7
+ - [PR #1563](https://github.com/faker-ruby/faker/pull/1563)
8
+ Fix generating routing number [@psienko](https://github.com/psienko)
9
+
10
+ ## Chores
11
+
12
+ - [PR #1835](https://github.com/faker-ruby/faker/pull/1835)
13
+ Remove duplicate method description [@pacso](https://github.com/pacso)
14
+
15
+ ## Documentation
16
+
17
+ - [PR #1837](https://github.com/faker-ruby/faker/pull/1837)
18
+ docs: Internet #email, #domain do not control TLD [@olleolleolle](https://github.com/olleolleolle)
19
+ - [PR #1833](https://github.com/faker-ruby/faker/pull/1833) Explain safe_email method [@swrobel](https://github.com/swrobel)
20
+ - [PR #1810](https://github.com/faker-ruby/faker/pull/1810) Add yard docs for Faker::Coffee methods [@LuanGB](https://github.com/LuanGB)
21
+ - [PR #1803](https://github.com/faker-ruby/faker/pull/1803)
22
+ add YARD doc for Faker::Coin [@sap1enza](https://github.com/sap1enza) [@connorshea](https://github.com/connorshea)
23
+ - [PR #1799](https://github.com/faker-ruby/faker/pull/1799) Remove 'See below examples' for consistency [@DevUsmanGhani](https://github.com/DevUsmanGhani)
24
+ - [PR #1793](https://github.com/faker-ruby/faker/pull/1793) add Faker::Relationship YARD docs [@DevUsmanGhani](https://github.com/DevUsmanGhani)
25
+
26
+ ## Feature Request
27
+
28
+ - [PR #1808](https://github.com/faker-ruby/faker/pull/1808) Adds domain option for Internet email and domain_name methods [@tiagofsilva](https://github.com/tiagofsilva)
29
+
30
+ ## Update locales
31
+
32
+ - [PR #1841](https://github.com/faker-ruby/faker/pull/1841)
33
+ Fix strange result from `Lorem.word` in ja locale [@yujideveloper](https://github.com/yujideveloper)
34
+ - [PR #1839](https://github.com/faker-ruby/faker/pull/1839)
35
+ added new heroes, new maps and almost all of the quotes [@TCsTheMechanic](https://github.com/TCsTheMechanic)
36
+
37
+ ## Update local dependencies
38
+
39
+ - [PR #1831](https://github.com/faker-ruby/faker/pull/1831) Update rake requirement from = 13.0.0 to = 13.0.1 [@DevUsmanGhani](https://github.com/DevUsmanGhani)
40
+
41
+ ------------------------------------------------------------------------------
42
+
43
+ ## [v2.7.0](https://github.com/faker-ruby/faker/tree/v2.7.0) (2019-11-01)
44
+
45
+ This version:
46
+ - adds `Faker::IDNumber.chilean_id`
47
+ - updates some translations/locales
48
+ - updates local dependencies
49
+ - adds SemVer badge
50
+
51
+ ## Documentation
52
+
53
+ - [PR #1814](https://github.com/faker-ruby/faker/pull/1814) Add Discord link [@vbrazo](https://github.com/vbrazo)
54
+ - [PR #1289](https://github.com/faker-ruby/faker/pull/1289) Add SemVer compatibility badge to README [@greysteil](https://github.com/greysteil)
55
+
56
+ ## Feature Request
57
+
58
+ - [PR #1819](https://github.com/faker-ruby/faker/pull/1819) Adding chilean_id in Faker::IDNumber [@cristofer](https://github.com/cristofer)
59
+
60
+ ## Update locales
61
+
62
+ - [PR #1824](https://github.com/faker-ruby/faker/pull/1824) Added Canadian Country Code [@clinch](https://github.com/clinch)
63
+ - [PR #1817](https://github.com/faker-ruby/faker/pull/1817) Add Japanese animal names [@shouichi](https://github.com/shouichi)
64
+ - [PR #1816](https://github.com/faker-ruby/faker/pull/1816) Add Japanese bank names [@shouichi](https://github.com/shouichi)
65
+ - [PR #1813](https://github.com/faker-ruby/faker/pull/1813) Translate Canadian provinces for fr-CA [@Bhacaz](https://github.com/Bhacaz)
66
+ - [PR #1806](https://github.com/faker-ruby/faker/pull/1806) Add Terry Bogard to Super Smash Bros. options [@clinch](https://github.com/clinch)
67
+
68
+ ## Update local dependencies
69
+
70
+ - Update rubocop requirement from = 0.75.0 to = 0.75.1 (#1811)
71
+ - Update rubocop requirement from = 0.75.1 to = 0.76.0 (#1822)
72
+ - Update minitest requirement from = 5.12.2 to = 5.13.0 (#1823)
73
+
74
+ ------------------------------------------------------------------------------
75
+
76
+ ## [v2.6.0](https://github.com/faker-ruby/faker/tree/v2.6.0) (2019-10-10)
77
+
78
+ This version:
79
+ - adds `Faker::Date.in_date_period`
80
+ - adds `Faker::WorldCup` YARD docs
81
+ - updates local dependencies
82
+
83
+ ## Documentation
84
+
85
+ - [PR #1789](https://github.com/faker-ruby/faker/pull/1789) Faker::WorldCup YARD docs [@ashishra0](https://github.com/ashishra0)
86
+
87
+ ## Feature Request
88
+
89
+ - [PR #1755](https://github.com/faker-ruby/faker/pull/1755) Add Faker::Date.in_date_period [@AmrAdelKhalil](https://github.com/AmrAdelKhalil)
90
+
91
+ ## Update local dependencies
92
+
93
+ The following development dependencies were updated:
94
+ - Update rake requirement from = 12.3.3 to = 13.0.0 (#1776)
95
+ - Update minitest requirement from = 5.12.0 to = 5.12.2 (#1775)
96
+ - Update test-unit requirement from = 3.3.3 to = 3.3.4 (#1774)
97
+
98
+ ------------------------------------------------------------------------------
99
+
100
+ ## [v2.5.0](https://github.com/faker-ruby/faker/tree/v2.5.0) (2019-30-09)
101
+
102
+ This version introduces:
103
+ - locales for Thai language - the mother language in Thailand
104
+ - YARD documentation for faker interfaces
105
+ - locales updates or fixes
106
+
107
+ ## Feature Request
108
+
109
+ - [PR #1773](https://github.com/faker-ruby/faker/pull/1773) Two new locales added: th and en-th [@kodram](https://github.com/kodram)
110
+
111
+ ## Documentation
112
+
113
+ - [PR #1771](https://github.com/faker-ruby/faker/pull/1771) Fix some rubocop comments that were showing up in YARD docs. [@connorshea](https://github.com/connorshea)
114
+ - [PR #1767](https://github.com/faker-ruby/faker/pull/1767) Fix two incorrect flexible method calls. [@connorshea](https://github.com/connorshea)
115
+ - [PR #1761](https://github.com/faker-ruby/faker/pull/1761) Add YARD docs for the Basketball and Football fakers. [@connorshea](https://github.com/connorshea)
116
+ - [PR #1768](https://github.com/faker-ruby/faker/pull/1768) Add YARD docs for Faker::Restaurant. [@connorshea](https://github.com/connorshea)
117
+ - [PR #1759](https://github.com/faker-ruby/faker/pull/1759) Add YARD docs for all remaining TV Shows [@connorshea](https://github.com/connorshea)
118
+ - [PR #1758](https://github.com/faker-ruby/faker/pull/1758) Add YARD docs for Doctor Who and fix a method name. [@connorshea](https://github.com/connorshea)
119
+ - [PR #1756](https://github.com/faker-ruby/faker/pull/1756) Add more miscellaneous YARD docs [@connorshea](https://github.com/connorshea)
120
+ - [PR #1753](https://github.com/faker-ruby/faker/pull/1753) Add YARD docs for Date, Time, and Number [@connorshea](https://github.com/connorshea)
121
+
122
+ ## Update locales
123
+
124
+ - [PR #1764](https://github.com/faker-ruby/faker/pull/1764) Remove "mint green" from color [@ro-savage](https://github.com/ro-savage)
125
+ - [PR #1751](https://github.com/faker-ruby/faker/pull/1751) fix from Color.name to Color.color_name [@4geru](https://github.com/4geru)
126
+
127
+ ## Update local dependencies
128
+
129
+ The following development dependencies were updated:
130
+ - Update minitest requirement from = 5.11.3 to = 5.12.0 (#1763)
131
+
132
+ ------------------------------------------------------------------------------
133
+
134
+ ## [v2.4.0](https://github.com/faker-ruby/faker/tree/v2.4.0) (2019-19-09)
135
+
136
+ ## Documentation
137
+
138
+ - [PR #1750](https://github.com/faker-ruby/faker/pull/1750) add only japanese word spec [@4geru](https://github.com/4geru)
139
+ - [PR #1740](https://github.com/faker-ruby/faker/pull/1740) Add more YARD docs [@connorshea](https://github.com/connorshea)
140
+ - [PR #1747](https://github.com/faker-ruby/faker/pull/1747) Fix PR links [@geniou](https://github.com/geniou)
141
+
142
+ ## Feature Request
143
+
144
+ - [PR #1742](https://github.com/faker-ruby/faker/pull/1742) Add Faker::Blockchain::Aeternity [@2pd](https://github.com/2pd)
145
+
146
+ ## Update locales
147
+
148
+ - [PR #1743](https://github.com/faker-ruby/faker/pull/1743) Fix another ambiguity in element_symbol field [@psibi](https://github.com/psibi)
149
+ - [PR #1748](https://github.com/faker-ruby/faker/pull/1748) fix typo from bread to breed [@4geru](https://github.com/4geru)
150
+ - [PR #1752](https://github.com/faker-ruby/faker/pull/1752) fix creature i18n path in japanese [@4geru](https://github.com/4geru)
151
+
152
+ ## Update local dependencies
153
+
154
+ The following development dependencies were updated:
155
+ - Update simplecov requirement from = 0.17.0 to = 0.17.1 (#1749)
156
+
157
+ ------------------------------------------------------------------------------
158
+
3
159
  ## [v2.3.0](https://github.com/faker-ruby/faker/tree/v2.3.0) (2019-12-09)
4
160
 
5
161
  ## Documentation
@@ -14,8 +170,8 @@
14
170
 
15
171
  ## Update locales
16
172
 
17
- - [PR #1732](https://github.com/faker-ruby/faker/pull/1732) Add pokemon name in Johto area [@mathieujobin](https://github.com/mathieujobin)
18
- - [PR #1723](https://github.com/faker-ruby/faker/pull/1723) Quebec province postal codes starts by [GHJ], adding missing two [@Ryutooooo](https://github.com/Ryutooooo)
173
+ - [PR #1723](https://github.com/faker-ruby/faker/pull/1723) Add pokemon name in Johto area [@mathieujobin](https://github.com/mathieujobin)
174
+ - [PR #1732](https://github.com/faker-ruby/faker/pull/1732) Quebec province postal codes starts by [GHJ], adding missing two [@Ryutooooo](https://github.com/Ryutooooo)
19
175
 
20
176
  ------------------------------------------------------------------------------
21
177
 
data/README.md CHANGED
@@ -4,9 +4,10 @@
4
4
  # Faker
5
5
  [![Build Status](https://travis-ci.org/faker-ruby/faker.svg?branch=master)](https://travis-ci.org/faker-ruby/faker)
6
6
  [![Gem Version](https://badge.fury.io/rb/faker.svg)](https://badge.fury.io/rb/faker)
7
- [![Inline docs](http://inch-ci.org/github/stympy/faker.svg?branch=master)](http://inch-ci.org/github/stympy/faker)
7
+ [![Inline docs](https://inch-ci.org/github/faker-ruby/faker.svg?branch=master)](https://inch-ci.org/github/faker-ruby/faker)
8
8
  [![Test Coverage](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/test_coverage)](https://codeclimate.com/github/stympy/faker/test_coverage)
9
9
  [![Maintainability](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/maintainability)](https://codeclimate.com/github/stympy/faker/maintainability)
10
+ [![SemVer compatibility](https://api.dependabot.com/badges/compatibility_score?dependency-name=faker&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=faker&package-manager=bundler&version-scheme=semver)
10
11
 
11
12
  This gem is a port of [Perl's Data::Faker library](https://metacpan.org/pod/Data::Faker) that generates fake data.
12
13
 
@@ -211,6 +212,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
211
212
  - [Faker::WorldCup](doc/default/world_cup.md)
212
213
 
213
214
  ### Blockchain
215
+ - [Faker::Blockchain::Aeternity](doc/blockchain/aeternity.md)
214
216
  - [Faker::Blockchain::Bitcoin](doc/blockchain/bitcoin.md)
215
217
  - [Faker::Blockchain::Ethereum](doc/blockchain/ethereum.md)
216
218
  - [Faker::Blockchain::Tezos](doc/blockchain/tezos.md)
@@ -359,5 +361,7 @@ See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/master/CONTRIBUTING.m
359
361
  ## Contact
360
362
  Comments and feedback are welcome. Send an email to Benjamin Curtis via the [google group](http://groups.google.com/group/ruby-faker).
361
363
 
364
+ You can also join our [discord channel](https://discord.gg/RMumTwB) to discuss anything regarding improvements or feature requests.
365
+
362
366
  ## License
363
367
  This code is free to use under the terms of the MIT license.
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Faker
4
+ class Blockchain
5
+ class Aeternity < Base
6
+ class << self
7
+ ##
8
+ # Produces a random Aeternity wallet address
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Blockchain::Aeternity.address
14
+ # #=> "ak_zvU8YQLagjcfng7Tg8yCdiZ1rpiWNp1PBn3vtUs44utSvbJVR"
15
+ #
16
+ def address
17
+ 'ak_' + rand_strings
18
+ end
19
+
20
+ ##
21
+ # Produces a random Aeternity transaction
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Blockchain::Aeternity.transaction
27
+ # #=> "th_147nDP22h3pHrLt2qykTH4txUwQh1ccaXp"
28
+ #
29
+ def transaction
30
+ 'th_' + rand_strings(51)
31
+ end
32
+
33
+ ##
34
+ # Produces a random Aeternity contract
35
+ #
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ # Faker::Blockchain::Aeternity.contract
40
+ # #=> "ct_Hk2JsNeWGEYQEHHQCfcBeGrwbhtYSwFTPdDhW2SvjFYVojyhW"
41
+ #
42
+ def contract
43
+ 'ct_' + rand_strings
44
+ end
45
+
46
+ ##
47
+ # Produces a random Aeternity oracle
48
+ #
49
+ # @return [String]
50
+ #
51
+ # @example
52
+ # Faker::Blockchain::Aeternity.oracle
53
+ # #=> "ok_28QDg7fkF5qiKueSdUvUBtCYPJdmMEoS73CztzXCRAwMGKHKZh"
54
+ #
55
+ def oracle
56
+ 'ok_' + rand_strings(51)
57
+ end
58
+
59
+ protected
60
+
61
+ def rand_strings(length = 50)
62
+ hex_alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
63
+ var = +''
64
+ length.times { var << sample(shuffle(hex_alphabet.split(''))) }
65
+ var
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -42,6 +42,8 @@ module Faker
42
42
  parse('app.author')
43
43
  end
44
44
 
45
+ # rubocop:disable Metrics/ParameterLists
46
+
45
47
  ##
46
48
  # Produces a String representing a semantic version identifier.
47
49
  #
@@ -60,7 +62,6 @@ module Faker
60
62
  # Faker::App.semantic_version(patch: 5..6) #=> "7.2.6"
61
63
  #
62
64
  # @faker.version 1.4.3
63
- # rubocop:disable Metrics/ParameterLists
64
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)
65
66
  # rubocop:enable Metrics/ParameterLists
66
67
  warn_for_deprecated_arguments do |keywords|
@@ -3,10 +3,28 @@
3
3
  module Faker
4
4
  class Appliance < Base
5
5
  class << self
6
+ ##
7
+ # Produces the name of an appliance brand.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::Appliance.brand #=> "Bosch"
13
+ #
14
+ # @faker.version 1.9.0
6
15
  def brand
7
16
  fetch('appliance.brand')
8
17
  end
9
18
 
19
+ ##
20
+ # Produces the name of a type of appliance equipment.
21
+ #
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::Appliance.equipment #=> "Appliance plug"
26
+ #
27
+ # @faker.version 1.9.0
10
28
  def equipment
11
29
  fetch('appliance.equipment')
12
30
  end
@@ -6,6 +6,8 @@ module Faker
6
6
  # @private
7
7
  SUPPORTED_FORMATS = %w[png jpg bmp].freeze
8
8
 
9
+ # rubocop:disable Metrics/ParameterLists
10
+
9
11
  ##
10
12
  # Produces a URL for an avatar from robohash.org
11
13
  #
@@ -36,7 +38,6 @@ module Faker
36
38
  # #=> "https://robohash.org/my-own-slug.bmp?size=50x50&set=set1&bgset=bg1"
37
39
  #
38
40
  # @faker.version 1.4.3
39
- # rubocop:disable Metrics/ParameterLists
40
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)
41
42
  # rubocop:enable Metrics/ParameterLists
42
43
  warn_for_deprecated_arguments do |keywords|
@@ -58,8 +58,11 @@ module Faker
58
58
 
59
59
  def checksum(num_string)
60
60
  num_array = num_string.split('').map(&:to_i)
61
- digit = (7 * (num_array[0] + num_array[3] + num_array[6]) + 3 * (num_array[1] + num_array[4] + num_array[7]) + 9 * (num_array[2] + num_array[5])) % 10
62
- digit == num_array[8]
61
+ (
62
+ 7 * (num_array[0] + num_array[3] + num_array[6]) +
63
+ 3 * (num_array[1] + num_array[4] + num_array[7]) +
64
+ 9 * (num_array[2] + num_array[5])
65
+ ) % 10
63
66
  end
64
67
 
65
68
  def compile_routing_number
@@ -85,12 +88,15 @@ module Faker
85
88
  end
86
89
 
87
90
  def valid_routing_number
88
- for _ in 0..50
89
- micr = compile_routing_number
91
+ routing_number = compile_routing_number
92
+ checksum = checksum(routing_number)
93
+ return routing_number if valid_checksum?(routing_number, checksum)
90
94
 
91
- break if checksum(micr)
92
- end
93
- micr
95
+ routing_number[0..7] + checksum.to_s
96
+ end
97
+
98
+ def valid_checksum?(routing_number, checksum)
99
+ routing_number[8].to_i == checksum
94
100
  end
95
101
 
96
102
  def compile_fraction(routing_num)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Faker
4
4
  class ChuckNorris < Base
5
- flexible :name
5
+ flexible :chuck_norris
6
6
 
7
7
  class << self
8
8
  # from: https://github.com/jenkinsci/chucknorris-plugin/blob/master/src/main/java/hudson/plugins/chucknorris/FactGenerator.java
@@ -5,24 +5,69 @@ module Faker
5
5
  flexible :coffee
6
6
 
7
7
  class << self
8
+ ##
9
+ # Produces a random blend name.
10
+ #
11
+ # @return [String]
12
+ #
13
+ # @example
14
+ # Faker::Coffee.blend_name #=> "Major Java"
15
+ #
16
+ # @faker.version 1.9.0
8
17
  def blend_name
9
18
  parse('coffee.blend_name')
10
19
  end
11
20
 
21
+ ##
22
+ # Produces a random coffee origin place.
23
+ #
24
+ # @return [String]
25
+ #
26
+ # @example
27
+ # Faker::Coffee.origin #=> "Oaxaca, Mexico"
28
+ #
29
+ # @faker.version 1.9.0
12
30
  def origin
13
31
  country = fetch('coffee.country')
14
32
  region = fetch("coffee.regions.#{search_format(country)}")
15
33
  "#{region}, #{country}"
16
34
  end
17
35
 
36
+ ##
37
+ # Produces a random coffee variety.
38
+ #
39
+ # @return [String]
40
+ #
41
+ # @example
42
+ # Faker::Coffee.variety #=> "Red Bourbon"
43
+ #
44
+ # @faker.version 1.9.0
18
45
  def variety
19
46
  fetch('coffee.variety')
20
47
  end
21
48
 
49
+ ##
50
+ # Produces a string containing a random description of a coffee's taste.
51
+ #
52
+ # @return [String]
53
+ #
54
+ # @example
55
+ # Faker::Coffee.notes #=> "dull, tea-like, cantaloupe, soy sauce, marshmallow"
56
+ #
57
+ # @faker.version 1.9.0
22
58
  def notes
23
59
  parse('coffee.notes')
24
60
  end
25
61
 
62
+ ##
63
+ # Produces a random coffee taste intensity.
64
+ #
65
+ # @return [String]
66
+ #
67
+ # @example
68
+ # Faker::Coffee.intensifier #=> "mild"
69
+ #
70
+ # @faker.version 1.9.0
26
71
  def intensifier
27
72
  fetch('coffee.intensifier')
28
73
  end