faker 2.11.0 → 2.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +372 -13
  3. data/History.md +4 -4
  4. data/README.md +27 -3
  5. data/lib/faker/blockchain/aeternity.rb +4 -4
  6. data/lib/faker/blockchain/bitcoin.rb +2 -2
  7. data/lib/faker/blockchain/tezos.rb +30 -2
  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 +35 -5
  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 +96 -3
  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 +48 -0
  17. data/lib/faker/default/business.rb +1 -1
  18. data/lib/faker/default/camera.rb +46 -0
  19. data/lib/faker/default/cannabis.rb +10 -0
  20. data/lib/faker/default/chile_rut.rb +47 -3
  21. data/lib/faker/default/chuck_norris.rb +1 -0
  22. data/lib/faker/default/code.rb +98 -17
  23. data/lib/faker/default/commerce.rb +74 -11
  24. data/lib/faker/default/company.rb +96 -11
  25. data/lib/faker/default/compass.rb +135 -0
  26. data/lib/faker/default/computer.rb +63 -0
  27. data/lib/faker/default/construction.rb +54 -0
  28. data/lib/faker/default/cosmere.rb +90 -0
  29. data/lib/faker/default/crypto.rb +4 -4
  30. data/lib/faker/default/crypto_coin.rb +45 -0
  31. data/lib/faker/default/date.rb +16 -12
  32. data/lib/faker/default/driving_licence.rb +67 -1
  33. data/lib/faker/default/drone.rb +332 -0
  34. data/lib/faker/default/educator.rb +13 -0
  35. data/lib/faker/default/faker_adjective.rb +35 -0
  36. data/lib/faker/default/file.rb +53 -2
  37. data/lib/faker/default/finance.rb +45 -0
  38. data/lib/faker/default/food.rb +1 -1
  39. data/lib/faker/default/gender.rb +1 -1
  40. data/lib/faker/default/hipster.rb +107 -10
  41. data/lib/faker/default/id_number.rb +88 -2
  42. data/lib/faker/default/internet.rb +266 -12
  43. data/lib/faker/default/internet_http.rb +48 -0
  44. data/lib/faker/default/invoice.rb +33 -6
  45. data/lib/faker/default/json.rb +61 -5
  46. data/lib/faker/default/lorem.rb +160 -5
  47. data/lib/faker/default/lorem_flickr.rb +67 -7
  48. data/lib/faker/default/lorem_pixel.rb +23 -0
  49. data/lib/faker/default/markdown.rb +91 -0
  50. data/lib/faker/default/measurement.rb +93 -2
  51. data/lib/faker/default/military.rb +26 -0
  52. data/lib/faker/default/mountain.rb +33 -0
  53. data/lib/faker/default/name.rb +98 -0
  54. data/lib/faker/default/nhs.rb +19 -0
  55. data/lib/faker/default/number.rb +28 -13
  56. data/lib/faker/default/omniauth.rb +62 -14
  57. data/lib/faker/default/phone_number.rb +88 -5
  58. data/lib/faker/default/placeholdit.rb +23 -1
  59. data/lib/faker/default/relationship.rb +1 -1
  60. data/lib/faker/default/slack_emoji.rb +81 -0
  61. data/lib/faker/default/south_africa.rb +90 -0
  62. data/lib/faker/default/space.rb +1 -1
  63. data/lib/faker/default/string.rb +20 -3
  64. data/lib/faker/default/stripe.rb +64 -3
  65. data/lib/faker/default/twitter.rb +35 -0
  66. data/lib/faker/default/types.rb +84 -3
  67. data/lib/faker/default/university.rb +45 -0
  68. data/lib/faker/default/vehicle.rb +184 -4
  69. data/lib/faker/default/verb.rb +45 -0
  70. data/lib/faker/default/world_cup.rb +4 -4
  71. data/lib/faker/fantasy/tolkien.rb +67 -0
  72. data/lib/faker/games/clash_of_clans.rb +48 -0
  73. data/lib/faker/games/control.rb +113 -0
  74. data/lib/faker/games/dnd.rb +136 -0
  75. data/lib/faker/games/elder_scrolls.rb +26 -0
  76. data/lib/faker/games/heroes.rb +13 -0
  77. data/lib/faker/games/heroes_of_the_storm.rb +16 -5
  78. data/lib/faker/games/minecraft.rb +113 -0
  79. data/lib/faker/games/street_fighter.rb +61 -0
  80. data/lib/faker/games/super_mario.rb +48 -0
  81. data/lib/faker/games/touhou.rb +75 -0
  82. data/lib/faker/games/warhammer_fantasy.rb +74 -0
  83. data/lib/faker/games/world_of_warcraft.rb +26 -1
  84. data/lib/faker/japanese_media/conan.rb +48 -0
  85. data/lib/faker/japanese_media/doraemon.rb +48 -0
  86. data/lib/faker/japanese_media/dragon_ball.rb +26 -0
  87. data/lib/faker/japanese_media/naruto.rb +61 -0
  88. data/lib/faker/japanese_media/studio_ghibli.rb +48 -0
  89. data/lib/faker/movies/departed.rb +49 -0
  90. data/lib/faker/movies/hobbit.rb +4 -4
  91. data/lib/faker/movies/how_to_train_your_dragon.rb +48 -0
  92. data/lib/faker/movies/lord_of_the_rings.rb +3 -3
  93. data/lib/faker/movies/movie.rb +13 -0
  94. data/lib/faker/movies/room.rb +63 -0
  95. data/lib/faker/movies/star_wars.rb +74 -2
  96. data/lib/faker/music/hiphop.rb +48 -0
  97. data/lib/faker/music/opera.rb +237 -1
  98. data/lib/faker/music/pearl_jam.rb +50 -0
  99. data/lib/faker/music/phish.rb +27 -1
  100. data/lib/faker/music/prince.rb +64 -0
  101. data/lib/faker/music/rock_band.rb +12 -0
  102. data/lib/faker/music/rush.rb +37 -0
  103. data/lib/faker/music/show.rb +49 -0
  104. data/lib/faker/quotes/quote.rb +80 -1
  105. data/lib/faker/quotes/rajnikanth.rb +1 -0
  106. data/lib/faker/quotes/shakespeare.rb +70 -0
  107. data/lib/faker/sports/volleyball.rb +74 -0
  108. data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +13 -0
  109. data/lib/faker/tv_shows/big_bang_theory.rb +37 -0
  110. data/lib/faker/tv_shows/buffy.rb +17 -4
  111. data/lib/faker/tv_shows/dr_who.rb +1 -1
  112. data/lib/faker/tv_shows/final_space.rb +51 -0
  113. data/lib/faker/tv_shows/futurama.rb +65 -0
  114. data/lib/faker/tv_shows/simpsons.rb +14 -0
  115. data/lib/faker/tv_shows/suits.rb +37 -0
  116. data/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +17 -4
  117. data/lib/faker/version.rb +1 -1
  118. data/lib/faker.rb +28 -23
  119. data/lib/helpers/base58.rb +1 -1
  120. data/lib/helpers/char.rb +22 -27
  121. data/lib/helpers/unique_generator.rb +0 -2
  122. data/lib/locales/de-AT.yml +4 -2
  123. data/lib/locales/de-CH.yml +1696 -1
  124. data/lib/locales/de.yml +4 -2
  125. data/lib/locales/en/address.yml +2 -0
  126. data/lib/locales/en/adjective.yml +179 -0
  127. data/lib/locales/en/animal.yml +1 -1
  128. data/lib/locales/en/aqua_teen_hunger_force.yml +33 -1
  129. data/lib/locales/en/bank.yml +1 -1
  130. data/lib/locales/en/barcode.yml +24 -0
  131. data/lib/locales/en/big_bang_theory.yml +38 -0
  132. data/lib/locales/en/blood.yml +13 -0
  133. data/lib/locales/en/buffy.yml +1 -1
  134. data/lib/locales/en/camera.yml +611 -0
  135. data/lib/locales/en/clash_of_clan.yml +101 -0
  136. data/lib/locales/en/company.yml +2 -2
  137. data/lib/locales/en/computer.yml +36 -0
  138. data/lib/locales/en/conan.yml +171 -0
  139. data/lib/locales/en/control.yml +247 -0
  140. data/lib/locales/en/demographic.yml +218 -5
  141. data/lib/locales/en/departed.yml +50 -0
  142. data/lib/locales/en/device.yml +112 -4
  143. data/lib/locales/en/dnd.yml +451 -0
  144. data/lib/locales/en/doraemon.yml +286 -0
  145. data/lib/locales/en/dota.yml +531 -63
  146. data/lib/locales/en/dragon_ball.yml +243 -1
  147. data/lib/locales/en/driving_license.yml +181 -0
  148. data/lib/locales/en/drone.yml +95 -0
  149. data/lib/locales/en/dune.yml +401 -131
  150. data/lib/locales/en/educator.yml +6 -0
  151. data/lib/locales/en/elder_scrolls.yml +583 -9
  152. data/lib/locales/en/fallout.yml +311 -133
  153. data/lib/locales/en/final_space.yml +37 -0
  154. data/lib/locales/en/finance.yml +53 -0
  155. data/lib/locales/en/football.yml +3 -3
  156. data/lib/locales/en/fresh_prince_of_bel_air.yml +1 -1
  157. data/lib/locales/en/futurama.yml +344 -0
  158. data/lib/locales/en/half_life.yml +84 -3
  159. data/lib/locales/en/heroes.yml +408 -3
  160. data/lib/locales/en/heroes_of_the_storm.yml +131 -4
  161. data/lib/locales/en/house.yml +1 -1
  162. data/lib/locales/en/how_to_train_your_dragon.yml +174 -0
  163. data/lib/locales/en/jack_handey.yml +54 -0
  164. data/lib/locales/en/league_of_legends.yml +285 -6
  165. data/lib/locales/en/lebowski.yml +1 -1
  166. data/lib/locales/en/military.yml +179 -5
  167. data/lib/locales/en/minecraft.yml +663 -0
  168. data/lib/locales/en/mountain.yml +158 -0
  169. data/lib/locales/en/movie.yml +192 -1
  170. data/lib/locales/en/music.yml +451 -29
  171. data/lib/locales/en/myst.yml +87 -31
  172. data/lib/locales/en/name.yml +5 -4
  173. data/lib/locales/en/naruto.yml +231 -0
  174. data/lib/locales/en/one_piece.yml +2 -2
  175. data/lib/locales/en/opera.yml +168 -0
  176. data/lib/locales/en/overwatch.yml +2650 -2622
  177. data/lib/locales/en/pearl_jam.yml +213 -0
  178. data/lib/locales/en/phish.yml +392 -1
  179. data/lib/locales/en/pokemon.yml +417 -4
  180. data/lib/locales/en/prince.yml +227 -0
  181. data/lib/locales/en/quote.yml +692 -163
  182. data/lib/locales/en/rock_band.yml +1 -0
  183. data/lib/locales/en/room.yml +68 -0
  184. data/lib/locales/en/rush.yml +32 -0
  185. data/lib/locales/en/shakespeare.yml +21 -24
  186. data/lib/locales/en/show.yml +597 -0
  187. data/lib/locales/en/simpsons.yml +668 -0
  188. data/lib/locales/en/source.yml +30 -0
  189. data/lib/locales/en/star_trek.yml +1 -1
  190. data/lib/locales/en/star_wars.yml +568 -220
  191. data/lib/locales/en/street_fighter.yml +1524 -0
  192. data/lib/locales/en/studio_ghibli.yml +107 -0
  193. data/lib/locales/en/suits.yml +45 -0
  194. data/lib/locales/en/super_mario.yml +58 -0
  195. data/lib/locales/en/super_smash_bros.yml +18 -4
  196. data/lib/locales/en/tolkien.yml +2453 -0
  197. data/lib/locales/en/touhou.yml +839 -0
  198. data/lib/locales/en/volleyball.yml +501 -0
  199. data/lib/locales/en/warhammer_fantasy.yml +582 -0
  200. data/lib/locales/en/witcher.yml +389 -7
  201. data/lib/locales/en/world_of_warcraft.yml +122 -4
  202. data/lib/locales/en/zelda.yml +962 -4
  203. data/lib/locales/en-AU.yml +50 -10
  204. data/lib/locales/en-CA.yml +2 -0
  205. data/lib/locales/en-GB.yml +1 -1
  206. data/lib/locales/en-IND.yml +2 -1
  207. data/lib/locales/en-MS.yml +2 -1
  208. data/lib/locales/en-NEP.yml +4 -1
  209. data/lib/locales/en-NZ.yml +3 -1
  210. data/lib/locales/en-PAK.yml +2 -1
  211. data/lib/locales/en-SG.yml +2 -1
  212. data/lib/locales/en-US.yml +36 -10
  213. data/lib/locales/en-au-ocker.yml +2 -1
  214. data/lib/locales/en.yml +0 -3
  215. data/lib/locales/es-AR.yml +4603 -0
  216. data/lib/locales/es.yml +56 -0
  217. data/lib/locales/fi-FI.yml +1 -1
  218. data/lib/locales/fr-CA.yml +21 -5
  219. data/lib/locales/fr-CH.yml +2 -2
  220. data/lib/locales/fr.yml +12 -6
  221. data/lib/locales/id.yml +3 -1
  222. data/lib/locales/it.yml +2 -1
  223. data/lib/locales/ja.yml +18 -1
  224. data/lib/locales/ko.yml +94 -2
  225. data/lib/locales/nb-NO.yml +4 -2
  226. data/lib/locales/pt-BR.yml +2 -1
  227. data/lib/locales/pt.yml +3 -1
  228. data/lib/locales/ru.yml +3 -1
  229. data/lib/locales/sk.yml +4 -2
  230. data/lib/locales/uk.yml +2 -0
  231. metadata +90 -23
  232. data/lib/locales/en/hobbit.yml +0 -19
  233. data/lib/locales/en/lord_of_the_rings.yml +0 -6
