faker 2.10.1 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +291 -9
  3. data/README.md +18 -2
  4. data/lib/faker.rb +20 -10
  5. data/lib/faker/default/address.rb +31 -1
  6. data/lib/faker/default/bank.rb +79 -0
  7. data/lib/faker/default/barcode.rb +154 -0
  8. data/lib/faker/default/blood.rb +48 -0
  9. data/lib/faker/default/business.rb +1 -1
  10. data/lib/faker/default/cannabis.rb +80 -0
  11. data/lib/faker/default/chile_rut.rb +44 -1
  12. data/lib/faker/default/code.rb +96 -15
  13. data/lib/faker/default/commerce.rb +73 -10
  14. data/lib/faker/default/company.rb +276 -7
  15. data/lib/faker/default/compass.rb +135 -0
  16. data/lib/faker/default/computer.rb +63 -0
  17. data/lib/faker/default/construction.rb +54 -0
  18. data/lib/faker/default/cosmere.rb +90 -0
  19. data/lib/faker/default/crypto_coin.rb +45 -0
  20. data/lib/faker/default/date.rb +16 -12
  21. data/lib/faker/default/dc_comics.rb +45 -0
  22. data/lib/faker/default/driving_licence.rb +65 -0
  23. data/lib/faker/default/drone.rb +332 -0
  24. data/lib/faker/default/file.rb +51 -2
  25. data/lib/faker/default/finance.rb +24 -0
  26. data/lib/faker/default/funny_name.rb +45 -0
  27. data/lib/faker/default/gender.rb +1 -1
  28. data/lib/faker/default/hipster.rb +94 -0
  29. data/lib/faker/default/id_number.rb +86 -0
  30. data/lib/faker/default/internet.rb +64 -7
  31. data/lib/faker/default/internet_http.rb +48 -0
  32. data/lib/faker/default/invoice.rb +32 -5
  33. data/lib/faker/default/json.rb +55 -0
  34. data/lib/faker/default/lorem.rb +1 -1
  35. data/lib/faker/default/lorem_flickr.rb +65 -0
  36. data/lib/faker/default/lorem_pixel.rb +22 -0
  37. data/lib/faker/default/markdown.rb +89 -0
  38. data/lib/faker/default/measurement.rb +90 -0
  39. data/lib/faker/default/name.rb +98 -0
  40. data/lib/faker/default/nhs.rb +19 -0
  41. data/lib/faker/default/number.rb +5 -7
  42. data/lib/faker/default/omniauth.rb +105 -52
  43. data/lib/faker/default/phone_number.rb +88 -5
  44. data/lib/faker/default/placeholdit.rb +21 -0
  45. data/lib/faker/default/slack_emoji.rb +81 -0
  46. data/lib/faker/default/south_africa.rb +90 -0
  47. data/lib/faker/default/string.rb +19 -3
  48. data/lib/faker/default/stripe.rb +61 -0
  49. data/lib/faker/default/twitter.rb +35 -0
  50. data/lib/faker/default/types.rb +80 -0
  51. data/lib/faker/default/university.rb +45 -0
  52. data/lib/faker/default/vehicle.rb +184 -4
  53. data/lib/faker/default/verb.rb +45 -0
  54. data/lib/faker/default/world_cup.rb +4 -4
  55. data/lib/faker/games/control.rb +113 -0
  56. data/lib/faker/games/dnd.rb +136 -0
  57. data/lib/faker/games/heroes_of_the_storm.rb +16 -5
  58. data/lib/faker/games/minecraft.rb +48 -0
  59. data/lib/faker/games/street_fighter.rb +61 -0
  60. data/lib/faker/games/warhammer_fantasy.rb +74 -0
  61. data/lib/faker/movies/departed.rb +49 -0
  62. data/lib/faker/movies/movie.rb +13 -0
  63. data/lib/faker/music/pearl_jam.rb +50 -0
  64. data/lib/faker/music/phish.rb +27 -1
  65. data/lib/faker/music/prince.rb +64 -0
  66. data/lib/faker/music/rush.rb +37 -0
  67. data/lib/faker/music/show.rb +49 -0
  68. data/lib/faker/quotes/chiquito.rb +80 -0
  69. data/lib/faker/quotes/quote.rb +54 -1
  70. data/lib/faker/quotes/rajnikanth.rb +26 -0
  71. data/lib/faker/quotes/shakespeare.rb +36 -0
  72. data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +13 -0
  73. data/lib/faker/tv_shows/big_bang_theory.rb +37 -0
  74. data/lib/faker/tv_shows/dr_who.rb +1 -1
  75. data/lib/faker/tv_shows/futurama.rb +65 -0
  76. data/lib/faker/tv_shows/simpsons.rb +14 -0
  77. data/lib/faker/tv_shows/suits.rb +37 -0
  78. data/lib/faker/version.rb +1 -1
  79. data/lib/helpers/base58.rb +1 -1
  80. data/lib/helpers/char.rb +22 -27
  81. data/lib/helpers/unique_generator.rb +0 -2
  82. data/lib/locales/de-AT.yml +4 -2
  83. data/lib/locales/de-CH.yml +1696 -1
  84. data/lib/locales/de.yml +4 -2
  85. data/lib/locales/en-AU.yml +50 -10
  86. data/lib/locales/en-CA.yml +2 -0
  87. data/lib/locales/en-GB.yml +1 -1
  88. data/lib/locales/en-IND.yml +2 -1
  89. data/lib/locales/en-MS.yml +2 -1
  90. data/lib/locales/en-NEP.yml +5 -2
  91. data/lib/locales/en-NZ.yml +5 -1
  92. data/lib/locales/en-PAK.yml +2 -1
  93. data/lib/locales/en-SG.yml +2 -1
  94. data/lib/locales/en-US.yml +36 -10
  95. data/lib/locales/en-ZA.yml +1 -1
  96. data/lib/locales/en-au-ocker.yml +2 -1
  97. data/lib/locales/en.yml +0 -3
  98. data/lib/locales/en/address.yml +2 -0
  99. data/lib/locales/en/animal.yml +1 -1
  100. data/lib/locales/en/aqua_teen_hunger_force.yml +33 -1
  101. data/lib/locales/en/bank.yml +1 -1
  102. data/lib/locales/en/barcode.yml +24 -0
  103. data/lib/locales/en/big_bang_theory.yml +38 -0
  104. data/lib/locales/en/blood.yml +13 -0
  105. data/lib/locales/en/chiquito.yml +64 -0
  106. data/lib/locales/en/color.yml +1 -1
  107. data/lib/locales/en/computer.yml +36 -0
  108. data/lib/locales/en/control.yml +247 -0
  109. data/lib/locales/en/departed.yml +50 -0
  110. data/lib/locales/en/dnd.yml +451 -0
  111. data/lib/locales/en/driving_license.yml +178 -0
  112. data/lib/locales/en/drone.yml +95 -0
  113. data/lib/locales/en/futurama.yml +344 -0
  114. data/lib/locales/en/heroes_of_the_storm.yml +2 -2
  115. data/lib/locales/en/house.yml +1 -1
  116. data/lib/locales/en/minecraft.yml +390 -0
  117. data/lib/locales/en/movie.yml +192 -1
  118. data/lib/locales/en/name.yml +6 -5
  119. data/lib/locales/en/one_piece.yml +2 -2
  120. data/lib/locales/en/pearl_jam.yml +213 -0
  121. data/lib/locales/en/phish.yml +392 -1
  122. data/lib/locales/en/prince.yml +227 -0
  123. data/lib/locales/en/rajnikanth.yml +77 -0
  124. data/lib/locales/en/rush.yml +32 -0
  125. data/lib/locales/en/shakespeare.yml +3 -3
  126. data/lib/locales/en/show.yml +597 -0
  127. data/lib/locales/en/simpsons.yml +668 -0
  128. data/lib/locales/en/star_wars.yml +568 -220
  129. data/lib/locales/en/street_fighter.yml +1524 -0
  130. data/lib/locales/en/suits.yml +45 -0
  131. data/lib/locales/en/warhammer_fantasy.yml +582 -0
  132. data/lib/locales/es-MX.yml +3 -0
  133. data/lib/locales/fi-FI.yml +1 -1
  134. data/lib/locales/fr-CA.yml +26 -9
  135. data/lib/locales/fr-CH.yml +2 -2
  136. data/lib/locales/fr.yml +13 -6
  137. data/lib/locales/hy.yml +1 -6
  138. data/lib/locales/id.yml +4 -2
  139. data/lib/locales/it.yml +2 -1
  140. data/lib/locales/ja.yml +1 -1
  141. data/lib/locales/ko.yml +94 -2
  142. data/lib/locales/nb-NO.yml +4 -2
  143. data/lib/locales/pt-BR.yml +1 -0
  144. data/lib/locales/pt.yml +5 -3
  145. data/lib/locales/ru.yml +3 -1
  146. data/lib/locales/sk.yml +4 -2
  147. data/lib/locales/uk.yml +5 -5
  148. data/lib/locales/zh-CN.yml +1 -1
  149. data/lib/locales/zh-TW.yml +1 -1
  150. metadata +57 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f748d0be9910a52b4c0f7ca9731c0d604a92d00a73a4ce8a47610cde547d7027
