faker 2.12.0 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +240 -0
  3. data/History.md +4 -4
  4. data/README.md +18 -1
  5. data/lib/faker.rb +14 -14
  6. data/lib/faker/blockchain/aeternity.rb +4 -4
  7. data/lib/faker/blockchain/tezos.rb +28 -0
  8. data/lib/faker/books/dune.rb +15 -2
  9. data/lib/faker/books/lovecraft.rb +8 -4
  10. data/lib/faker/default/address.rb +34 -4
  11. data/lib/faker/default/app.rb +1 -1
  12. data/lib/faker/default/avatar.rb +1 -1
  13. data/lib/faker/default/bank.rb +4 -6
  14. data/lib/faker/default/barcode.rb +165 -0
  15. data/lib/faker/default/beer.rb +3 -3
  16. data/lib/faker/default/blood.rb +3 -3
  17. data/lib/faker/default/camera.rb +46 -0
  18. data/lib/faker/default/cannabis.rb +10 -0
  19. data/lib/faker/default/chile_rut.rb +47 -3
  20. data/lib/faker/default/chuck_norris.rb +1 -0
  21. data/lib/faker/default/code.rb +98 -17
  22. data/lib/faker/default/commerce.rb +1 -1
  23. data/lib/faker/default/company.rb +57 -11
  24. data/lib/faker/default/computer.rb +4 -4
  25. data/lib/faker/default/date.rb +16 -12
  26. data/lib/faker/default/driving_licence.rb +26 -2
  27. data/lib/faker/default/drone.rb +332 -0
  28. data/lib/faker/default/faker_adjective.rb +35 -0
  29. data/lib/faker/default/file.rb +6 -4
  30. data/lib/faker/default/finance.rb +21 -0
  31. data/lib/faker/default/food.rb +1 -1
  32. data/lib/faker/default/gender.rb +1 -1
  33. data/lib/faker/default/hipster.rb +14 -11
  34. data/lib/faker/default/id_number.rb +88 -2
  35. data/lib/faker/default/internet.rb +266 -12
  36. data/lib/faker/default/internet_http.rb +48 -0
  37. data/lib/faker/default/invoice.rb +1 -1
  38. data/lib/faker/default/json.rb +7 -6
  39. data/lib/faker/default/lorem.rb +160 -5
  40. data/lib/faker/default/lorem_flickr.rb +67 -7
  41. data/lib/faker/default/lorem_pixel.rb +23 -0
  42. data/lib/faker/default/markdown.rb +91 -0
  43. data/lib/faker/default/measurement.rb +3 -2
  44. data/lib/faker/default/military.rb +26 -0
  45. data/lib/faker/default/mountain.rb +33 -0
  46. data/lib/faker/default/name.rb +15 -0
  47. data/lib/faker/default/nhs.rb +19 -0
  48. data/lib/faker/default/number.rb +6 -8
  49. data/lib/faker/default/omniauth.rb +62 -14
  50. data/lib/faker/default/placeholdit.rb +3 -2
  51. data/lib/faker/default/relationship.rb +1 -1
  52. data/lib/faker/default/space.rb +1 -1
  53. data/lib/faker/default/string.rb +3 -2
  54. data/lib/faker/default/stripe.rb +3 -3
  55. data/lib/faker/default/vehicle.rb +1 -1
  56. data/lib/faker/default/world_cup.rb +4 -4
  57. data/lib/faker/fantasy/tolkien.rb +67 -0
  58. data/lib/faker/games/clash_of_clans.rb +48 -0
  59. data/lib/faker/games/control.rb +9 -9
  60. data/lib/faker/games/dnd.rb +91 -16
  61. data/lib/faker/games/elder_scrolls.rb +26 -0
  62. data/lib/faker/games/heroes.rb +13 -0
  63. data/lib/faker/games/heroes_of_the_storm.rb +16 -5
  64. data/lib/faker/games/minecraft.rb +113 -0
  65. data/lib/faker/games/street_fighter.rb +61 -0
  66. data/lib/faker/games/super_mario.rb +48 -0
  67. data/lib/faker/games/touhou.rb +75 -0
  68. data/lib/faker/games/warhammer_fantasy.rb +5 -5
  69. data/lib/faker/games/world_of_warcraft.rb +26 -1
  70. data/lib/faker/japanese_media/conan.rb +48 -0
  71. data/lib/faker/japanese_media/doraemon.rb +48 -0
  72. data/lib/faker/japanese_media/dragon_ball.rb +26 -0
  73. data/lib/faker/japanese_media/naruto.rb +61 -0
  74. data/lib/faker/japanese_media/studio_ghibli.rb +48 -0
  75. data/lib/faker/movies/departed.rb +3 -3
  76. data/lib/faker/movies/hobbit.rb +4 -4
  77. data/lib/faker/movies/how_to_train_your_dragon.rb +48 -0
  78. data/lib/faker/movies/lord_of_the_rings.rb +3 -3
  79. data/lib/faker/movies/movie.rb +13 -0
  80. data/lib/faker/movies/room.rb +63 -0
  81. data/lib/faker/movies/star_wars.rb +74 -2
  82. data/lib/faker/music/hiphop.rb +48 -0
  83. data/lib/faker/music/opera.rb +237 -1
  84. data/lib/faker/music/pearl_jam.rb +3 -3
  85. data/lib/faker/music/phish.rb +2 -2
  86. data/lib/faker/music/prince.rb +64 -0
  87. data/lib/faker/music/rock_band.rb +12 -0
  88. data/lib/faker/music/rush.rb +37 -0
  89. data/lib/faker/music/show.rb +3 -3
  90. data/lib/faker/quotes/quote.rb +26 -0
  91. data/lib/faker/quotes/rajnikanth.rb +1 -0
  92. data/lib/faker/quotes/shakespeare.rb +34 -0
  93. data/lib/faker/sports/volleyball.rb +74 -0
  94. data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +13 -0
  95. data/lib/faker/tv_shows/big_bang_theory.rb +37 -0
  96. data/lib/faker/tv_shows/buffy.rb +17 -4
  97. data/lib/faker/tv_shows/dr_who.rb +1 -1
  98. data/lib/faker/tv_shows/final_space.rb +51 -0
  99. data/lib/faker/tv_shows/futurama.rb +65 -0
  100. data/lib/faker/tv_shows/simpsons.rb +14 -0
  101. data/lib/faker/tv_shows/suits.rb +3 -3
  102. data/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +17 -4
  103. data/lib/faker/version.rb +1 -1
  104. data/lib/helpers/base58.rb +1 -1
  105. data/lib/helpers/char.rb +20 -26
  106. data/lib/helpers/unique_generator.rb +3 -2
  107. data/lib/locales/de-AT.yml +4 -2
  108. data/lib/locales/de-CH.yml +3 -1
  109. data/lib/locales/de.yml +4 -2
  110. data/lib/locales/en-AU.yml +8 -2
  111. data/lib/locales/en-GB.yml +1 -1
  112. data/lib/locales/en-IND.yml +2 -1
  113. data/lib/locales/en-MS.yml +2 -1
  114. data/lib/locales/en-NEP.yml +4 -1
  115. data/lib/locales/en-NZ.yml +3 -1
  116. data/lib/locales/en-PAK.yml +2 -1
  117. data/lib/locales/en-SG.yml +2 -1
  118. data/lib/locales/en-US.yml +10 -10
  119. data/lib/locales/en-au-ocker.yml +2 -1
  120. data/lib/locales/en.yml +0 -3
  121. data/lib/locales/en/adjective.yml +179 -0
  122. data/lib/locales/en/animal.yml +1 -1
  123. data/lib/locales/en/aqua_teen_hunger_force.yml +33 -1
  124. data/lib/locales/en/bank.yml +1 -1
  125. data/lib/locales/en/barcode.yml +24 -0
  126. data/lib/locales/en/big_bang_theory.yml +38 -0
  127. data/lib/locales/en/buffy.yml +1 -1
  128. data/lib/locales/en/camera.yml +611 -0
  129. data/lib/locales/en/clash_of_clan.yml +101 -0
  130. data/lib/locales/en/company.yml +2 -2
  131. data/lib/locales/en/conan.yml +171 -0
  132. data/lib/locales/en/demographic.yml +218 -5
  133. data/lib/locales/en/dnd.yml +430 -33
  134. data/lib/locales/en/doraemon.yml +286 -0
  135. data/lib/locales/en/dota.yml +531 -63
  136. data/lib/locales/en/dragon_ball.yml +243 -1
  137. data/lib/locales/en/driving_license.yml +181 -0
  138. data/lib/locales/en/drone.yml +95 -0
  139. data/lib/locales/en/dune.yml +401 -131
  140. data/lib/locales/en/elder_scrolls.yml +583 -9
  141. data/lib/locales/en/fallout.yml +311 -133
  142. data/lib/locales/en/final_space.yml +37 -0
  143. data/lib/locales/en/finance.yml +53 -0
  144. data/lib/locales/en/football.yml +3 -3
  145. data/lib/locales/en/fresh_prince_of_bel_air.yml +1 -1
  146. data/lib/locales/en/futurama.yml +344 -0
  147. data/lib/locales/en/half_life.yml +84 -3
  148. data/lib/locales/en/heroes.yml +408 -3
  149. data/lib/locales/en/heroes_of_the_storm.yml +131 -4
  150. data/lib/locales/en/how_to_train_your_dragon.yml +174 -0
  151. data/lib/locales/en/jack_handey.yml +54 -0
  152. data/lib/locales/en/league_of_legends.yml +285 -6
  153. data/lib/locales/en/lebowski.yml +1 -1
  154. data/lib/locales/en/military.yml +179 -5
  155. data/lib/locales/en/minecraft.yml +663 -0
  156. data/lib/locales/en/mountain.yml +158 -0
  157. data/lib/locales/en/movie.yml +192 -1
  158. data/lib/locales/en/music.yml +451 -29
  159. data/lib/locales/en/myst.yml +87 -31
  160. data/lib/locales/en/name.yml +5 -4
  161. data/lib/locales/en/naruto.yml +231 -0
  162. data/lib/locales/en/opera.yml +168 -0
  163. data/lib/locales/en/overwatch.yml +2650 -2622
  164. data/lib/locales/en/pokemon.yml +417 -4
  165. data/lib/locales/en/prince.yml +227 -0
  166. data/lib/locales/en/quote.yml +692 -163
  167. data/lib/locales/en/rock_band.yml +1 -0
  168. data/lib/locales/en/room.yml +68 -0
  169. data/lib/locales/en/rush.yml +32 -0
  170. data/lib/locales/en/simpsons.yml +668 -0
  171. data/lib/locales/en/source.yml +30 -0
  172. data/lib/locales/en/star_trek.yml +1 -1
  173. data/lib/locales/en/star_wars.yml +1 -0
  174. data/lib/locales/en/street_fighter.yml +1524 -0
  175. data/lib/locales/en/studio_ghibli.yml +107 -0
  176. data/lib/locales/en/super_mario.yml +58 -0
  177. data/lib/locales/en/super_smash_bros.yml +18 -4
  178. data/lib/locales/en/tolkien.yml +2453 -0
  179. data/lib/locales/en/touhou.yml +839 -0
  180. data/lib/locales/en/volleyball.yml +501 -0
  181. data/lib/locales/en/witcher.yml +389 -7
  182. data/lib/locales/en/world_of_warcraft.yml +122 -4
  183. data/lib/locales/en/zelda.yml +962 -4
  184. data/lib/locales/es.yml +56 -0
  185. data/lib/locales/fi-FI.yml +1 -1
  186. data/lib/locales/fr-CA.yml +19 -5
  187. data/lib/locales/fr-CH.yml +2 -2
  188. data/lib/locales/fr.yml +12 -6
  189. data/lib/locales/id.yml +3 -1
  190. data/lib/locales/it.yml +2 -1
  191. data/lib/locales/ja.yml +10 -1
  192. data/lib/locales/ko.yml +34 -24
  193. data/lib/locales/nb-NO.yml +4 -2
  194. data/lib/locales/pt-BR.yml +1 -1
  195. data/lib/locales/pt.yml +3 -1
  196. data/lib/locales/ru.yml +3 -1
  197. data/lib/locales/sk.yml +4 -2
  198. data/lib/locales/uk.yml +2 -0
  199. metadata +66 -18
  200. data/lib/locales/en/hobbit.yml +0 -19
  201. data/lib/locales/en/lord_of_the_rings.yml +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e07357f193be20c639621339c209b48ee1a99bb64528e2f3d2c4b61afed8b8b