@@ -3,14 +3,38 @@
3
3
  module Faker
4
4
  class Hipster < Base
5
5
  class << self
6
+ ##
7
+ # Produces a random hipster word.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::Hipster.word #=> "irony"
13
+ #
14
+ # @faker.version 1.6.0
6
15
  def word
7
16
  random_word = sample(translate('faker.hipster.words'))
8
17
  random_word =~ /\s/ ? word : random_word
9
18
  end
10
19
 
11
20
  # rubocop:disable Metrics/ParameterLists
21
+
22
+ ##
23
+ # Produces a random hipster word.
24
+ #
25
+ # @param number [Integer] Specifies the number of words returned
26
+ # @param supplemental [Boolean] Specifies if the words are supplemental
27
+ # @param spaces_allowed [Boolean] Specifies if the words may contain spaces
28
+ # @return [Array<String>]
29
+ #
30
+ # @example
31
+ # Faker::Hipster.words #=> ["pug", "pitchfork", "chia"]
32
+ # Faker::Hipster.words(number: 4) #=> ["ugh", "cardigan", "poutine", "stumptown"]
33
+ # Faker::Hipster.words(number: 4, supplemental: true) #=> ["iste", "seitan", "normcore", "provident"]
34
+ # Faker::Hipster.words(number: 4, supplemental: true, spaces_allowed: true) #=> ["qui", "magni", "craft beer", "est"]
35
+ #
36
+ # @faker.version 1.6.0
12
37
  def words(legacy_number = NOT_GIVEN, legacy_supplemental = NOT_GIVEN, legacy_spaces_allowed = NOT_GIVEN, number: 3, supplemental: false, spaces_allowed: false)