4
- data.tar.gz: 4c02b2ab5e03424e9a7271aae8b5cc45358c2e9e1ac79ef9a43b3c6c97bd2151
3
+ metadata.gz: c20404a4d9474978940db437ddac9984deddd352fdf7cf9313d038a7e9c0ce54
4
+ data.tar.gz: d52491d45e9dbc7525cf078789e84c10219d2c8e428de4541a1e73dfa6246569
5
5
  SHA512:
6
- metadata.gz: 5e7fd5141e00c96959a05b874f1a972a29772803eb76fec01c78b368755bbe688cd9995276e3145dbd943b723d58eec4234a87152c898aedd5c634b26af9a7c0
7
- data.tar.gz: af823f7fafa1f532c97d99afbc934b922727f64ee9094fe1c97309c82faa63be66501b91716f3340a7aa32b7378a685d78f65847b9d4b3a1dbe008f21b40f0f8
6
+ metadata.gz: ee17e0c0333a8e5456d167ed3f7ccc26be29c5f95efdcf6aa866cc2b80789afb95a910922af3405f9d3484b0c266c5217fa40fb593c08eefcc8aab0159b83f91
7
+ data.tar.gz: 66fa28264c8fbe299c025e6bd566a55870fd9059bda1863dfbe3d03c7fe56a176f04432c784f3d1a079429bb375cc18c56da6d38341b2167edce1f3abbae9074
@@ -1,5 +1,287 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.14.0](https://github.com/faker-ruby/faker/tree/v2.14.0) (2020-09-15)
4
+
5
+ ## Bug/Fixes
6
+
7
+ - [PR #2119](https://github.com/faker-ruby/faker/pull/2119) Fixed failing spec for phone number
8
+
9
+ ## Chores
10
+
11
+ - [PR #2088](https://github.com/faker-ruby/faker/pull/2088) Remove the space in the word "turtle" in the Creature::Animals faker
12
+ - [PR #2081](https://github.com/faker-ruby/faker/pull/2081) Remove redundant condition branch for Ruby 2.4
13
+ - [PR #2077](https://github.com/faker-ruby/faker/pull/2077) Rename tests according to the `test*.rb` pattern so that they run
14
+
15
+ ## Documentation
16
+
17
+ - [PR #2095](https://github.com/faker-ruby/faker/pull/2095) Fix a typo for `Games::DnD.species`
18
+ - [PR #2094](https://github.com/faker-ruby/faker/pull/2094) Correct method name from race to species in DnD doc
19
+ - [PR #2079](https://github.com/faker-ruby/faker/pull/2079) Add `Music::PearlJam` to Readme
20
+ - [PR #2058](https://github.com/faker-ruby/faker/pull/2058) Add YARD doc for `Faker::Code`
21
+
22
+ ## Feature Request
23
+
24
+ - [PR #2117](https://github.com/faker-ruby/faker/pull/2117) Add Truffleruby head to CI
25
+ - [PR #2104](https://github.com/faker-ruby/faker/pull/2104) 2097 Added barcodes
26
+ - [PR #2090](https://github.com/faker-ruby/faker/pull/2090) 1693 USA driving license
27
+ - [PR #2098](https://github.com/faker-ruby/faker/pull/2098) Update DnD generator
28
+ - [PR #2096](https://github.com/faker-ruby/faker/pull/2096) 2091 faker drones
29
+ - [PR #2092](https://github.com/faker-ruby/faker/pull/2092) Add a street fighter generator
30
+ - [PR #2082](https://github.com/faker-ruby/faker/pull/2082) Enable `Lint/UnifiedInteger` cop
31
+
32
+ ## Update locales
33
+
34
+ - [PR #2100](https://github.com/faker-ruby/faker/pull/2100) Remove Gaylord
35
+ - [PR #2087](https://github.com/faker-ruby/faker/pull/2087) Fix/remove country code from phone numbers
36
+ - [PR #2086](https://github.com/faker-ruby/faker/pull/2086) removing country code from phone numbers to `fr-CH`
37
+ - [PR #2084](https://github.com/faker-ruby/faker/pull/2084) removed extra + sign from country codes
38
+ - [PR #2078](https://github.com/faker-ruby/faker/pull/2078) Removed 07624 from UK mobile numbers
39
+ - [PR #2073](https://github.com/faker-ruby/faker/pull/2073) Add missing azimuth field for fr locale
40
+ - [PR #2072](https://github.com/faker-ruby/faker/pull/2072) Remove time formats from file
41
+
42
+ Update local dependencies
43
+
44
+ - Update rubocop requirement from = 0.87.1 to = 0.88.0 (#2080)
45
+ - Update rubocop requirement from = 0.87.0 to = 0.87.1 (#2075)
46
+ - Update rubocop requirement from = 0.86.0 to = 0.87.0 (#2074)
47
+ - Bumps i18n from 1.8.4 to 1.8.5 (#2089)
48
+ - Bumps i18n from 1.8.3 to 1.8.4 (#2083)
49
+
50
+ ------------------------------------------------------------------------------
51
+
52
+ ## [v2.13.0](https://github.com/faker-ruby/faker/tree/v2.13.0) (2020-06-24)
53
+
54
+ This version:
55
+ - adds YARD docs for several interface methods
56
+ - fixes bugs
57
+ - adds improvements to the code base
58
+ - updates dependencies
59
+
60
+ ## Bug/Fixes
61
+
62
+ - [PR #2050](https://github.com/faker-ruby/faker/pull/2050) Fix random error in music tests [@martinjaimem](https://github.com/martinjaimem)
63
+ - [PR #2037](https://github.com/faker-ruby/faker/pull/2037) Bug Fix: BIC Collission (Issue 1907) [@Newman101](https://github.com/Newman101)
64
+ - [PR #2026](https://github.com/faker-ruby/faker/pull/2026) Sanitize email when name has special characters [@Zeragamba](https://github.com/Zeragamba)
65
+ - [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)
66
+
67
+ ## Chores
68
+
69
+ - [PR #2041](https://github.com/faker-ruby/faker/pull/2041) Reduce Lines in char.rb [@Newman101](https://github.com/Newman101)
70
+ - [PR #2039](https://github.com/faker-ruby/faker/pull/2039) restore Kylo Ren quotes [@Zeragamba](https://github.com/Zeragamba)
71
+ - [PR #2038](https://github.com/faker-ruby/faker/pull/2038) Drop EOL Rubies from CI tests [@Zeragamba](https://github.com/Zeragamba)
72
+ - [PR #2033](https://github.com/faker-ruby/faker/pull/2033) Use `Faker::Base::ULetters` constant instead [@vbrazo](https://github.com/vbrazo)
73
+ - [PR #2028](https://github.com/faker-ruby/faker/pull/2028) Reorganize some tests [@connorshea](https://github.com/connorshea)
74
+ - [PR #1853](https://github.com/faker-ruby/faker/pull/1853) Exclude string.rb from consideration by YARD. [@connorshea](https://github.com/connorshea)
75
+
76
+ ## Deprecation
77
+
78
+ - [PR #2031](https://github.com/faker-ruby/faker/pull/2031) Deprecate `HeroesOfTheStorm.class` [@koic](https://github.com/koic)
79
+
80
+ ## Documentation
81
+
82
+ - [PR #2065](https://github.com/faker-ruby/faker/pull/2065) Add missing documentation to `Faker::Computer` [@danielTiringer](https://github.com/danielTiringer)
83
+ - [PR #2064](https://github.com/faker-ruby/faker/pull/2064) Add minecraft generators [@Ri1a](https://github.com/Ri1a)
84
+ - [PR #2061](https://github.com/faker-ruby/faker/pull/2061) Update docs for `Faker::Date` with separate examples [@danielTiringer](https://github.com/danielTiringer)
85
+ - [PR #2057](https://github.com/faker-ruby/faker/pull/2057) Add missing quotes to `Faker::Internet` [@Zeragamba](https://github.com/Zeragamba)
86
+ - [PR #2055](https://github.com/faker-ruby/faker/pull/2055) Add YARD docs to `Faker::NHS` [@danielTiringer](https://github.com/danielTiringer)
87
+ - [PR #2054](https://github.com/faker-ruby/faker/pull/2054) Add YARD docs to `Faker::Chile_Rut` [@danielTiringer](https://github.com/danielTiringer)
88
+ - [PR #2053](https://github.com/faker-ruby/faker/pull/2053) Add YARD docs to `Faker::Lorem_Flickr` [@danielTiringer](https://github.com/danielTiringer)
89
+ - [PR #2052](https://github.com/faker-ruby/faker/pull/2052) Add YARD docs to `Faker::Lorem_Pixel` [@danielTiringer](https://github.com/danielTiringer)
90
+ - [PR #2051](https://github.com/faker-ruby/faker/pull/2051) Add YARD docs to `Faker::Omniauth` [@danielTiringer](https://github.com/danielTiringer)
91
+ - [PR #2036](https://github.com/faker-ruby/faker/pull/2036) Add YARD docs to `Faker::Markdown` [@danielTiringer](https://github.com/danielTiringer)
92
+ - [PR #2035](https://github.com/faker-ruby/faker/pull/2035) Add YARD docs to `Faker::ID_Number` [@danielTiringer](https://github.com/danielTiringer)
93
+ - [PR #2030](https://github.com/faker-ruby/faker/pull/2030) Add general documentation for `Faker::Blood` [@jbergenson](https://github.com/jbergenson)
94
+ - [PR #2029](https://github.com/faker-ruby/faker/pull/2029) Allow passing a string to specific `Faker::Date` methods. [@connorshea](https://github.com/connorshea)
95
+
96
+ ## Feature Request
97
+
98
+ - [PR #2040](https://github.com/faker-ruby/faker/pull/2040) Split lint and test Github actions [@Zeragamba](https://github.com/Zeragamba)
99
+ - [PR #2032](https://github.com/faker-ruby/faker/pull/2032) Add `gender-neutral` first names to `Faker::Name` [@cmunozgar](https://github.com/cmunozgar)
100
+ - [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)
101
+ - [PR #1952](https://github.com/faker-ruby/faker/pull/1952) Add `Faker::Movie.title` [@gizipp](https://github.com/gizipp)
102
+ - [PR #1932](https://github.com/faker-ruby/faker/pull/1932) Added AHTF Wisdom [@brotherjack](https://github.com/brotherjack)
103
+ - [PR #1912](https://github.com/faker-ruby/faker/pull/1912) Add `Faker::Music::Rush` [@willianveiga](https://github.com/willianveiga)
104
+ - [PR #1865](https://github.com/faker-ruby/faker/pull/1865) Add Big Bang Theory [@pathaknv](https://github.com/pathaknv)
105
+ - [PR #1858](https://github.com/faker-ruby/faker/pull/1858) Add `Faker::TvShows::Futurama` [@JoeNyland](https://github.com/JoeNyland)
106
+ - [PR #1821](https://github.com/faker-ruby/faker/pull/1821) Add HTTP status codes generator [@willianveiga](https://github.com/willianveiga)
107
+ - [PR #1804](https://github.com/faker-ruby/faker/pull/1804) Add `Faker::TvShows::Simpsons.episode_title` [@martinbjeldbak](https://github.com/martinbjeldbak)
108
+ - [PR #1670](https://github.com/faker-ruby/faker/pull/1670) Adds `Faker::Music::Prince` [@jessecalton](https://github.com/jessecalton)
109
+
110
+ ## Update locales
111
+
112
+ - [PR #1792](https://github.com/faker-ruby/faker/pull/1792) Add more prefixes and suffixes to Name [@mathisto](https://github.com/mathisto)
113
+
114
+ ## Update local dependencies
115
+
116
+ - Update rubocop requirement from = 0.81.0 to = 0.85.1
117
+ - Update rubocop requirement from = 0.85.1 to = 0.86.0 (#2066)
118
+ - Update test-unit requirement from = 3.3.5 to = 3.3.6 (#2046)
119
+ - Bump i18n from 1.8.2 to 1.8.3 (#2034)
120
+
121
+ ------------------------------------------------------------------------------
122
+
123
+ ## [v2.12.0](https://github.com/faker-ruby/faker/tree/v2.12.0) (2020-05-31)
124
+
125
+ This version:
126
+ - adds several YARD docs
127
+ - fixes some locale issues
128
+ - fixes a few bugs in Faker generators
129
+ - improves code quality
130
+ - adds a few generators for Movies, Music and TV Shows
131
+ - updates local dependencies
132
+
133
+ ## Bug/Fixes
134
+
135
+ - [PR #2019](https://github.com/faker-ruby/faker/pull/2019) Update 'prepare' regexp to allow hyphen [@jbergenson](https://github.com/jbergenson)
136
+ - [PR #2012](https://github.com/faker-ruby/faker/pull/2012) Add else condition to prevent false positive [@jbergenson](https://github.com/jbergenson)
137
+ - [PR #1985](https://github.com/faker-ruby/faker/pull/1985) Fix an error for `Faker::Computer.os` [@koic](https://github.com/koic)
138
+ - [PR #1971](https://github.com/faker-ruby/faker/pull/1971) Fixing the CI failure by fixing the infinite loop in Commerce [@amatsuda](https://github.com/amatsuda)
139
+
140
+ ## Chores
141
+
142
+ - [PR #1988](https://github.com/faker-ruby/faker/pull/1988) Removing meaningless begin and end [@amatsuda](https://github.com/amatsuda)
143
+ - [PR #1979](https://github.com/faker-ruby/faker/pull/1979) Reuse the `lvar` instead of calling `File.dirname(__FILE__)` again and again [@amatsuda](https://github.com/amatsuda)
144
+
145
+ ## Documentation
146
+
147
+ - [PR #2022](https://github.com/faker-ruby/faker/pull/2022) Add YARD docs to `Faker::Invoice` [@danielTiringer](https://github.com/danielTiringer)
148
+ - [PR #2021](https://github.com/faker-ruby/faker/pull/2021) Add YARD docs to `Faker::Hipster` [@danielTiringer](https://github.com/danielTiringer)
149
+ - [PR #2020](https://github.com/faker-ruby/faker/pull/2020) Add YARD docs to `Faker::Measurement` [@danielTiringer](https://github.com/danielTiringer)
150
+ - [PR #2017](https://github.com/faker-ruby/faker/pull/2017) Fix docs for `Faker::Games::Control.altered_world_event` [@Zeragamba](https://github.com/Zeragamba)
151
+ - [PR #2016](https://github.com/faker-ruby/faker/pull/2016) Fix yard documentation issues [@danielTiringer](https://github.com/danielTiringer)
152
+ - [PR #2015](https://github.com/faker-ruby/faker/pull/2015) Add YARD docs to `Faker::Quotes` [@danielTiringer](https://github.com/danielTiringer)
153
+ - [PR #2011](https://github.com/faker-ruby/faker/pull/2011) Update `star_wars.yml` [@garrettmichaelgeorge](https://github.com/garrettmichaelgeorge)
154
+ - [PR #2010](https://github.com/faker-ruby/faker/pull/2010) Add missing links in README.md [@Naokimi](https://github.com/Naokimi)
155
+ - [PR #2009](https://github.com/faker-ruby/faker/pull/2009) Add YARD docs to `Faker::Placeholdit` [@danielTiringer](https://github.com/danielTiringer)
156
+ - [PR #2008](https://github.com/faker-ruby/faker/pull/2008) Add YARD docs to `Faker::Verb` [@danielTiringer](https://github.com/danielTiringer)
157
+ - [PR #2007](https://github.com/faker-ruby/faker/pull/2007) Add YARD docs to `Faker::Phone_Number` [@danielTiringer](https://github.com/danielTiringer)
158
+ - [PR #2004](https://github.com/faker-ruby/faker/pull/2004) Add YARD docs to `Faker::String` [@danielTiringer](https://github.com/danielTiringer)
159
+ - [PR #2001](https://github.com/faker-ruby/faker/pull/2001) Add YARD docs to `Faker::South_Africa` [@danielTiringer](https://github.com/danielTiringer)
160
+ - [PR #2000](https://github.com/faker-ruby/faker/pull/2000) Add YARD docs to `Faker::JSON` [@danielTiringer](https://github.com/danielTiringer)
161
+ - [PR #1999](https://github.com/faker-ruby/faker/pull/1999) Add YARD docs to `Faker::Types` [@danielTiringer](https://github.com/danielTiringer)
162
+ - [PR #1998](https://github.com/faker-ruby/faker/pull/1998) Add YARD docs to `Faker::Finance` [@danielTiringer](https://github.com/danielTiringer)
163
+ - [PR #1997](https://github.com/faker-ruby/faker/pull/1997) Add YARD docs to `Faker::Driving_Licence` [@danielTiringer](https://github.com/danielTiringer)
164
+ - [PR #1996](https://github.com/faker-ruby/faker/pull/1996) Add YARD docs to `Crypto Coin` [@danielTiringer](https://github.com/danielTiringer)
165
+ - [PR #1995](https://github.com/faker-ruby/faker/pull/1995) Add YARD docs to `Faker::Commerce` [@danielTiringer](https://github.com/danielTiringer)
166
+ - [PR #1993](https://github.com/faker-ruby/faker/pull/1993) Add YARD docs to `Faker::Vehicle` [@danielTiringer](https://github.com/danielTiringer)
167
+ - [PR #1990](https://github.com/faker-ruby/faker/pull/1990) Add YARD docs to `Faker::File` [@danielTiringer](https://github.com/danielTiringer)
168
+ - [PR #1989](https://github.com/faker-ruby/faker/pull/1989) Add YARD docs to `Faker::Bank` [@danielTiringer](https://github.com/danielTiringer)
169
+ - [PR #1984](https://github.com/faker-ruby/faker/pull/1984) Minor documentation fix for `Faker::University` [@Zeragamba](https://github.com/Zeragamba)
170
+ - [PR #1983](https://github.com/faker-ruby/faker/pull/1983) Add YARD docs to `Faker::Twitter` [@danielTiringer](https://github.com/danielTiringer)
171
+ - [PR #1982](https://github.com/faker-ruby/faker/pull/1982) Add YARD docs to `Faker::Cosmere` [@danielTiringer](https://github.com/danielTiringer)
172
+ - [PR #1981](https://github.com/faker-ruby/faker/pull/1981) Add YARD docs to `Faker::Stripe` [@danielTiringer](https://github.com/danielTiringer)
173
+ - [PR #1980](https://github.com/faker-ruby/faker/pull/1980) Add YARD docs to `Faker::Construction` [@danielTiringer](https://github.com/danielTiringer)
174
+ - [PR #1976](https://github.com/faker-ruby/faker/pull/1976) Add YARD docs to `Faker::Name` [@danielTiringer](https://github.com/danielTiringer)
175
+ - [PR #1975](https://github.com/faker-ruby/faker/pull/1975) Add YARD docs to `Faker::Compass` [@danielTiringer](https://github.com/danielTiringer)
176
+ - [PR #1959](https://github.com/faker-ruby/faker/pull/1959) Add YARD docs to `Faker::University` [@danielTiringer](https://github.com/danielTiringer)
177
+ - [PR #1956](https://github.com/faker-ruby/faker/pull/1956) Add YARD docs to `Faker::SlackEmoji` [@rutger-t](https://github.com/rutger-t)
178
+ - [PR #1943](https://github.com/faker-ruby/faker/pull/1943) Update documentation for unique.exclude [@mtancoigne](https://github.com/mtancoigne)
179
+ - [PR #1925](https://github.com/faker-ruby/faker/pull/1925) AdD `Faker::Game::WarhammerFantasy` [@sotek222](https://github.com/sotek222)
180
+
181
+ ## Feature Request
182
+
183
+ - [PR #2025](https://github.com/faker-ruby/faker/pull/2025) Add `Faker::TvShows::Suits` [@ash-elangovan](https://github.com/ash-elangovan)
184
+ - [PR #2024](https://github.com/faker-ruby/faker/pull/2024) Added Phish Albums and Musicians [@zfine416](https://github.com/zfine416)
185
+ - [PR #2013](https://github.com/faker-ruby/faker/pull/2013) Add `Faker::Games::Control` [@Zeragamba](https://github.com/Zeragamba)
186
+ - [PR #1994](https://github.com/faker-ruby/faker/pull/1994) Enable Ruby testing github workflow [@Zeragamba](https://github.com/Zeragamba)
187
+ - [PR #1966](https://github.com/faker-ruby/faker/pull/1966) Add `Faker::Games:DnD` [@Naokimi](https://github.com/Naokimi)
188
+ - [PR #1962](https://github.com/faker-ruby/faker/pull/1962) Adding Pearl Jam to the Music module [@briri](https://github.com/briri)
189
+ - [PR #1960](https://github.com/faker-ruby/faker/pull/1960) Added `Faker::Blood` [@suraj32](https://github.com/suraj32)
190
+ - [PR #1931](https://github.com/faker-ruby/faker/pull/1931) Add `Faker::Movies::Departed` Class [@jaebradley](https://github.com/jaebradley)
191
+ - [PR #1696](https://github.com/faker-ruby/faker/pull/1696) Add Bibles class with King James subclass [@jbergenson](https://github.com/jbergenson)
192
+ - [PR #1485](https://github.com/faker-ruby/faker/pull/1485) Plays and musicals [@armandofox](https://github.com/armandofox)
193
+
194
+ ## Update locales
195
+
196
+ - [PR #2014](https://github.com/faker-ruby/faker/pull/2014) Make locale self-contained [@psibi](https://github.com/psibi)
197
+ - [PR #1986](https://github.com/faker-ruby/faker/pull/1986) Added quotations to Shirahoshi [@iavivai](https://github.com/iavivai)
198
+ - [PR #1973](https://github.com/faker-ruby/faker/pull/1973) Fix mis-quotations [@kayhide](https://github.com/kayhide)
199
+ - [PR #1967](https://github.com/faker-ruby/faker/pull/1967) ko locale updates [@jae57](https://github.com/jae57)
200
+ - [PR #1964](https://github.com/faker-ruby/faker/pull/1964) en-AU locale updates [@mattman](https://github.com/mattman)
201
+ - [PR #1948](https://github.com/faker-ruby/faker/pull/1948) Add `Faker::Computer` [@cmcramer](https://github.com/cmcramer)
202
+
203
+ ## Update local dependencies
204
+
205
+ - Update minitest requirement from = 5.14.0 to = 5.14.1 (#1987)
206
+ - Update rubocop requirement from = 0.80.1 to = 0.81.0 (#1955)
207
+ - Update pry requirement from = 0.13.0 to = 0.13.1 (#1963)
208
+ - Update yard requirement from = 0.9.24 to = 0.9.25 (#1970)
209
+
210
+ ------------------------------------------------------------------------------
211
+
212
+ ## [v2.11.0](https://github.com/faker-ruby/faker/tree/v2.11.0) (2020-03-24)
213
+
214
+ ## Bug/Fixes
215
+
216
+ - [PR #1938](https://github.com/faker-ruby/faker/pull/1938) Fix omniauth consistency [@DouglasLutz](https://github.com/DouglasLutz)
217
+
218
+ ## Documentation
219
+
220
+ - [PR #1949](https://github.com/faker-ruby/faker/pull/1949) Add YARD doc for Faker::Cannabis [@mashuDuek](https://github.com/mashuDuek)
221
+ - [PR #1944](https://github.com/faker-ruby/faker/pull/1944) Add YARD docs for Faker::FunnyName [@curriecode](https://github.com/curriecode)
222
+ - [PR #1935](https://github.com/faker-ruby/faker/pull/1935) Add YARD docs for the unique method [@connorshea](https://github.com/connorshea)
223
+
224
+ ## Feature Request
225
+
226
+ - [PR #1946](https://github.com/faker-ruby/faker/pull/1946) Add Faker::Rajnikanth [@wolwire](https://github.com/wolwire)
227
+ - [PR #1940](https://github.com/faker-ruby/faker/pull/1940) Add Faker::Quotes::Chiquito [@jantequera](https://github.com/jantequera)
228
+ - [PR #1883](https://github.com/faker-ruby/faker/pull/1883) add Internet#base64 [@cyrilchampier](https://github.com/cyrilchampier)
229
+
230
+ ## Update locales
231
+
232
+ - [PR #1945](https://github.com/faker-ruby/faker/pull/1945) Remove female first name 'Miss' [@ags](https://github.com/ags)
233
+ - [PR #1929](https://github.com/faker-ruby/faker/pull/1929) Fixed mobile prefixes for en-GB locale [@SamHart91](https://github.com/SamHart91)
234
+
235
+ ## Update local dependencies
236
+
237
+ - Update pry requirement from = 0.12.2 to = 0.13.0 (#1951)
238
+ - Update rubocop requirement from = 0.80.0 to = 0.80.1 (#1941)
239
+ - Update rubocop requirement from = 0.79.0 to = 0.80.0 (#1937)
240
+
241
+ ------------------------------------------------------------------------------
242
+
243
+ ## [v2.10.2](https://github.com/faker-ruby/faker/tree/v2.10.2) (2020-02-15)
244
+
245
+ This version:
246
+ - adds a few YARD docs
247
+ - fixes locales
248
+ - updates local dependencies
249
+
250
+ ## Chores
251
+
252
+ - [PR #1924](https://github.com/faker-ruby/faker/pull/1924) Use ruby's `File::Separator` rather than '/' as a default for direct [@swiknaba](https://github.com/swiknaba)
253
+
254
+ ## Documentation
255
+
256
+ - [PR #1913](https://github.com/faker-ruby/faker/pull/1913) Add YARD docs for Faker::DcComics [@ash-elangovan](https://github.com/ash-elangovan)
257
+
258
+ ## Update locales
259
+
260
+ - [PR #1934](https://github.com/faker-ruby/faker/pull/1934) Add street_address for en-nz locale [@psibi](https://github.com/psibi)
261
+ - [PR #1933](https://github.com/faker-ruby/faker/pull/1933) Make id locale consistent. [@psibi](https://github.com/psibi)
262
+ - [PR #1930](https://github.com/faker-ruby/faker/pull/1930) Remove spaces before apostrophes [@jrmhaig](https://github.com/jrmhaig)
263
+ - [PR #1927](https://github.com/faker-ruby/faker/pull/1927) zh-TW locale fix: Avoid double de-reference for name_with_middle [@psibi](https://github.com/psibi)
264
+ - [PR #1922](https://github.com/faker-ruby/faker/pull/1922) zh-CN locale fix: Directly refer to the expected values [@psibi](https://github.com/psibi)
265
+ - [PR #1921](https://github.com/faker-ruby/faker/pull/1921) uk locale fix: Make empty fields consistent [@psibi](https://github.com/psibi)
266
+ - [PR #1920](https://github.com/faker-ruby/faker/pull/1920) pt locale fix: Make city fields consistent with other [@psibi](https://github.com/psibi)
267
+ - [PR #1918](https://github.com/faker-ruby/faker/pull/1918) Make Japanese Lorem sentences look more natural [@rastamhadi](https://github.com/rastamhadi)
268
+ - [PR #1915](https://github.com/faker-ruby/faker/pull/1915) Add yard docs for Faker::Company [@kos31de](https://github.com/kos31de)
269
+ - [PR #1914](https://github.com/faker-ruby/faker/pull/1914) Data source fix for ha locale [@psibi](https://github.com/psibi)
270
+ - [PR #1911](https://github.com/faker-ruby/faker/pull/1911) Removed duplicate value [@ash-elangovan](https://github.com/ash-elangovan)
271
+ - [PR #1908](https://github.com/faker-ruby/faker/pull/1908) Add more colors [@tomcol](https://github.com/tomcol)
272
+ - [PR #1903](https://github.com/faker-ruby/faker/pull/1903) fr locale: pokemon's root key should be games [@connorshea](https://github.com/connorshea)
273
+ - [PR #1902](https://github.com/faker-ruby/faker/pull/1902) Remove empty string in phone_number formats [@psibi](https://github.com/psibi)
274
+ - [PR #1901](https://github.com/faker-ruby/faker/pull/1901) fr-CA locale fix: pokemon's root key should be games [@psibi](https://github.com/psibi)
275
+ - [PR #1900](https://github.com/faker-ruby/faker/pull/1900) Use postcode for en-ZA [@psibi](https://github.com/psibi)
276
+ - [PR #1899](https://github.com/faker-ruby/faker/pull/1899) Locale root name should be en-NEP [@psibi](https://github.com/psibi)
277
+ - [PR #1812](https://github.com/faker-ruby/faker/pull/1812) Add vat number rule for es-MX [@arandilopez](https://github.com/arandilopez)
278
+
279
+ ## Update local dependencies
280
+
281
+ - Update test-unit requirement from = 3.3.4 to = 3.3.5 (#1896)
282
+
283
+ ------------------------------------------------------------------------------
284
+
3
285
  ## [v2.10.1](https://github.com/faker-ruby/faker/tree/v2.10.1) (2020-01-13)
4
286
 
5
287
  This version:
@@ -20,15 +302,15 @@ This version:
20
302
 
21
303
  ## Update local dependencies
22
304
 
23
- Allow all versions of i18n from 1.6 up to 2 (#1894) [@orien](https://github.com/orien)
24
- Update minitest requirement from = 5.13.0 to = 5.14.0 (#1904)
25
- Bump i18n from 1.8.1 to 1.8.2 (#1905)
26
- Bump i18n from 1.8.0 to 1.8.1 (#1895)
27
- Update i18n requirement from >= 1.6, < 1.8 to >= 1.6, < 1.9 (#1893)
28
- Update yard requirement from = 0.9.23 to = 0.9.24 (#1892)
29
- Update rubocop requirement from = 0.78.0 to = 0.79.0 (#1890)
30
- Update yard requirement from = 0.9.22 to = 0.9.23 (#1889)
31
- Update yard requirement from = 0.9.20 to = 0.9.22 (#1882)
305
+ - Allow all versions of i18n from 1.6 up to 2 (#1894) [@orien](https://github.com/orien)
306
+ - Update minitest requirement from = 5.13.0 to = 5.14.0 (#1904)
307
+ - Bump i18n from 1.8.1 to 1.8.2 (#1905)
308
+ - Bump i18n from 1.8.0 to 1.8.1 (#1895)
309
+ - Update i18n requirement from >= 1.6, < 1.8 to >= 1.6, < 1.9 (#1893)
310
+ - Update yard requirement from = 0.9.23 to = 0.9.24 (#1892)
311
+ - Update rubocop requirement from = 0.78.0 to = 0.79.0 (#1890)
312
+ - Update yard requirement from = 0.9.22 to = 0.9.23 (#1889)
313
+ - Update yard requirement from = 0.9.20 to = 0.9.22 (#1882)
32
314
 
33
315
  ------------------------------------------------------------------------------
34
316
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  ![logotype a happy-07](https://user-images.githubusercontent.com/36028424/40263395-4318481e-5b44-11e8-92e5-3dcc1ce169b3.png)
3
3
 
4
4
  # Faker
5
- [![Build Status](https://travis-ci.org/faker-ruby/faker.svg?branch=master)](https://travis-ci.org/faker-ruby/faker)
5
+ [![Tests](https://github.com/faker-ruby/faker/workflows/Tests/badge.svg)](https://github.com/faker-ruby/faker/actions?query=workflow%3ATests)
6
6
  [![Gem Version](https://badge.fury.io/rb/faker.svg)](https://badge.fury.io/rb/faker)
7
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)
@@ -95,7 +95,7 @@ manually set values).
95
95
  # Faker::<generator>.unique.exclude(method, arguments, list)
96
96
 
97
97
  # Add 'azerty' and 'wxcvbn' to the string generator with 6 char length
98
- Faker::Lorem.unique.exclude :string, [6], %w[azerty wxcvbn]
98
+ Faker::Lorem.unique.exclude :string, [number: 6], %w[azerty wxcvbn]
99
99
  ```
100
100
 
101
101
  ### Deterministic Random
@@ -130,7 +130,9 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
130
130
  - [Faker::Artist](doc/default/artist.md)
131
131
  - [Faker::Avatar](doc/default/avatar.md)
132
132
  - [Faker::Bank](doc/default/bank.md)
133
+ - [Faker::Barcode](doc/default/barcode.md)
133
134
  - [Faker::Beer](doc/default/beer.md)
135
+ - [Faker::Blood](doc/default/blood.md)
134
136
  - [Faker::Boolean](doc/default/boolean.md)
135
137
  - [Faker::BossaNova](doc/default/bossa_nova.md)
136
138
  - [Faker::Business](doc/default/business.md)
@@ -144,6 +146,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
144
146
  - [Faker::Commerce](doc/default/commerce.md)
145
147
  - [Faker::Company](doc/default/company.md)
146
148
  - [Faker::Compass](doc/default/compass.md)
149
+ - [Faker::Computer](doc/default/computer.md)
147
150
  - [Faker::Construction](doc/default/construction.md)
148
151
  - [Faker::Cosmere](doc/default/cosmere.md)
149
152
  - [Faker::Crypto](doc/default/crypto.md)
@@ -155,6 +158,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
155
158
  - [Faker::Dessert](doc/default/dessert.md)
156
159
  - [Faker::Device](doc/default/device.md)
157
160
  - [Faker::DrivingLicence](doc/default/driving_licence.md)
161
+ - [Faker::Drone](doc/drone/drone.md)
158
162
  - [Faker::Educator](doc/default/educator.md)
159
163
  - [Faker::ElectricalComponents](doc/default/electrical_components.md)
160
164
  - [Faker::Esport](doc/default/esport.md)
@@ -231,6 +235,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
231
235
 
232
236
  ### Games
233
237
  - [Faker::Game](doc/games/game.md)
238
+ - [Faker::Games::DnD](doc/games/dnd.md)
234
239
  - [Faker::Games::Dota](doc/games/dota.md)
235
240
  - [Faker::Games::ElderScrolls](doc/games/elder_scrolls.md)
236
241
  - [Faker::Games::Fallout](doc/games/fallout.md)
@@ -242,7 +247,9 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
242
247
  - [Faker::Games::Overwatch](doc/games/overwatch.md)
243
248
  - [Faker::Games::Pokemon](doc/games/pokemon.md)
244
249
  - [Faker::Games::SonicTheHedgehog](doc/games/sonic_the_hedgehog.md)
250
+ - [Faker::Games::StreetFighter](doc/games/street_fighter.md)
245
251
  - [Faker::Games::SuperSmashBros](doc/games/super_smash_bros.md)
252
+ - [Faker::Games::WarhammerFantasy](doc/games/warhammer_fantasy.md)
246
253
  - [Faker::Games::Witcher](doc/games/witcher.md)
247
254
  - [Faker::Games::WorldOfWarcraft](doc/games/world_of_warcraft.md)
248
255
  - [Faker::Games::Zelda](doc/games/zelda.md)
@@ -255,6 +262,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
255
262
  ### Movies
256
263
  - [Faker::Movie](doc/movies/movie.md)
257
264
  - [Faker::Movies::BackToTheFuture](doc/movies/back_to_the_future.md)
265
+ - [Faker::Movies::Departed](doc/movies/departed.md)
258
266
  - [Faker::Movies::Ghostbusters](doc/movies/ghostbusters.md)
259
267
  - [Faker::Movies::HarryPotter](doc/movies/harry_potter.md)
260
268
  - [Faker::Movies::HitchhikersGuideToTheGalaxy](doc/movies/hitchhikers_guide_to_the_galaxy.md)
@@ -269,20 +277,27 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
269
277
  - [Faker::Music](doc/music/music.md)
270
278
  - [Faker::Music::GratefulDead](doc/music/grateful_dead.md)
271
279
  - [Faker::Music::Opera](doc/music/opera.md)
280
+ - [Faker::Music::PearlJam](doc/music/pearl_jam.md)
272
281
  - [Faker::Music::Phish](doc/music/phish.md)
282
+ - [Faker::Music::Prince](doc/music/prince.md)
273
283
  - [Faker::Music::RockBand](doc/music/rock_band.md)
284
+ - [Faker::Music::Rush](doc/music/rush.md)
274
285
  - [Faker::Music::UmphreysMcgee](doc/music/umphreys_mcgee.md)
275
286
 
276
287
  ### Quotes
277
288
  - [Faker::Quote](doc/quotes/quote.md)
289
+ - [Faker::Quotes::Chiquito](doc/quotes/chiquito.md)
290
+ - [Faker::Quotes::Rajnikanth](doc/quotes/rajnikanth.md)
278
291
  - [Faker::Quotes::Shakespeare](doc/quotes/shakespeare.md)
279
292
 
293
+
280
294
  ### Sports
281
295
  - [Faker::Sports::Basketball](doc/sports/basketball.md)
282
296
  - [Faker::Sports::Football](doc/sports/football.md)
283
297
 
284
298
  ### Tv Shows
285
299
  - [Faker::TvShows::AquaTeenHungerForce](doc/tv_shows/aqua_teen_hunger_force.md)
300
+ - [Faker::TvShows::BigBangTheory](doc/tv_shows/big_bang_theory.md)
286
301
  - [Faker::TvShows::BojackHorseman](doc/tv_shows/bojack_horseman.md)
287
302
  - [Faker::TvShows::BreakingBad](doc/tv_shows/breaking_bad.md)
288
303
  - [Faker::TvShows::Buffy](doc/tv_shows/buffy.md)
@@ -306,6 +321,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
306
321
  - [Faker::TvShows::StarTrek](doc/tv_shows/star_trek.md)
307
322
  - [Faker::TvShows::Stargate](doc/tv_shows/stargate.md)
308
323
  - [Faker::TvShows::StrangerThings](doc/tv_shows/stranger_things.md)
324
+ - [Faker::TvShows::Suits](doc/tv_shows/suits.md)
309
325
  - [Faker::TvShows::TheExpanse](doc/tv_shows/the_expanse.md)
310
326
  - [Faker::TvShows::TheFreshPrinceOfBelAir](doc/tv_shows/the_fresh_prince_of_bel_air.md)
311
327
  - [Faker::TvShows::TheITCrowd](doc/tv_shows/the_it_crowd.md)
@@ -2,14 +2,11 @@
2
2
 
3
3
  mydir = __dir__
4
4
 
5
- begin
6
- require 'psych'
7
- end
8
-
5
+ require 'psych'
9
6
  require 'i18n'
10
7
  require 'set' # Fixes a bug in i18n 0.6.11
11
8
 
12
- Dir.glob(File.join(File.dirname(__FILE__), 'helpers', '*.rb')).sort.each { |file| require file }
9
+ Dir.glob(File.join(mydir, 'helpers', '*.rb')).sort.each { |file| require file }
13
10
 
14
11
  I18n.load_path += Dir[File.join(mydir, 'locales', '**/*.yml')]
15
12
  I18n.reload! if I18n.backend.initialized?
@@ -24,7 +21,8 @@ module Faker
24
21
  attr_writer :random
25
22
 
26
23
  def locale
27
- @locale || I18n.locale
24
+ # Because I18n.locale defaults to :en, if we don't have :en in our available_locales, errors will happen
25
+ @locale || (I18n.available_locales.include?(I18n.locale) ? I18n.locale : I18n.available_locales.first)
28
26
  end
29
27
 
30
28
  def own_locale
@@ -132,7 +130,7 @@ module Faker
132
130
  # In either case the information will be retained for reconstruction of the string.
133
131
  text = prefix
134
132
 
135
- # If the class has the method, call it, otherwise fetch the transation
133
+ # If the class has the method, call it, otherwise fetch the translation
136
134
  # (e.g., faker.phone_number.area_code)
137
135
  text += if cls.respond_to?(meth)
138
136
  cls.send(meth)
@@ -217,12 +215,24 @@ module Faker
217
215
  end
218
216
  end
219
217
 
218
+ # Return unique values from the generator every time.
219
+ #
220
+ # @param max_retries [Integer] The max number of retries that should be done before giving up.
221
+ # @return [self]
220
222
  def unique(max_retries = 10_000)
221
223
  @unique ||= UniqueGenerator.new(self, max_retries)
222
224
  end
223
225
 
224
- def sample(list)
225
- list.respond_to?(:sample) ? list.sample(random: Faker::Config.random) : list
226
+ def sample(list, num = nil)
227
+ if list.respond_to?(:sample)
228
+ if num
229
+ list.sample(num, random: Faker::Config.random)
230
+ else
231
+ list.sample(random: Faker::Config.random)
232
+ end
233
+ else
234
+ list
235
+ end
226
236
  end
227
237
 
228
238
  def shuffle(list)
@@ -303,4 +313,4 @@ module Faker
303
313
  end
304
314
 
305
315
  # require faker objects
306
- Dir.glob(File.join(File.dirname(__FILE__), 'faker', '/**/*.rb')).sort.each { |file| require file }
316
+ Dir.glob(File.join(mydir, 'faker', '/**/*.rb')).sort.each { |file| require file }