faker 2.2.2 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +0 -1
  4. data/lib/faker/blockchain/bitcoin.rb +26 -0
  5. data/lib/faker/blockchain/ethereum.rb +10 -0
  6. data/lib/faker/blockchain/tezos.rb +56 -0
  7. data/lib/faker/books/book.rb +36 -0
  8. data/lib/faker/books/culture_series.rb +49 -0
  9. data/lib/faker/books/dune.rb +56 -3
  10. data/lib/faker/books/lovecraft.rb +172 -0
  11. data/lib/faker/creature/animal.rb +9 -0
  12. data/lib/faker/creature/cat.rb +27 -0
  13. data/lib/faker/creature/dog.rb +72 -0
  14. data/lib/faker/creature/horse.rb +18 -0
  15. data/lib/faker/default/alphanumeric.rb +23 -6
  16. data/lib/faker/default/app.rb +45 -0
  17. data/lib/faker/default/artist.rb +9 -0
  18. data/lib/faker/default/avatar.rb +31 -0
  19. data/lib/faker/default/boolean.rb +12 -1
  20. data/lib/faker/default/gender.rb +18 -0
  21. data/lib/faker/default/hacker.rb +59 -1
  22. data/lib/faker/default/house.rb +18 -0
  23. data/lib/faker/default/internet.rb +15 -10
  24. data/lib/faker/default/lorem.rb +8 -7
  25. data/lib/faker/default/omniauth.rb +42 -0
  26. data/lib/faker/default/programming_language.rb +18 -0
  27. data/lib/faker/default/source.rb +43 -2
  28. data/lib/faker/games/elder_scrolls.rb +72 -0
  29. data/lib/faker/games/fallout.rb +37 -0
  30. data/lib/faker/games/game.rb +27 -0
  31. data/lib/faker/games/half_life.rb +27 -0
  32. data/lib/faker/games/overwatch.rb +27 -0
  33. data/lib/faker/games/super_smash_bros.rb +18 -0
  34. data/lib/faker/games/zelda.rb +36 -0
  35. data/lib/faker/tv_shows/breaking_bad.rb +18 -0
  36. data/lib/faker/version.rb +1 -1
  37. data/lib/locales/en-CA.yml +1 -1
  38. data/lib/locales/ja.yml +1 -1
  39. metadata +19 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c140b70507d530616f9c4ab8253cde32bab8bd7489eec025ebc3e0d81027e0be
4
- data.tar.gz: b752dafd7f9a6816b811e7b886b0097389fb12f2bb4ff714babcab5215c1528b
3
+ metadata.gz: 8bec55e97c49aba2834c60f979ddfbbba32d561b6300640059e10b74f4f64a11
4
+ data.tar.gz: 60197e5cfab12ef29607bfb817a86fb14db6757d3868afbc5dd2a2751412e070
5
5
  SHA512:
6
- metadata.gz: 01f9d799d52e5b502b21ba569a046f078c45d59e8f0c82e09fa5f79b13bcbf0633a2150d2017623c6ad50256536e94273fc30b59c1835fca639ca4772cf85839
7
- data.tar.gz: 4f0fc396d99449791e7edf1ff9013842617e6ecd4c8d153574a773b81041801750c02fb3974c6e05cdfc4429c26bc54528e00a509fa0b8dfd3d788fc5ff0e335
6
+ metadata.gz: 6163f75344392f843e01d14ff8ddb484c40ad7b8b055a1e7a3be1cfebb972b5e5244ac4f61b424862d997bee39c4d3b61d1b605aebad6f6534e771acb32ca380
7
+ data.tar.gz: 93310c967dc3daa9a664d456978a636b7bc01122fbbe4a1c565206db401bfcdadee214d01c0e4b2b22be4c001cdf255de5f46762df2cb16d9f4e5fcb2c006418
@@ -1,5 +1,24 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.3.0](https://github.com/faker-ruby/faker/tree/v2.3.0) (2019-12-09)
4
+
5
+ ## Documentation
6
+
7
+ - [PR #1741](https://github.com/faker-ruby/faker/pull/1741) Fix the .gitignore for YARD. [@connorshea](https://github.com/connorshea)
8
+ - [PR #1553](https://github.com/faker-ruby/faker/pull/1553) Yard powered docs [@Zeragamba](https://github.com/Zeragamba) [@connorshea](https://github.com/connorshea)
9
+ - [PR #1727](https://github.com/faker-ruby/faker/pull/1727) Remove Football documentation from wrong category [@lucasqueiroz](https://github.com/lucasqueiroz)
10
+
11
+ ## Feature Request
12
+
13
+ - [PR #1738](https://github.com/faker-ruby/faker/pull/1738) Add mock data for Apple OAuth [@dzunk](https://github.com/dzunk)
14
+
15
+ ## Update locales
16
+
17
+ - [PR #1732](https://github.com/faker-ruby/faker/pull/1732) Add pokemon name in Johto area [@mathieujobin](https://github.com/mathieujobin)
18
+ - [PR #1723](https://github.com/faker-ruby/faker/pull/1723) Quebec province postal codes starts by [GHJ], adding missing two [@Ryutooooo](https://github.com/Ryutooooo)
19
+
20
+ ------------------------------------------------------------------------------
21
+
3
22
  ## [v2.2.2](https://github.com/faker-ruby/faker/tree/v2.2.2) (2019-05-09)
4
23
 
5
24
  ## Bug/Fixes
data/README.md CHANGED
@@ -161,7 +161,6 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
161
161
  - [Faker::Fillmurray](doc/default/fillmurray.md)
162
162
  - [Faker::Finance](doc/default/finance.md)
163
163
  - [Faker::Food](doc/default/food.md)
164
- - [Faker::Football](doc/default/football.md)
165
164
  - [Faker::FunnyName](doc/default/funny_name.md)
166
165
  - [Faker::Gender](doc/default/gender.md)
167
166
  - [Faker::GreekPhilosophers](doc/default/greek_philosophers.md)
@@ -7,21 +7,47 @@ module Faker
7
7
  class Blockchain
8
8
  class Bitcoin < Base
9
9
  class << self
10
+ # @private
10
11
  PROTOCOL_VERSIONS = {
11
12
  main: 0,
12
13
  testnet: 111
13
14
  }.freeze
14
15
 
16
+ ##
17
+ # Produces a Bitcoin wallet address
18
+ #
19
+ # @return [String]
20
+ #
21
+ # @example
22
+ # Faker::Blockchain::Bitcoin.address
23
+ # #=> "147nDP22h3pHrLt2qykTH4txUwQh1ccaXp"
24
+ #
25
+ # @faker.version 1.9.2
15
26
  def address
16
27
  address_for(:main)
17
28
  end
18
29
 
30
+ ##
31
+ # Produces a Bitcoin testnet address
32
+ #
33
+ # @return [String]
34
+ #
35
+ # @example
36
+ # Faker::Blockchain::Bitcoin.testnet_address
37
+ # #=> "n4YjRyYD6V6zREpk6opqESDqD3KYnMdVEB"
38
+ #
39
+ # @faker.version 1.9.2
19
40
  def testnet_address
20
41
  address_for(:testnet)
21
42
  end
22
43
 
23
44
  protected
24
45
 
46
+ ##
47
+ # Generates a random Bitcoin address for the given network
48
+ #
49
+ # @param network [Symbol] The name of network protocol to generate an address for
50
+ # @return [String] A Bitcoin address
25
51
  def address_for(network)
26
52
  version = PROTOCOL_VERSIONS.fetch(network)
27
53
  packed = version.chr + Faker::Config.random.bytes(20)
@@ -4,6 +4,16 @@ module Faker
4
4
  class Blockchain
5
5
  class Ethereum < Base
6
6
  class << self
7
+ ##
8
+ # Produces a random Ethereum wallet address
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Blockchain::Ethereum.address
14
+ # #=> "0xd392b0c0500700d02d27ab30805ec80ddd3320ff"
15
+ #
16
+ # @faker.version 1.9.1
7
17
  def address
8
18
  hex_alphabet = '0123456789abcdef'
9
19
  var = +'0x'
@@ -7,6 +7,7 @@ module Faker
7
7
  class Blockchain
8
8
  class Tezos < Base
9
9
  class << self
10
+ # @private
10
11
  PREFIXES = {
11
12
  tz1: [6, 161, 159],
12
13
  KT1: [2, 90, 121],
@@ -17,28 +18,83 @@ module Faker
17
18
  o: [5, 116]
18
19
  }.freeze
19
20
 
21
+ ##
22
+ # Produces a random Tezos account address
23
+ #
24
+ # @return [String]
25
+ #
26
+ # @example
27
+ # Faker::Blockchain::Tezos.account
28
+ # #=> "tz1eUsgK6aj752Fbxwk5sAoEFvSDnPjZ4qvk"
29
+ #
30
+ # @faker.version 1.9.2
20
31
  def account
21
32
  encode_tz(:tz1, 20)
22
33
  end
23
34
 
35
+ ##
36
+ # Produces a random Tezos contract
37
+ #
38
+ # @return [String]
39
+ #
40
+ # @example
41
+ # Faker::Blockchain::Tezos.contract
42
+ # #=> "KT1MroqeP15nnitB4CnNfkqHYa2NErhPPLWF"
43
+ #
44
+ # @faker.version 1.9.2
24
45
  def contract
25
46
  encode_tz(:KT1, 20)
26
47
  end
27
48
 
49
+ ##
50
+ # Produces a random Tezos operation
51
+ #
52
+ # @return [String]
53
+ #
54
+ # @example
55
+ # Faker::Blockchain::Tezos.operation
56
+ # #=> "onygWYXJX3xNstFLv9PcCrhQdCkENC795xwSinmTEc1jsDN4VDa"
57
+ #
58
+ # @faker.version 1.9.2
28
59
  def operation
29
60
  encode_tz(:o, 32)
30
61
  end
31
62
 
63
+ ##
64
+ # Produces a random Tezos block
65
+ #
66
+ # @return [String]
67
+ #
68
+ # @example
69
+ # Faker::Blockchain::Tezos.block
70
+ # #=> "BMbhs2rkY1dvAkAyRytvPsjFQ2RiPrBhYkxvWpY65dzkdSuw58a"
71
+ #
72
+ # @faker.version 1.9.4
32
73
  def block
33
74
  encode_tz(:B, 32)
34
75
  end
35
76
 
77
+ ##
78
+ # Produces a random Tezos signature
79
+ #
80
+ # @return [String]
81
+ #
82
+ # @example
83
+ # Faker::Blockchain::Tezos.signature
84
+ # #=> "edsigu165B7VFf3Dpw2QABVzEtCxJY2gsNBNcE3Ti7rRxtDUjqTFRpg67EdAQmY6YWPE5tKJDMnSTJDFu65gic8uLjbW2YwGvAZ"
85
+ #
86
+ # @faker.version 1.9.2
36
87
  def signature
37
88
  encode_tz(:edsig, 64)
38
89
  end
39
90
 
40
91
  protected
41
92
 
93
+ ##
94
+ # @param prefix [Symbol]
95
+ # @param payload_size [Integer] The size of the payload
96
+ #
97
+ # @return [String]
42
98
  def encode_tz(prefix, payload_size)
43
99
  prefix = PREFIXES.fetch(prefix)
44
100
  packed = prefix.map(&:chr).join('') + Faker::Config.random.bytes(payload_size)
@@ -5,18 +5,54 @@ module Faker
5
5
  flexible :book
6
6
 
7
7
  class << self
8
+ ##
9
+ # Produces a random book title
10
+ #
11
+ # @return [String]
12
+ #
13
+ # @example
14
+ # Faker::Book.title #=> "The Odd Sister"
15
+ #
16
+ # @faker.version 1.9.3
8
17
  def title
9
18
  fetch('book.title')
10
19
  end
11
20
 
21
+ ##
22
+ # Produces a random book author
23
+ #
24
+ # @return [String]
25
+ #
26
+ # @example
27
+ # Faker::Book.author #=> "Alysha Olsen"
28
+ #
29
+ # @faker.version 1.9.3
12
30
  def author
13
31
  parse('book.author')
14
32
  end
15
33
 
34
+ ##
35
+ # Produces a random book publisher
36
+ #
37
+ # @return [String]
38
+ #
39
+ # @example
40
+ # Faker::Book.publisher #=> "Opus Reader"
41
+ #
42
+ # @faker.version 1.9.3
16
43
  def publisher
17
44
  fetch('book.publisher')
18
45
  end
19
46
 
47
+ ##
48
+ # Produces a random genre
49
+ #
50
+ # @return [String]
51
+ #
52
+ # @example
53
+ # Faker::Book.genre #=> "Mystery"
54
+ #
55
+ # @faker.version 1.9.3
20
56
  def genre
21
57
  fetch('book.genre')
22
58
  end
@@ -4,27 +4,76 @@ module Faker
4
4
  class Books
5
5
  class CultureSeries < Base
6
6
  flexible :culture_series
7
+
7
8
  class << self
9
+ ##
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Books::CultureSeries.book
14
+ # #=> "The Player of Games"
15
+ #
16
+ # @faker.version 1.9.3
8
17
  def book
9
18
  fetch('culture_series.books')
10
19
  end
11
20
 
21
+ ##
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::Books::CultureSeries.culture_ship
26
+ # #=> "Fate Amenable To Change"
27
+ #
28
+ # @faker.version 1.9.3
12
29
  def culture_ship
13
30
  fetch('culture_series.culture_ships')
14
31
  end
15
32
 
33
+ ##
34
+ # @return [String]
35
+ #
36
+ # @example
37
+ # Faker::Books::CultureSeries.culture_ship_class
38
+ # #=> "General Systems Vehicle"
39
+ #
40
+ # @faker.version 1.9.3
16
41
  def culture_ship_class
17
42
  fetch('culture_series.culture_ship_classes')
18
43
  end
19
44
 
45
+ ##
46
+ # @return [String]
47
+ #
48
+ # @example
49
+ # Faker::Books::CultureSeries.culture_ship_class_abv
50
+ # #=> "The Odd Sister"
51
+ #
52
+ # @faker.version 1.9.3
20
53
  def culture_ship_class_abv
21
54
  fetch('culture_series.culture_ship_class_abvs')
22
55
  end
23
56
 
57
+ ##
58
+ # @return [String]
59
+ #
60
+ # @example
61
+ # Faker::Books::CultureSeries.civ
62
+ # #=> "Culture"
63
+ #
64
+ # @faker.version 1.9.3
24
65
  def civ
25
66
  fetch('culture_series.civs')
26
67
  end
27
68
 
69
+ ##
70
+ # @return [String]
71
+ #
72
+ # @example
73
+ # Faker::Books::CultureSeries.planet
74
+ # #=> "Xinth"
75
+ #
76
+ # @faker.version 1.9.3
28
77
  def planet
29
78
  fetch('culture_series.planets')
30
79
  end
@@ -2,23 +2,62 @@
2
2
 
3
3
  module Faker
4
4
  class Books
5
+ ##
6
+ # A Faker module beyond your dreams, test data beyond your imagination.
5
7
  class Dune < Base
6
8
  class << self
7
- # QUOTED_CHARACTERS = fetch("dune.quotes")
8
- # SAYING_SOURCES = %w(translate("faker.dune.sources"))
9
-
9
+ ##
10
+ # Produces the name of a character from Dune
11
+ #
12
+ # @return [String]
13
+ #
14
+ # @example
15
+ # Faker::Books::Dune.character #=> "Leto Atreides"
16
+ #
17
+ # @faker.version 1.9.3
10
18
  def character
11
19
  fetch('dune.characters')
12
20
  end
13
21
 
22
+ ##
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Books::Dune.title #=> "Duke"
27
+ #
28
+ # @faker.version 1.9.3
14
29
  def title
15
30
  fetch('dune.titles')
16
31
  end
17
32
 
33
+ ##
34
+ # Produces the name of a planet from Dune
35
+ #
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ # Faker::Books::Dune.planet #=> "Caladan"
40
+ #
41
+ # @faker.version 1.9.3
18
42
  def planet
19
43
  fetch('dune.planets')
20
44
  end
21
45
 
46
+ ##
47
+ # Produces a quote from Dune
48
+ #
49
+ # @param character [String] The name of the character that the quote should be from
50
+ #
51
+ # @return [String]
52
+ #
53
+ # @example
54
+ # Faker::Books::Dune.quote
55
+ # #=> "A dead man, surely, no longer requires that water."
56
+ # @example
57
+ # Faker::Books::Dune.quote(character: "baron_harkonnen")
58
+ # #=> "He who controls the spice, controls the universe!"
59
+ #
60
+ # @faker.version 1.9.3
22
61
  def quote(legacy_character = NOT_GIVEN, character: nil)
23
62
  warn_for_deprecated_arguments do |keywords|
24
63
  keywords << :character if legacy_character != NOT_GIVEN
@@ -40,6 +79,20 @@ module Faker
40
79
  fetch('dune.quotes.' + character)
41
80
  end
42
81
 
82
+ ##
83
+ # Produces a saying from Dune
84
+ #
85
+ # @param source [String]
86
+ #
87
+ # @return [String]
88
+ #
89
+ # @example
90
+ # Faker::Books::Dune.saying #=> "You do not beg the sun for mercy."
91
+ # @example
92
+ # Faker::Books::Dune.saying(source: "fremen")
93
+ # #=> "May thy knife chip and shatter."
94
+ #
95
+ # @faker.version 1.9.3
43
96
  def saying(legacy_source = NOT_GIVEN, source: nil)
44
97
  warn_for_deprecated_arguments do |keywords|
45
98
  keywords << :source if legacy_source != NOT_GIVEN
@@ -4,10 +4,31 @@ module Faker
4
4
  class Books
5
5
  class Lovecraft < Base
6
6
  class << self
7
+ ##
8
+ # Produces the name of a location
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Books::Lovecraft.location #=> "Kingsport"
14
+ #
15
+ # @faker.version 1.9.3
7
16
  def location
8
17
  fetch('lovecraft.location')
9
18
  end
10
19
 
20
+ ##
21
+ # @param number [Integer] The number of times to repeat the chant
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::Books::Lovecraft.fhtagn
26
+ # #=> "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn"
27
+ # @example
28
+ # Faker::Books::Lovecraft.fhtagn(number: 3)
29
+ # #=> "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fht...
30
+ #
31
+ # @faker.version 1.9.3
11
32
  def fhtagn(legacy_number = NOT_GIVEN, number: 1)
12
33
  warn_for_deprecated_arguments do |keywords|
13
34
  keywords << :number if legacy_number != NOT_GIVEN
@@ -16,14 +37,51 @@ module Faker
16
37
  Array.new(number) { fetch('lovecraft.fhtagn') }.join('. ')
17
38
  end
18
39
 
40
+ ##
41
+ # Produces the name of a deity
42
+ #
43
+ # @return [String]
44
+ #
45
+ # @example
46
+ # Faker::Books::Lovecraft.deity #=> "Shub-Niggurath"
47
+ #
48
+ # @faker.version 1.9.3
19
49
  def deity
20
50
  fetch('lovecraft.deity')
21
51
  end
22
52
 
53
+ ##
54
+ # Produces the name of a tome
55
+ #
56
+ # @return [String]
57
+ #
58
+ # @example
59
+ # Faker::Books::Lovecraft.tome #=> "Book of Eibon"
60
+ #
61
+ # @faker.version 1.9.3
23
62
  def tome
24
63
  fetch('lovecraft.tome')
25
64
  end
26
65
 
66
+ ##
67
+ # Produces a random sentence
68
+ #
69
+ # @param word_count [Integer] The number of words to have in the sentence
70
+ # @param random_words_to_add [Integer]
71
+ #
72
+ # @return [String]
73
+ #
74
+ # @example
75
+ # Faker::Books::Lovecraft.sentence
76
+ # #=> "Furtive antiquarian squamous dank cat loathsome amorphous lurk."
77
+ # @example
78
+ # Faker::Books::Lovecraft.sentence(word_count: 3)
79
+ # #=> "Daemoniac antediluvian fainted squamous comprehension gambrel nameless singular."
80
+ # @example
81
+ # Faker::Books::Lovecraft.sentence(word_count: 3, random_words_to_add: 1)
82
+ # #=> "Amorphous indescribable tenebrous."
83
+ #
84
+ # @faker.version 1.9.3
27
85
  def sentence(legacy_word_count = NOT_GIVEN, legacy_random_words_to_add = NOT_GIVEN, word_count: 4, random_words_to_add: 6)
28
86
  warn_for_deprecated_arguments do |keywords|
29
87
  keywords << :word_count if legacy_word_count != NOT_GIVEN
@@ -33,11 +91,49 @@ module Faker
33
91
  words(number: word_count + rand(random_words_to_add.to_i).to_i, spaces_allowed: true).join(' ').capitalize + '.'
34
92
  end
35
93
 
94
+ ##
95
+ # Produces a random word
96
+ #
97
+ # @return [String]
98
+ #
99
+ # @example
100
+ # Faker::Books::Lovecraft.word #=> "furtive"
101
+ #
102
+ # @faker.version 1.9.3
36
103
  def word
37
104
  random_word = sample(translate('faker.lovecraft.words'))
38
105
  random_word =~ /\s/ ? word : random_word
39
106
  end
40
107
 
108
+ ##
109
+ # Produces a array of random words
110
+ #
111
+ # @param number [Integer] Number of words to generate
112
+ # @param spaces_allowed [Boolean] If true, generated words can contain spaces
113
+ #
114
+ # @return [Array<String>]
115
+ #
116
+ # @example
117
+ # Faker::Books::Lovecraft.words
118
+ # #=> [
119
+ # # "manuscript",
120
+ # # "abnormal",
121
+ # # "singular",
122
+ # # ]
123
+ # @example
124
+ # Faker::Books::Lovecraft.words(number: 2)
125
+ # #=> [
126
+ # # "daemoniac",
127
+ # # "cat",
128
+ # # ]
129
+ # @example
130
+ # Faker::Books::Lovecraft.words(number: 2, spaces_allowed: 1)
131
+ # #=> [
132
+ # # "lurk",
133
+ # # "charnel",
134
+ # # ]
135
+ #
136
+ # @faker.version 1.9.3
41
137
  def words(legacy_number = NOT_GIVEN, legacy_spaces_allowed = NOT_GIVEN, number: 3, spaces_allowed: false)
42
138
  warn_for_deprecated_arguments do |keywords|
43
139
  keywords << :number if legacy_number != NOT_GIVEN
@@ -54,6 +150,28 @@ module Faker
54
150
  words.each_with_index { |w, i| words[i] = word if w =~ /\s/ }
55
151
  end
56
152
 
153
+ ##
154
+ # Produces a array of random sentences
155
+ #
156
+ # @param number [Integer] Number of sentences to generate
157
+ #
158
+ # @return [Array<String>]
159
+ #
160
+ # @example
161
+ # Faker::Books::Lovecraft.sentences
162
+ # #=> [
163
+ # # "Nameless loathsome decadent gambrel.",
164
+ # # "Ululate swarthy immemorial cat madness gibbous unmentionable unnamable.",
165
+ # # "Decadent antediluvian non-euclidean tentacles amorphous tenebrous.",
166
+ # # ]
167
+ # @example
168
+ # Faker::Books::Lovecraft.sentences(number: 2)
169
+ # #=> [
170
+ # # "Antediluvian amorphous unmentionable singular accursed squamous immemorial.",
171
+ # # "Gambrel daemoniac gibbous stygian shunned ululate iridescence abnormal.",
172
+ # # ]
173
+ #
174
+ # @faker.version 1.9.3
57
175
  def sentences(legacy_number = NOT_GIVEN, number: 3)
58
176
  warn_for_deprecated_arguments do |keywords|
59
177
  keywords << :number if legacy_number != NOT_GIVEN
@@ -66,6 +184,25 @@ module Faker
66
184
  end
67
185
  end
68
186
 
187
+ ##
188
+ # Produces a random paragraph
189
+ #
190
+ # @param sentence_count [Integer] Number of sentences to generate
191
+ # @param random_sentences_to_add [Integer]
192
+ #
193
+ # @return [String]
194
+ #
195
+ # @example
196
+ # Faker::Books::Lovecraft.paragraph
197
+ # #=> "Squamous nameless daemoniac fungus ululate. Cyclopean stygian decadent loathsome manuscript tenebrous. Foetid abnormal stench. Dank non-euclidean comprehension eldritch. Charnel singular shunned lurk effulgence fungus."
198
+ # @example
199
+ # Faker::Books::Lovecraft.paragraph(sentence_count: 2)
200
+ # #=> "Decadent lurk tenebrous loathsome furtive spectral amorphous gibbous. Gambrel eldritch daemoniac cat madness comprehension stygian effulgence."
201
+ # @example
202
+ # Faker::Books::Lovecraft.paragraph(sentence_count: 1, random_sentences_to_add: 1)
203
+ # #=> "Stench cyclopean fainted antiquarian nameless. Antiquarian ululate tenebrous non-euclidean effulgence."
204
+ #
205
+ # @faker.version 1.9.3
69
206
  def paragraph(legacy_sentence_count = NOT_GIVEN, legacy_random_sentences_to_add = NOT_GIVEN, sentence_count: 3, random_sentences_to_add: 3)
70
207
  warn_for_deprecated_arguments do |keywords|
71
208
  keywords << :sentence_count if legacy_sentence_count != NOT_GIVEN
@@ -75,6 +212,28 @@ module Faker
75
212
  sentences(number: resolve(sentence_count) + rand(random_sentences_to_add.to_i).to_i).join(' ')
76
213
  end
77
214
 
215
+ ##
216
+ # Produces a array of random paragraphs
217
+ #
218
+ # @param number [Integer] Number of paragraphs to generate
219
+ #
220
+ # @return [Array<String>]
221
+ #
222
+ # @example
223
+ # Faker::Books::Lovecraft.paragraphs
224
+ # #=> [
225
+ # # "Noisome daemoniac gibbous abnormal antediluvian. Unutterable fung...
226
+ # # "Non-euclidean immemorial indescribable accursed furtive. Dank unn...
227
+ # # "Charnel antediluvian unnamable cat blasphemous comprehension tene...
228
+ # # ]
229
+ # @example
230
+ # Faker::Books::Lovecraft.paragraphs(number: 2)
231
+ # #=> [
232
+ # # "Hideous amorphous manuscript antediluvian non-euclidean cat eldri...
233
+ # # "Tenebrous unnamable comprehension antediluvian lurk. Lurk spectra...
234
+ # # ]
235
+ #
236
+ # @faker.version 1.9.3
78
237
  def paragraphs(legacy_number = NOT_GIVEN, number: 3)
79
238
  warn_for_deprecated_arguments do |keywords|
80
239
  keywords << :number if legacy_number != NOT_GIVEN
@@ -87,6 +246,19 @@ module Faker
87
246
  end
88
247
  end
89
248
 
249
+ ##
250
+ # @param characters [Integer] Number of characters to generate in the paragraph
251
+ #
252
+ # @return [String]
253
+ #
254
+ # @example
255
+ # Faker::Books::Lovecraft.paragraph_by_chars
256
+ # #=> "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."
257
+ # @example
258
+ # Faker::Books::Lovecraft.paragraph_by_chars(characters: 128)
259
+ # #=> "Effulgence madness noisome. Fungus stygian mortal madness amorphous dank. Decadent noisome hideous effulgence. Tentacles charne."
260
+ #
261
+ # @faker.version 1.9.3
90
262
  def paragraph_by_chars(legacy_characters = NOT_GIVEN, characters: 256)
91
263
  warn_for_deprecated_arguments do |keywords|
92
264
  keywords << :characters if legacy_characters != NOT_GIVEN