13
- # rubocop:enable Metrics/ParameterLists
14
38
  warn_for_deprecated_arguments do |keywords|
15
39
  keywords << :number if legacy_number != NOT_GIVEN
16
40
  keywords << :supplemental if legacy_supplemental != NOT_GIVEN
@@ -30,18 +54,49 @@ module Faker
30
54
  words.each_with_index { |w, i| words[i] = word if w =~ /\s/ }
31
55
  end
32
56
 
33
- # rubocop:disable Metrics/ParameterLists
34
- def sentence(legacy_word_count = NOT_GIVEN, legacy_supplemental = NOT_GIVEN, legacy_random_words_to_add = NOT_GIVEN, word_count: 4, supplemental: false, random_words_to_add: 6)
35
- # rubocop:enable Metrics/ParameterLists
57
+ ##
58
+ # Produces a random hipster sentence.
59
+ #
60
+ # @param word_count [Integer] Specifies the number of words in the sentence
61
+ # @param supplemental [Boolean] Specifies if the words are supplemental
62
+ # @param random_words_to_add [Integer] Specifies the number of random words to add
63
+ # @param open_compounds_allowed [Boolean] Specifies if the generated sentence can contain words having additional spaces
64
+ # @return [String]
65
+ #
66
+ # @example
67
+ # Faker::Hipster.sentence #=> "Park iphone leggings put a bird on it."
68
+ # Faker::Hipster.sentence(word_count: 3) #=> "Pour-over swag godard."
69
+ # Faker::Hipster.sentence(word_count: 3, supplemental: true) #=> "Beard laboriosam sequi celiac."
70
+ # Faker::Hipster.sentence(word_count: 3, supplemental: false, random_words_to_add: 4) #=> "Bitters retro mustache aesthetic biodiesel 8-bit."
71
+ # Faker::Hipster.sentence(word_count: 3, supplemental: true, random_words_to_add: 4) #=> "Occaecati deleniti messenger bag meh crucifix autem."
72
+ # Faker::Hipster.sentence(word_count: 3, supplemental: true, random_words_to_add: 0, open_compounds_allowed: true) #=> "Kale chips nihil eos."
73
+ # Faker::Hipster.sentence(word_count: 3, supplemental: true, random_words_to_add: 0, open_compounds_allowed: false) #=> "Dreamcatcher umami fixie."
74
+ #
75
+ # @faker.version 1.6.0
76
+ def sentence(legacy_word_count = NOT_GIVEN, legacy_supplemental = NOT_GIVEN, legacy_random_words_to_add = NOT_GIVEN, word_count: 4, supplemental: false, random_words_to_add: 6, open_compounds_allowed: true)
36
77
  warn_for_deprecated_arguments do |keywords|