4
- data.tar.gz: 39d54382315e2fd6abe4b8275b5bee60c832ef2b045ae16bba46e82233ab7697
3
+ metadata.gz: 18002d6c86949152fab3522919844331fc549e8593f46616c165a346cb210abd
4
+ data.tar.gz: db62f2c9507addb919ee639d6f204ca15b604d30d87beeb86cc18a6299bce381
5
5
  SHA512:
6
- metadata.gz: 16d0fdaf172d74ffa7c1cd1ae88e55801313f779e1d2be385941ec7dfa9b2922dacd104406eaa5f060545bbd3b33c840fa9f72f90637e3dc045d70706ab57a61
7
- data.tar.gz: 5589900168ed8cb068fc6682751f1bc8edf6cbe6d8afc191aaf8668af05ee08edfeebb02e446748a18104623fe09f4205206dbc1b2600c732f3a7abc1d46d556
6
+ metadata.gz: 8c9fd6bc54ace68f40dfd9b30618077086389a9447de27fb0ffb062715c9a531da95875ea0c50a9b5d02a7dd4105e80b58bd633aeb98da5cdeec132aba5ccc96
7
+ data.tar.gz: 54016385c84f11b1bb7075d60c9063ca7f02659c7ea13c5cb31b315ece710c9761317a1208b100954426f41ff1d9c133427b52e6728c44ea517e5f6f2a624b40
data/CHANGELOG.md CHANGED
@@ -1,5 +1,245 @@
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
+
34
+ ## [v2.15.1](https://github.com/faker-ruby/faker/tree/v2.15.1) (2020-11-24)
35
+
36
+ - Rollback PR #2169 and bump 2.15.1 [#2203](https://github.com/faker-ruby/faker/pull/2203) @vbrazo
37
+
38
+ ------------------------------------------------------------------------------
39
+
40
+ ## [v2.15.0](https://github.com/faker-ruby/faker/tree/v2.15.0) (2020-11-24)
41
+
42
+ ## Bug/Fixes
43
+
44
+ - Rubocop 1.0 fixes [#2182](https://github.com/faker-ruby/faker/pull/2182) @amatsuda
45
+ - Get rid of broken I18n locales configuration for the tests [#2168](https://github.com/faker-ruby/faker/pull/2168) @amatsuda
46
+ - Fixes a bug when generating a password with min_length eq 1 [#2138](https://github.com/faker-ruby/faker/pull/2138) @adrian-rivera @Zeragamba
47
+ - Improve Faker::Company.spanish_organisation_number [#2106](https://github.com/faker-ruby/faker/pull/2106)
48
+
49
+ ## Chores
50
+
51
+ - Reformat demographic yaml [#2189](https://github.com/faker-ruby/faker/pull/2189) @fiteclub
52
+ - An attempt to load only necessary locales on the fly [#2169](https://github.com/faker-ruby/faker/pull/2169) @amatsuda
53
+ - Faker::Config can be a Module rather than a Class [#2167](https://github.com/faker-ruby/faker/pull/2167) @amatsuda
54
+ - Cleanup games [#2155](https://github.com/faker-ruby/faker/pull/2155) @mathisto
55
+ - Deprecate `celebrity` methods in favor of `actor` [#2133](https://github.com/faker-ruby/faker/pull/2133) @vraravam
56
+
57
+ ## Documentation
58
+
59
+ - Fix class name in volleyball.md [#2198](https://github.com/faker-ruby/faker/pull/2198) @connorshea
60
+ - Fix typo in doc/games/heroes.md [#2145](https://github.com/faker-ruby/faker/pull/2145) @Crysicia
61
+ - fix typo [#2141](https://github.com/faker-ruby/faker/pull/2141) @Zeragamba
62
+ - Updated versions in doc for methods. [#2123](https://github.com/faker-ruby/faker/pull/2123) @sudeeptarlekar
63
+
64
+ ## Feature Request
65
+
66
+ - Add `Faker::Mountain` [#2196](https://github.com/faker-ruby/faker/pull/2196) @bipashant
67
+ - Add Faker::Volleyball [#2178](https://github.com/faker-ruby/faker/pull/2178) @RubyHuntsman
68
+ - Add artifact generator to Faker::Game::Heroes [#2177](https://github.com/faker-ruby/faker/pull/2177) @droznyk
69
+ - Add generator to Faker::Games:ElderScrolls [#2171](https://github.com/faker-ruby/faker/pull/2171) @RubyHuntsman
70
+ - Augment opera [#2170](https://github.com/faker-ruby/faker/pull/2170) @Gaitorius
71
+ - Add generator to Faker::Games::ElderScrolls [#2164](https://github.com/faker-ruby/faker/pull/2164) @RubyHuntsman
72
+ - Add more generators to Faker::Minecraft [#2162](https://github.com/faker-ruby/faker/pull/2162) @RubyHuntsman
73
+ - I added more programming languages to the source [#2161](https://github.com/faker-ruby/faker/pull/2161) @JoaoHenriqueVale
74
+ - Add Faker:Camera [#2159](https://github.com/faker-ruby/faker/pull/2159) @RubyHuntsman
75
+ - Add how to train your dragon [#2158](https://github.com/faker-ruby/faker/pull/2158) @archbloom
76
+ - Add Faker::Fantasy::Tolkien [#2152](https://github.com/faker-ruby/faker/pull/2152) @mathisto
77
+ - Feature: Add north dakota driving licence [#2149](https://github.com/faker-ruby/faker/pull/2149) @martinjaimem
78
+ - Add Final Space to TvShows category [#2147](https://github.com/faker-ruby/faker/pull/2147)
79
+ - Add finance/stock generators [#2146](https://github.com/faker-ruby/faker/pull/2146) @johnpitchko
80
+ - Add Clash Of Clans to the Game category [#2143](https://github.com/faker-ruby/faker/pull/2143) @jamesmai0512
81
+ - Add Conan to the JapaneseMedia category [#2142](https://github.com/faker-ruby/faker/pull/2142) @jamesmai0512
82
+ - Add Naruto to the JapaneseMedia category [#2139](https://github.com/faker-ruby/faker/pull/2139) @jamesmai0512
83
+ - Add Doraemon to the JapaneseMedia category [#2137](https://github.com/faker-ruby/faker/pull/2137) @jamesmai0512
84
+ - Add space force and coast guard to military [#2136](https://github.com/faker-ruby/faker/pull/2136) @mathisto
85
+ - Add Super Mario [#2135](https://github.com/faker-ruby/faker/pull/2135) @fblupi
86
+ - Add The Room (2003) to Movies [#2134](https://github.com/faker-ruby/faker/pull/2134) @fiteclub
87
+ - Faker adjectives [#2130](https://github.com/faker-ruby/faker/pull/2130) @loicboset
88
+ - Add Studio Ghibli to the JapaneseMedia category [#2124](https://github.com/faker-ruby/faker/pull/2124) @Kadaaran
89
+ - Created New Method Faker::Quote.fortune_cookie [#2112](https://github.com/faker-ruby/faker/pull/2112) @catonmat
90
+ - Allow disabling the usage of open compounds in sentences [#2109](https://github.com/faker-ruby/faker/pull/2109) @tjozwik
91
+ - Add faker for hiphop artist [#1923](https://github.com/faker-ruby/faker/pull/1923) @Josiassejod1
92
+ - Add races and class names to WorldOfWarcraft [#1787](https://github.com/faker-ruby/faker/pull/1787) @mathisto
93
+ - Add planets and races to DragonBall [#1786](https://github.com/faker-ruby/faker/pull/1786) @mathisto
94
+ - Add planets, cities, and quotes to Dune [#1784](https://github.com/faker-ruby/faker/pull/1784) @mathisto
95
+
96
+ ## Update locales
97
+
98
+ - add japanese gender first name [#2191](https://github.com/faker-ruby/faker/pull/2191) @issei126
99
+ - Add full_address to Ukrainian locale [#2176](https://github.com/faker-ruby/faker/pull/2176) @Ptico
100
+ - Fixed some spelling issues in company.yml [#2173](https://github.com/faker-ruby/faker/pull/2173) @coreymaher
101
+ - Update Faker::Games::SuperSmashBros [#2164](https://github.com/faker-ruby/faker/pull/2164) @boardfish
102
+ - Add more quotes to Faker::Games::Witcher [#2163](https://github.com/faker-ruby/faker/pull/2163) @RubyHuntsman
103
+ - Add Jack Handey's Deep Thoughts to quotes [#2150](https://github.com/faker-ruby/faker/pull/2150) @fiteclub
104
+ - add brazil license plate from mercosul rules [#2144](https://github.com/faker-ruby/faker/pull/2144) @gabrielbaldao
105
+ - Add additional quotes to Studio Ghibli [#2132](https://github.com/faker-ruby/faker/pull/2132) @lambda2
106
+ - Change 'Nyota Uhuru' to 'Nyota Uhura' [#2121](https://github.com/faker-ruby/faker/pull/2121) @TrevorA-TrevorA
107
+ - Add spanish license plates [#2103](https://github.com/faker-ruby/faker/pull/2103)
108
+
109
+ ## Update local dependencies
110
+
111
+ - Update rubocop requirement from = 1.0.0 to = 1.1.0 [#2185](https://github.com/faker-ruby/faker/pull/2185)
112
+ - Update rubocop requirement from = 0.93.1 to = 1.0.0 [#2172](https://github.com/faker-ruby/faker/pull/2172)
113
+ - Update rubocop requirement from = 0.93.0 to = 0.93.1 [#2156](https://github.com/faker-ruby/faker/pull/2156)
114
+ - Update rubocop requirement from = 0.92.0 to = 0.93.0 [#2151](https://github.com/faker-ruby/faker/pull/2151)
115
+ - Update rubocop requirement from = 0.91.1 to = 0.92.0 [#2129](https://github.com/faker-ruby/faker/pull/2129)
116
+ - Update rubocop requirement from = 0.91.0 to = 0.91.1 [#2126](https://github.com/faker-ruby/faker/pull/2126)
117
+ - Update rubocop requirement from = 0.90.0 to = 0.91.0 [#2122](https://github.com/faker-ruby/faker/pull/2122)
118
+ - Update test-unit requirement from = 3.3.6 to = 3.3.7 [#2195](https://github.com/faker-ruby/faker/pull/2195)
119
+ - Update timecop requirement from = 0.9.1 to = 0.9.2 [#2160](https://github.com/faker-ruby/faker/pull/2160)
120
+
121
+ ------------------------------------------------------------------------------
122
+
123
+ ## [v2.14.0](https://github.com/faker-ruby/faker/tree/v2.14.0) (2020-09-15)
124
+
125
+ ## Bug/Fixes
126
+
127
+ - [PR #2119](https://github.com/faker-ruby/faker/pull/2119) Fixed failing spec for phone number
128
+
129
+ ## Chores
130
+
131
+ - [PR #2088](https://github.com/faker-ruby/faker/pull/2088) Remove the space in the word "turtle" in the Creature::Animals faker
132
+ - [PR #2081](https://github.com/faker-ruby/faker/pull/2081) Remove redundant condition branch for Ruby 2.4
133
+ - [PR #2077](https://github.com/faker-ruby/faker/pull/2077) Rename tests according to the `test*.rb` pattern so that they run
134
+
135
+ ## Documentation
136
+
137
+ - [PR #2095](https://github.com/faker-ruby/faker/pull/2095) Fix a typo for `Games::DnD.species`
138
+ - [PR #2094](https://github.com/faker-ruby/faker/pull/2094) Correct method name from race to species in DnD doc
139
+ - [PR #2079](https://github.com/faker-ruby/faker/pull/2079) Add `Music::PearlJam` to Readme
140
+ - [PR #2058](https://github.com/faker-ruby/faker/pull/2058) Add YARD doc for `Faker::Code`
141
+
142
+ ## Feature Request
143
+
144
+ - [PR #2117](https://github.com/faker-ruby/faker/pull/2117) Add Truffleruby head to CI
145
+ - [PR #2104](https://github.com/faker-ruby/faker/pull/2104) 2097 Added barcodes
146
+ - [PR #2090](https://github.com/faker-ruby/faker/pull/2090) 1693 USA driving license
147
+ - [PR #2098](https://github.com/faker-ruby/faker/pull/2098) Update DnD generator
148
+ - [PR #2096](https://github.com/faker-ruby/faker/pull/2096) 2091 faker drones
149
+ - [PR #2092](https://github.com/faker-ruby/faker/pull/2092) Add a street fighter generator
150
+ - [PR #2082](https://github.com/faker-ruby/faker/pull/2082) Enable `Lint/UnifiedInteger` cop
151
+
152
+ ## Update locales
153
+
154
+ - [PR #2100](https://github.com/faker-ruby/faker/pull/2100) Remove Gaylord
155
+ - [PR #2087](https://github.com/faker-ruby/faker/pull/2087) Fix/remove country code from phone numbers
156
+ - [PR #2086](https://github.com/faker-ruby/faker/pull/2086) removing country code from phone numbers to `fr-CH`
157
+ - [PR #2084](https://github.com/faker-ruby/faker/pull/2084) removed extra + sign from country codes
158
+ - [PR #2078](https://github.com/faker-ruby/faker/pull/2078) Removed 07624 from UK mobile numbers
159
+ - [PR #2073](https://github.com/faker-ruby/faker/pull/2073) Add missing azimuth field for fr locale
160
+ - [PR #2072](https://github.com/faker-ruby/faker/pull/2072) Remove time formats from file
161
+
162
+ Update local dependencies
163
+
164
+ - Update rubocop requirement from = 0.87.1 to = 0.88.0 (#2080)
165
+ - Update rubocop requirement from = 0.87.0 to = 0.87.1 (#2075)
166
+ - Update rubocop requirement from = 0.86.0 to = 0.87.0 (#2074)
167
+ - Bumps i18n from 1.8.4 to 1.8.5 (#2089)
168
+ - Bumps i18n from 1.8.3 to 1.8.4 (#2083)
169
+
170
+ ------------------------------------------------------------------------------
171
+
172
+ ## [v2.13.0](https://github.com/faker-ruby/faker/tree/v2.13.0) (2020-06-24)
173
+
174
+ This version:
175
+ - adds YARD docs for several interface methods
176
+ - fixes bugs
177
+ - adds improvements to the code base
178
+ - updates dependencies
179
+
180
+ ## Bug/Fixes
181
+
182
+ - [PR #2050](https://github.com/faker-ruby/faker/pull/2050) Fix random error in music tests [@martinjaimem](https://github.com/martinjaimem)
183
+ - [PR #2037](https://github.com/faker-ruby/faker/pull/2037) Bug Fix: BIC Collission (Issue 1907) [@Newman101](https://github.com/Newman101)
184
+ - [PR #2026](https://github.com/faker-ruby/faker/pull/2026) Sanitize email when name has special characters [@Zeragamba](https://github.com/Zeragamba)
185
+ - [PR #1785](https://github.com/faker-ruby/faker/pull/1785) Adds a fix for when :en is not one of the available locales [@jaimerodas](https://github.com/jaimerodas)
186
+
187
+ ## Chores
188
+
189
+ - [PR #2041](https://github.com/faker-ruby/faker/pull/2041) Reduce Lines in char.rb [@Newman101](https://github.com/Newman101)
190
+ - [PR #2039](https://github.com/faker-ruby/faker/pull/2039) restore Kylo Ren quotes [@Zeragamba](https://github.com/Zeragamba)
191
+ - [PR #2038](https://github.com/faker-ruby/faker/pull/2038) Drop EOL Rubies from CI tests [@Zeragamba](https://github.com/Zeragamba)
192
+ - [PR #2033](https://github.com/faker-ruby/faker/pull/2033) Use `Faker::Base::ULetters` constant instead [@vbrazo](https://github.com/vbrazo)
193
+ - [PR #2028](https://github.com/faker-ruby/faker/pull/2028) Reorganize some tests [@connorshea](https://github.com/connorshea)
194
+ - [PR #1853](https://github.com/faker-ruby/faker/pull/1853) Exclude string.rb from consideration by YARD. [@connorshea](https://github.com/connorshea)
195
+
196
+ ## Deprecation
197
+
198
+ - [PR #2031](https://github.com/faker-ruby/faker/pull/2031) Deprecate `HeroesOfTheStorm.class` [@koic](https://github.com/koic)
199
+
200
+ ## Documentation
201
+
202
+ - [PR #2065](https://github.com/faker-ruby/faker/pull/2065) Add missing documentation to `Faker::Computer` [@danielTiringer](https://github.com/danielTiringer)
203
+ - [PR #2064](https://github.com/faker-ruby/faker/pull/2064) Add minecraft generators [@Ri1a](https://github.com/Ri1a)
204
+ - [PR #2061](https://github.com/faker-ruby/faker/pull/2061) Update docs for `Faker::Date` with separate examples [@danielTiringer](https://github.com/danielTiringer)
205
+ - [PR #2057](https://github.com/faker-ruby/faker/pull/2057) Add missing quotes to `Faker::Internet` [@Zeragamba](https://github.com/Zeragamba)
206
+ - [PR #2055](https://github.com/faker-ruby/faker/pull/2055) Add YARD docs to `Faker::NHS` [@danielTiringer](https://github.com/danielTiringer)
207
+ - [PR #2054](https://github.com/faker-ruby/faker/pull/2054) Add YARD docs to `Faker::Chile_Rut` [@danielTiringer](https://github.com/danielTiringer)
208
+ - [PR #2053](https://github.com/faker-ruby/faker/pull/2053) Add YARD docs to `Faker::Lorem_Flickr` [@danielTiringer](https://github.com/danielTiringer)
209
+ - [PR #2052](https://github.com/faker-ruby/faker/pull/2052) Add YARD docs to `Faker::Lorem_Pixel` [@danielTiringer](https://github.com/danielTiringer)
210
+ - [PR #2051](https://github.com/faker-ruby/faker/pull/2051) Add YARD docs to `Faker::Omniauth` [@danielTiringer](https://github.com/danielTiringer)
211
+ - [PR #2036](https://github.com/faker-ruby/faker/pull/2036) Add YARD docs to `Faker::Markdown` [@danielTiringer](https://github.com/danielTiringer)
212
+ - [PR #2035](https://github.com/faker-ruby/faker/pull/2035) Add YARD docs to `Faker::ID_Number` [@danielTiringer](https://github.com/danielTiringer)
213
+ - [PR #2030](https://github.com/faker-ruby/faker/pull/2030) Add general documentation for `Faker::Blood` [@jbergenson](https://github.com/jbergenson)
214
+ - [PR #2029](https://github.com/faker-ruby/faker/pull/2029) Allow passing a string to specific `Faker::Date` methods. [@connorshea](https://github.com/connorshea)
215
+
216
+ ## Feature Request
217
+
218
+ - [PR #2040](https://github.com/faker-ruby/faker/pull/2040) Split lint and test Github actions [@Zeragamba](https://github.com/Zeragamba)
219
+ - [PR #2032](https://github.com/faker-ruby/faker/pull/2032) Add `gender-neutral` first names to `Faker::Name` [@cmunozgar](https://github.com/cmunozgar)
220
+ - [PR #1965](https://github.com/faker-ruby/faker/pull/1965) Add new `full_address_as_hash` method which return the required address [@AmrAdelKhalil](https://github.com/AmrAdelKhalil)
221
+ - [PR #1952](https://github.com/faker-ruby/faker/pull/1952) Add `Faker::Movie.title` [@gizipp](https://github.com/gizipp)
222
+ - [PR #1932](https://github.com/faker-ruby/faker/pull/1932) Added AHTF Wisdom [@brotherjack](https://github.com/brotherjack)
223
+ - [PR #1912](https://github.com/faker-ruby/faker/pull/1912) Add `Faker::Music::Rush` [@willianveiga](https://github.com/willianveiga)
224
+ - [PR #1865](https://github.com/faker-ruby/faker/pull/1865) Add Big Bang Theory [@pathaknv](https://github.com/pathaknv)
225
+ - [PR #1858](https://github.com/faker-ruby/faker/pull/1858) Add `Faker::TvShows::Futurama` [@JoeNyland](https://github.com/JoeNyland)
226
+ - [PR #1821](https://github.com/faker-ruby/faker/pull/1821) Add HTTP status codes generator [@willianveiga](https://github.com/willianveiga)
227
+ - [PR #1804](https://github.com/faker-ruby/faker/pull/1804) Add `Faker::TvShows::Simpsons.episode_title` [@martinbjeldbak](https://github.com/martinbjeldbak)
228
+ - [PR #1670](https://github.com/faker-ruby/faker/pull/1670) Adds `Faker::Music::Prince` [@jessecalton](https://github.com/jessecalton)
229
+
230
+ ## Update locales
231
+
232
+ - [PR #1792](https://github.com/faker-ruby/faker/pull/1792) Add more prefixes and suffixes to Name [@mathisto](https://github.com/mathisto)
233
+
234
+ ## Update local dependencies
235
+
236
+ - Update rubocop requirement from = 0.81.0 to = 0.85.1
237
+ - Update rubocop requirement from = 0.85.1 to = 0.86.0 (#2066)
238
+ - Update test-unit requirement from = 3.3.5 to = 3.3.6 (#2046)
239
+ - Bump i18n from 1.8.2 to 1.8.3 (#2034)
240
+
241
+ ------------------------------------------------------------------------------
242
+
3
243
  ## [v2.12.0](https://github.com/faker-ruby/faker/tree/v2.12.0) (2020-05-31)
4
244
 
5
245
  This version:
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
@@ -130,6 +129,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
130
129
  - [Faker::Artist](doc/default/artist.md)
131
130
  - [Faker::Avatar](doc/default/avatar.md)
132
131
  - [Faker::Bank](doc/default/bank.md)
132
+ - [Faker::Barcode](doc/default/barcode.md)
133
133
  - [Faker::Beer](doc/default/beer.md)
134
134
  - [Faker::Blood](doc/default/blood.md)
135
135
  - [Faker::Boolean](doc/default/boolean.md)
@@ -157,6 +157,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
157
157
  - [Faker::Dessert](doc/default/dessert.md)
158
158
  - [Faker::Device](doc/default/device.md)
159
159
  - [Faker::DrivingLicence](doc/default/driving_licence.md)
160
+ - [Faker::Drone](doc/drone/drone.md)
160
161
  - [Faker::Educator](doc/default/educator.md)
161
162
  - [Faker::ElectricalComponents](doc/default/electrical_components.md)
162
163
  - [Faker::Esport](doc/default/esport.md)
@@ -184,6 +185,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
184
185
  - [Faker::Marketing](doc/default/marketing.md)
185
186
  - [Faker::Measurement](doc/default/measurement.md)
186
187
  - [Faker::Military](doc/default/military.md)
188
+ - [Faker::Mountain](doc/default/mountain.md)
187
189
  - [Faker::Name](doc/default/name.md)
188
190
  - [Faker::Nation](doc/default/nation.md)
189
191
  - [Faker::NatoPhoneticAlphabet](doc/default/nato_phonetic_alphabet.md)
@@ -233,6 +235,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
233
235
 
234
236
  ### Games
235
237
  - [Faker::Game](doc/games/game.md)
238
+ - [Faker::Games::ClashOfClans](doc/games/clash_of_clans.md)
236
239
  - [Faker::Games::DnD](doc/games/dnd.md)
237
240
  - [Faker::Games::Dota](doc/games/dota.md)
238
241
  - [Faker::Games::ElderScrolls](doc/games/elder_scrolls.md)
@@ -241,11 +244,15 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
241
244
  - [Faker::Games::Heroes](doc/games/heroes.md)
242
245
  - [Faker::Games::HeroesOfTheStorm](doc/games/heroes_of_the_storm.md)
243
246
  - [Faker::Games::LeagueOfLegends](doc/games/league_of_legends.md)
247
+ - [Faker::Games::Minecraft](doc/games/minecraft.md)
244
248
  - [Faker::Games::Myst](doc/games/myst.md)
245
249
  - [Faker::Games::Overwatch](doc/games/overwatch.md)
246
250
  - [Faker::Games::Pokemon](doc/games/pokemon.md)
247
251
  - [Faker::Games::SonicTheHedgehog](doc/games/sonic_the_hedgehog.md)
252
+ - [Faker::Games::StreetFighter](doc/games/street_fighter.md)
253
+ - [Faker::Games::SuperMario](doc/games/super_mario.md)
248
254
  - [Faker::Games::SuperSmashBros](doc/games/super_smash_bros.md)
255
+ - [Faker::Games::Touhou](doc/games/touhou.md)
249
256
  - [Faker::Games::WarhammerFantasy](doc/games/warhammer_fantasy.md)
250
257
  - [Faker::Games::Witcher](doc/games/witcher.md)
251
258
  - [Faker::Games::WorldOfWarcraft](doc/games/world_of_warcraft.md)
@@ -254,7 +261,11 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
254
261
  ### Japanese Media
255
262
  - [Faker::JapaneseMedia::DragonBall](doc/japanese_media/dragon_ball.md)
256
263
  - [Faker::JapaneseMedia::OnePiece](doc/japanese_media/one_piece.md)
264
+ - [Faker::JapaneseMedia::StudioGhibli](doc/japanese_media/studio_ghibli.md)
257
265
  - [Faker::JapaneseMedia::SwordArtOnline](doc/japanese_media/sword_art_online.md)
266
+ - [Faker::JapaneseMedia::Naruto](doc/japanese_media/naruto.md)
267
+ - [Faker::JapaneseMedia::Doraemon](doc/japanese_media/doraemon.md)
268
+ - [Faker::JapaneseMedia::Conan](doc/japanese_media/conan.md)
258
269
 
259
270
  ### Movies
260
271
  - [Faker::Movie](doc/movies/movie.md)
@@ -264,6 +275,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
264
275
  - [Faker::Movies::HarryPotter](doc/movies/harry_potter.md)
265
276
  - [Faker::Movies::HitchhikersGuideToTheGalaxy](doc/movies/hitchhikers_guide_to_the_galaxy.md)
266
277
  - [Faker::Movies::Hobbit](doc/movies/hobbit.md)
278
+ - [Faker::Movies::HowToTrainYourDragon](doc/movies/how_to_train_your_dragon.md)
267
279
  - [Faker::Movies::Lebowski](doc/movies/lebowski.md)
268
280
  - [Faker::Movies::LordOfTheRings](doc/movies/lord_of_the_rings.md)
269
281
  - [Faker::Movies::PrincessBride](doc/movies/princess_bride.md)
@@ -274,8 +286,11 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
274
286
  - [Faker::Music](doc/music/music.md)
275
287
  - [Faker::Music::GratefulDead](doc/music/grateful_dead.md)
276
288
  - [Faker::Music::Opera](doc/music/opera.md)
289
+ - [Faker::Music::PearlJam](doc/music/pearl_jam.md)
277
290
  - [Faker::Music::Phish](doc/music/phish.md)
291
+ - [Faker::Music::Prince](doc/music/prince.md)
278
292
  - [Faker::Music::RockBand](doc/music/rock_band.md)
293
+ - [Faker::Music::Rush](doc/music/rush.md)
279
294
  - [Faker::Music::UmphreysMcgee](doc/music/umphreys_mcgee.md)
280
295
 
281
296
  ### Quotes
@@ -291,6 +306,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
291
306
 
292
307
  ### Tv Shows
293
308
  - [Faker::TvShows::AquaTeenHungerForce](doc/tv_shows/aqua_teen_hunger_force.md)
309
+ - [Faker::TvShows::BigBangTheory](doc/tv_shows/big_bang_theory.md)
294
310
  - [Faker::TvShows::BojackHorseman](doc/tv_shows/bojack_horseman.md)
295
311
  - [Faker::TvShows::BreakingBad](doc/tv_shows/breaking_bad.md)
296
312
  - [Faker::TvShows::Buffy](doc/tv_shows/buffy.md)
@@ -298,6 +314,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
298
314
  - [Faker::TvShows::DrWho](doc/tv_shows/dr_who.md)
299
315
  - [Faker::TvShows::DumbAndDumber](doc/tv_shows/dumb_and_dumber.md)
300
316
  - [Faker::TvShows::FamilyGuy](doc/tv_shows/family_guy.md)
317
+ - [Faker::TvShows::FinalSpace](doc/tv_shows/final_space.md)
301
318
  - [Faker::TvShows::Friends](doc/tv_shows/friends.md)
302
319
  - [Faker::TvShows::GameOfThrones](doc/tv_shows/game_of_thrones.md)
303
320
  - [Faker::TvShows::HeyArnold](doc/tv_shows/hey_arnold.md)
data/lib/faker.rb CHANGED
@@ -12,16 +12,16 @@ I18n.load_path += Dir[File.join(mydir, 'locales', '**/*.yml')]
12
12
  I18n.reload! if I18n.backend.initialized?
13
13
 
14
14
  module Faker
15
- class Config
15
+ module Config
16
16
  @locale = nil
17
17
  @random = nil
18
18
 
19
19
  class << self
20
- attr_writer :locale
21
- attr_writer :random
20
+ attr_writer :locale, :random
22
21
 
23
22
  def locale
24
- @locale || I18n.locale
23
+ # Because I18n.locale defaults to :en, if we don't have :en in our available_locales, errors will happen
24
+ @locale || (I18n.available_locales.include?(I18n.locale) ? I18n.locale : I18n.available_locales.first)
25
25
  end
26
26
 
27
27
  def own_locale
@@ -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
@@ -80,13 +80,13 @@ module Faker
80
80
  def regexify(reg)
81
81
  reg = reg.source if reg.respond_to?(:source) # Handle either a Regexp or a String that looks like a Regexp
82
82
  reg
83
- .gsub(%r{^\/?\^?}, '').gsub(%r{\$?\/?$}, '') # Ditch the anchors
83
+ .gsub(%r{^/?\^?}, '').gsub(%r{\$?/?$}, '') # Ditch the anchors
84
84
  .gsub(/\{(\d+)\}/, '{\1,\1}').gsub(/\?/, '{0,1}') # All {2} become {2,2} and ? become {0,1}
85
85
  .gsub(/(\[[^\]]+\])\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # [12]{1,2} becomes [12] or [12][12]
86
- .gsub(/(\([^\)]+\))\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # (12|34){1,2} becomes (12|34) or (12|34)(12|34)
86
+ .gsub(/(\([^)]+\))\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # (12|34){1,2} becomes (12|34) or (12|34)(12|34)
87
87
  .gsub(/(\\?.)\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # A{1,2} becomes A or AA or \d{3} becomes \d\d\d
88
- .gsub(/\((.*?)\)/) { |match| sample(match.gsub(/[\(\)]/, '').split('|')) } # (this|that) becomes 'this' or 'that'
89
- .gsub(/\[([^\]]+)\]/) { |match| match.gsub(/(\w\-\w)/) { |range| sample(Array(Range.new(*range.split('-')))) } } # All A-Z inside of [] become C (or X, or whatever)
88
+ .gsub(/\((.*?)\)/) { |match| sample(match.gsub(/[()]/, '').split('|')) } # (this|that) becomes 'this' or 'that'
89
+ .gsub(/\[([^\]]+)\]/) { |match| match.gsub(/(\w-\w)/) { |range| sample(Array(Range.new(*range.split('-')))) } } # All A-Z inside of [] become C (or X, or whatever)
90
90
  .gsub(/\[([^\]]+)\]/) { |_match| sample(Regexp.last_match(1).split('')) } # All [ABC] become B (or A or C)
91
91
  .gsub('\d') { |_match| sample(Numbers) }
92
92
  .gsub('\w') { |_match| sample(Letters) }
@@ -96,7 +96,7 @@ module Faker
96
96
  # with an array of values and selecting one of them.
97
97
  def fetch(key)
98
98
  fetched = sample(translate("faker.#{key}"))
99
- if fetched&.match(%r{^\/}) && fetched&.match(%r{\/$}) # A regex
99
+ if fetched&.match(%r{^/}) && fetched&.match(%r{/$}) # A regex
100
100
  regexify(fetched)
101
101
  else
102
102
  fetched
@@ -108,7 +108,7 @@ module Faker
108
108
  def fetch_all(key)
109
109
  fetched = translate("faker.#{key}")
110
110
  fetched = fetched.last if fetched.size <= 1
111
- if !fetched.respond_to?(:sample) && fetched.match(%r{^\/}) && fetched.match(%r{\/$}) # A regex
111
+ if !fetched.respond_to?(:sample) && fetched.match(%r{^/}) && fetched.match(%r{/$}) # A regex
112
112
  regexify(fetched)
113
113
  else
114
114
  fetched
@@ -120,7 +120,7 @@ module Faker
120
120
  # formatted translation: e.g., "#{first_name} #{last_name}".
121
121
  def parse(key)
122
122
  fetched = fetch(key)
123
- parts = fetched.scan(/(\(?)#\{([A-Za-z]+\.)?([^\}]+)\}([^#]+)?/).map do |prefix, kls, meth, etc|
123
+ parts = fetched.scan(/(\(?)#\{([A-Za-z]+\.)?([^}]+)\}([^#]+)?/).map do |prefix, kls, meth, etc|
124
124
  # If the token had a class Prefix (e.g., Name.first_name)
125
125
  # grab the constant, otherwise use self
126
126
  cls = kls ? Faker.const_get(kls.chop) : self
@@ -164,12 +164,12 @@ module Faker
164
164
  end
165
165
 
166
166
  # Executes block with given locale set.
167
- def with_locale(tmp_locale = nil)
167
+ def with_locale(tmp_locale = nil, &block)
168
168
  current_locale = Faker::Config.own_locale
169
169
  Faker::Config.locale = tmp_locale
170
170
 
171
171
  disable_enforce_available_locales do
172
- I18n.with_locale(tmp_locale) { yield }
172
+ I18n.with_locale(tmp_locale, &block)
173
173
  end
174
174
  ensure
175
175
  Faker::Config.locale = current_locale