37
78
  keywords << :word_count if legacy_word_count != NOT_GIVEN
38
79
  keywords << :supplemental if legacy_supplemental != NOT_GIVEN
39
80
  keywords << :random_words_to_add if legacy_random_words_to_add != NOT_GIVEN
40
81
  end
41
82
 
42
- words(number: word_count + rand(random_words_to_add.to_i).to_i, supplemental: supplemental, spaces_allowed: true).join(' ').capitalize + '.'
83
+ "#{words(number: word_count + rand(random_words_to_add.to_i).to_i, supplemental: supplemental, spaces_allowed: open_compounds_allowed).join(' ').capitalize}."
43
84
  end
44
-
85
+ # rubocop:enable Metrics/ParameterLists
86
+
87
+ ##
88
+ # Produces random hipster sentences.
89
+ #
90
+ # @param number [Integer] Specifies the number of sentences returned
91
+ # @param supplemental [Boolean] Specifies if the words are supplemental
92
+ # @return [Array<String>]
93
+ #
94
+ # @example
95
+ # Faker::Hipster.sentences #=> ["Godard pitchfork vinegar chillwave everyday 90's whatever.", "Pour-over artisan distillery street waistcoat.", "Salvia yr leggings franzen blue bottle."]
96
+ # Faker::Hipster.sentences(number: 1) #=> ["Before they sold out pinterest venmo umami try-hard ugh hoodie artisan."]
97
+ # Faker::Hipster.sentences(number: 1, supplemental: true) #=> ["Et sustainable optio aesthetic et."]
98
+ #
99
+ # @faker.version 1.6.0
45
100
  def sentences(legacy_number = NOT_GIVEN, legacy_supplemental = NOT_GIVEN, number: 3, supplemental: false)
46
101
  warn_for_deprecated_arguments do |keywords|
47
102
  keywords << :number if legacy_number != NOT_GIVEN
@@ -56,8 +111,24 @@ module Faker
56
111
  end
57
112
 
58
113
  # rubocop:disable Metrics/ParameterLists
114
+
115
+ ##
116
+ # Produces a random hipster paragraph.
117
+ #
118
+ # @param sentence_count [Integer] Specifies the number of sentences in the paragraph
119
+ # @param supplemental [Boolean] Specifies if the words are supplemental
120
+ # @param random_sentences_to_add [Boolean] Specifies the number of random sentences to add
121
+ # @return [String]
122
+ #
123
+ # @example
124
+ # Faker::Hipster.paragraph #=> "Migas fingerstache pbr&b tofu. Polaroid distillery typewriter echo tofu actually. Slow-carb fanny pack pickled direct trade scenester mlkshk plaid. Banjo venmo chambray cold-pressed typewriter. Fap skateboard intelligentsia."
125
+ # Faker::Hipster.paragraph(sentence_count: 2) #=> "Yolo tilde farm-to-table hashtag. Lomo kitsch disrupt forage +1."
126
+ # Faker::Hipster.paragraph(sentence_count: 2, supplemental: true) #=> "Typewriter iste ut viral kombucha voluptatem. Sint voluptates saepe. Direct trade irony chia excepturi yuccie. Biodiesel esse listicle et quam suscipit."
127
+ # Faker::Hipster.paragraph(sentence_count: 2, supplemental: false, random_sentences_to_add: 4) #=> "Selvage vhs chartreuse narwhal vinegar. Authentic vinyl truffaut carry vhs pop-up. Hammock everyday iphone locavore thundercats bitters vegan goth. Fashion axe banh mi shoreditch whatever artisan."
128
+ # Faker::Hipster.paragraph(sentence_count: 2, supplemental: true, random_sentences_to_add: 4) #=> "Deep v gluten-free unde waistcoat aperiam migas voluptas dolorum. Aut drinking illo sustainable sapiente. Direct trade fanny pack kale chips ennui semiotics."
129
+ #
130
+ # @faker.version 1.6.0
59
131
  def paragraph(legacy_sentence_count = NOT_GIVEN, legacy_supplemental = NOT_GIVEN, legacy_random_sentences_to_add = NOT_GIVEN, sentence_count: 3, supplemental: false, random_sentences_to_add: 3)
60
- # rubocop:enable Metrics/ParameterLists
61
132
  warn_for_deprecated_arguments do |keywords|
62
133
  keywords << :sentence_count if legacy_sentence_count != NOT_GIVEN
63
134
  keywords << :supplemental if legacy_supplemental != NOT_GIVEN
@@ -66,7 +137,21 @@ module Faker
66
137
 
67
138
  sentences(number: resolve(sentence_count) + rand(random_sentences_to_add.to_i).to_i, supplemental: supplemental).join(' ')
68
139
  end
69
-
140
+ # rubocop:enable Metrics/ParameterLists
141
+
142
+ ##
143
+ # Produces random hipster paragraphs.
144
+ #
145
+ # @param number [Integer] Specifies the number of paragraphs
146
+ # @param supplemental [Boolean] Specifies if the words are supplemental
147
+ # @return [Array<String>]
148
+ #
149
+ # @example
150
+ # Faker::Hipster.paragraphs #=> ["Tilde microdosing blog cliche meggings. Intelligentsia five dollar toast forage yuccie. Master kitsch knausgaard. Try-hard everyday trust fund mumblecore.", "Normcore viral pickled. Listicle humblebrag swag tote bag. Taxidermy street hammock neutra butcher cred kale chips. Blog portland humblebrag trust fund irony.", "Single-origin coffee fixie cleanse tofu xoxo. Post-ironic tote bag ramps gluten-free locavore mumblecore hammock. Umami loko twee. Ugh kitsch before they sold out."]
151
+ # Faker::Hipster.paragraphs(number: 1) #=> ["Skateboard cronut synth +1 fashion axe. Pop-up polaroid skateboard asymmetrical. Ennui fingerstache shoreditch before they sold out. Tattooed pitchfork ramps. Photo booth yr messenger bag raw denim bespoke locavore lomo synth."]
152
+ # Faker::Hipster.paragraphs(number: 1, supplemental: true) #=> ["Quae direct trade pbr&b quo taxidermy autem loko. Umami quas ratione migas cardigan sriracha minima. Tenetur perspiciatis pickled sed eum doloribus truffaut. Excepturi dreamcatcher meditation."]
153
+ #
154
+ # @faker.version 1.6.0
70
155
  def paragraphs(legacy_number = NOT_GIVEN, legacy_supplemental = NOT_GIVEN, number: 3, supplemental: false)
71
156
  warn_for_deprecated_arguments do |keywords|
72
157
  keywords << :number if legacy_number != NOT_GIVEN
@@ -80,6 +165,18 @@ module Faker
80
165
  end
81
166
  end
82
167
 
168
+ ##
169
+ # Produces a random hipster paragraph by characters.
170
+ #
171
+ # @param characters [Integer] Specifies the number of characters in the paragraph
172
+ # @param supplemental [Boolean] Specifies if the words are supplemental
173
+ # @return [String]
174
+ #
175
+ # @example
176
+ # Faker::Hipster.paragraph_by_chars #=> "Truffaut stumptown trust fund 8-bit messenger bag portland. Meh kombucha selvage swag biodiesel. Lomo kinfolk jean shorts asymmetrical diy. Wayfarers portland twee stumptown. Wes anderson biodiesel retro 90's pabst. Diy echo 90's mixtape semiotics. Cornho."
177
+ # Faker::Hipster.paragraph_by_chars(characters: 256, supplemental: false) #=> "Hella kogi blog narwhal sartorial selfies mustache schlitz. Bespoke normcore kitsch cred hella fixie. Park aesthetic fixie migas twee. Cliche mustache brunch tumblr fixie godard. Drinking pop-up synth hoodie dreamcatcher typewriter. Kitsch biodiesel green."
178
+ #
179
+ # @faker.version 1.6.0
83
180
  def paragraph_by_chars(legacy_characters = NOT_GIVEN, legacy_supplemental = NOT_GIVEN, characters: 256, supplemental: false)
84
181
  warn_for_deprecated_arguments do |keywords|
85
182
  keywords << :characters if legacy_characters != NOT_GIVEN
@@ -88,9 +185,9 @@ module Faker
88
185
 
89
186
  paragraph = paragraph(sentence_count: 3, supplemental: supplemental)
90
187
 
91
- paragraph += ' ' + paragraph(sentence_count: 3, supplemental: supplemental) while paragraph.length < characters
188
+ paragraph += " #{paragraph(sentence_count: 3, supplemental: supplemental)}" while paragraph.length < characters
92
189
 
93
- paragraph[0...characters - 1] + '.'
190
+ "#{paragraph[0...characters - 1]}."
94
191
  end
95
192
  end
96
193
  end
@@ -19,10 +19,28 @@ module Faker
19
19
  CHILEAN_MODULO = 11
20
20
 
21
21
  class << self
22
+ ##
23
+ # Produces a random valid US Social Security number.
24
+ #
25
+ # @return [String]
26
+ #
27
+ # @example
28
+ # Faker::IDNumber.valid #=> "552-56-3593"
29
+ #
30
+ # @faker.version 1.6.0
22
31
  def valid
23
32
  _translate('valid')
24
33
  end
25
34
 
35
+ ##
36
+ # Produces a random invalid US Social Security number.
37
+ #
38
+ # @return [String]
39
+ #
40
+ # @example
41
+ # Faker::IDNumber.invalid #=> "311-72-0000"
42
+ #
43
+ # @faker.version 1.6.0
26
44
  def invalid
27
45
  _translate('invalid')
28
46
  end
@@ -33,6 +51,15 @@ module Faker
33
51
  INVALID_SSN.any? { |regex| regex =~ ssn } ? ssn_valid : ssn
34
52
  end
35
53
 
54
+ ##
55
+ # Produces a random Spanish citizen identifier (DNI).
56
+ #
57
+ # @return [String]
58
+ #
59
+ # @example
60
+ # Faker::IDNumber.spanish_citizen_number #=> "53290236-H"
61
+ #
62
+ # @faker.version 1.9.0
36
63
  def spanish_citizen_number
37
64
  num = Faker::Number.number(digits: 8)
38
65
  mod = num.to_i % 23
@@ -40,6 +67,15 @@ module Faker
40
67
  "#{num}-#{check}"
41
68
  end
42
69
 
70
+ ##
71
+ # Produces a random Spanish foreign born citizen identifier (NIE).
72
+ #
73
+ # @return [String]
74
+ #
75
+ # @example
76
+ # Faker::IDNumber.spanish_foreign_citizen_number #=> "Z-1600870-Y"
77
+ #
78
+ # @faker.version 1.9.0
43
79
  def spanish_foreign_citizen_number
44
80
  code = 'XYZ'
45
81
  digits = Faker::Number.number(digits: 7)
@@ -50,6 +86,16 @@ module Faker
50
86
  "#{prefix}-#{digits}-#{check}"
51
87
  end
52
88
 
89
+ ##
90
+ # Produces a random valid South African ID Number.
91
+ #
92
+ # @return [String]
93
+ #
94
+ # @example
95
+ # Faker::IDNumber.south_african_id_number #=> "8105128870184"
96
+ # Faker::IDNumber.valid_south_african_id_number #=> "8105128870184"
97
+ #
98
+ # @faker.version 1.9.2
53
99
  def valid_south_african_id_number
54
100
  id_number = [
55
101
  Faker::Date.birthday.strftime('%y%m%d'),
@@ -63,6 +109,15 @@ module Faker
63
109
 
64
110
  alias south_african_id_number valid_south_african_id_number
65
111
 
112
+ ##
113
+ # Produces a random invalid South African ID Number.
114
+ #
115
+ # @return [String]
116
+ #
117
+ # @example
118
+ # Faker::IDNumber.invalid_south_african_id_number #=> "1642972065088"
119
+ #
120
+ # @faker.version 1.9.2
66
121
  def invalid_south_african_id_number
67
122
  invalid_date_of_birth = [
68
123
  Faker::Number.number(digits: 2),
@@ -80,6 +135,17 @@ module Faker
80
135
  [id_number, south_african_id_checksum_digit(id_number)].join
81
136
  end
82
137
 
138
+ ##
139
+ # Produces a random Brazilian Citizen Number (CPF).
140
+ #
141
+ # @param formatted [Boolean] Specifies if the number is formatted with dividers.
142
+ # @return [String]
143
+ #
144
+ # @example
145
+ # Faker::IDNumber.brazilian_citizen_number #=> "53540542221"
146
+ # Faker::IDNumber.brazilian_citizen_number(formatted: true) #=> "535.405.422-21"
147
+ #
148
+ # @faker.version 1.9.2
83
149
  def brazilian_citizen_number(legacy_formatted = NOT_GIVEN, formatted: false)
84
150
  warn_for_deprecated_arguments do |keywords|
85
151
  keywords << :formatted if legacy_formatted != NOT_GIVEN
@@ -94,6 +160,17 @@ module Faker
94
160
 
95
161
  alias brazilian_cpf brazilian_citizen_number
96
162
 
163
+ ##
164
+ # Produces a random Brazilian ID Number (RG).
165
+ #
166
+ # @param formatted [Boolean] Specifies if the number is formatted with dividers.
167
+ # @return [String]
168
+ #
169
+ # @example
170
+ # Faker::IDNumber.brazilian_id #=> "493054029"
171
+ # Faker::IDNumber.brazilian_id(formatted: true) #=> "49.305.402-9"
172
+ #
173
+ # @faker.version 2.1.2
97
174
  def brazilian_id(legacy_formatted = NOT_GIVEN, formatted: false)
98
175
  warn_for_deprecated_arguments do |keywords|
99
176
  keywords << :formatted if legacy_formatted != NOT_GIVEN
@@ -107,11 +184,20 @@ module Faker
107
184
 
108
185
  alias brazilian_rg brazilian_id
109
186
 
187
+ ##
188
+ # Produces a random Chilean ID (Rut with 8 digits).
189
+ #
190
+ # @return [String]
191
+ #
192
+ # @example
193
+ # Faker::IDNumber.chilean_id #=> "15620613-K"
194
+ #
195
+ # @faker.version 2.1.2
110
196
  def chilean_id
111
197
  digits = Faker::Number.number(digits: 8)
112
198
  verification_code = chilean_verification_code(digits)
113
199
 
114
- digits.to_s + '-' + verification_code.to_s
200
+ "#{digits}-#{verification_code}"
115
201
  end
116
202
 
117
203
  private
@@ -170,7 +256,7 @@ module Faker
170
256
  end * 10
171
257
  end
172
258
 
173
- def brazilian_document_digit(checksum, id = false)
259
+ def brazilian_document_digit(checksum, id: false)
174
260
  remainder = checksum % 11
175
261
  id ? brazilian_id_digit(remainder) : brazilian_citizen_number_digit(remainder)
176
262
  end