cryptozoologist 1.2.0 → 1.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 617e16efb3ef19c2cadea0e7c406f0c16caefa78
4
- data.tar.gz: 1f470c1847c3884bd056a7d7d0f16e19761e7368
3
+ metadata.gz: c406e07cbe2ea34ecca7b367824fe233ecc8e254
4
+ data.tar.gz: 37e5cd8d6e43a75e82fa39a924174ac11f397b2f
5
5
  SHA512:
6
- metadata.gz: b2dcce49319a8f510e39b05779a1fcd82ab93d09b33de4cda6e642bff72799635bfa3509ab3f78517d040a00f3e837da06d91e7d4a206857ad031160e3aa25bc
7
- data.tar.gz: 44ebe7f46dff33009349302398cfc219316a3c9f740ee3270e7d7281fe7ba1a58a5700af6d5790eac5f2abbd2d2b6eedb3f4a24b8bde19e6b386ba7715a1bf89
6
+ metadata.gz: d4c198fa9aac99594ee691175c2192ae2393897af73539da99db96429c55aa97e6571cc660bb57bf326cdf17d6952e5a7482810e884b097873bbfb029d371182
7
+ data.tar.gz: ea651edaf5f0b906ffe16fbc6ac4367bebd78c37dfb5e343a2c017ca2eb53060808da836b2b3f369f5770dbed34dc6a60d69e375b4db7696e97622e8ce86da87
@@ -7,4 +7,9 @@
7
7
 
8
8
  ## 1.2.0
9
9
 
10
- - add `colors` dictionary with `:paint` and `:web` options
10
+ - add `colors` dictionary with `:paint` and `:web` options
11
+
12
+ ## 1.3.0
13
+
14
+ - add `clothing` dictionary
15
+ - add `quantity` dictionary
data/README.md CHANGED
@@ -32,6 +32,8 @@ Right now, this gem doesn't do much of anything except over architect a series o
32
32
 
33
33
  - colors
34
34
  - animals
35
+ - clothing
36
+ - quantity
35
37
 
36
38
  **Configuration options**
37
39
 
@@ -46,21 +48,46 @@ Exclude:
46
48
 
47
49
  **Example**
48
50
 
49
- Cryptozoologist.configurre do |config|
50
- config.exclude = [:common]
51
- end
52
- dictionary = Cryptozoologist::Dictionary.new
53
- animals = dictionary.animals
54
- animals.sample # => "crumple horned snorkack"
51
+ ```ruby
52
+ Cryptozoologist.configure do |config|
53
+ config.exclude = [:common]
54
+ end
55
+
56
+ dictionary = Cryptozoologist::Dictionary.new
57
+ animals = dictionary.animals
58
+ animals.sample # => "crumple horned snorkack"
59
+ ```
55
60
 
56
61
  **Get a random animal**
57
62
 
58
- dictionary = Cryptozoologist::Dictionary.new
59
- animals = dictionary.animals
60
- animals.sample # => "sun bear"
63
+ ```ruby
64
+ dictionary = Cryptozoologist::Dictionary.new
65
+ animals = dictionary.animals
66
+ animals.sample # => "sun bear"
67
+ ```
61
68
 
62
69
  **Get a random color**
63
70
 
64
- dictionary = Cryptozoologist::Dictionary.new
65
- colors = dictionary.colors
66
- colors.sample # => "pink"
71
+ ```ruby
72
+ dictionary = Cryptozoologist::Dictionary.new
73
+ colors = dictionary.colors
74
+ colors.sample # => "pink"
75
+ ```
76
+
77
+ **Get a random measure of quantity**
78
+
79
+ ```ruby
80
+ dictionary = Cryptozoologist::Dictionary.new
81
+ quantity = dictionary.quantity
82
+ quantity.sample # => "limitless"
83
+ ```
84
+
85
+ **Get a random item of clothing**
86
+
87
+ ```ruby
88
+ dictionary = Cryptozoologist::Dictionary.new
89
+ clothing = dictionary.clothing
90
+ clothing.sample # => "suspenders"
91
+ ```
92
+
93
+
@@ -2,8 +2,8 @@ require "cryptozoologist/version"
2
2
  require "cryptozoologist/errors"
3
3
  require "cryptozoologist/configuration"
4
4
 
5
- directory = "#{File.dirname(__FILE__)}/cryptozoologist/dictionaries/*/*.rb"
6
- Dir[directory].each { |file| require file }
5
+ dictionaries = "#{File.dirname(__FILE__)}/cryptozoologist/dictionaries/**/*.rb"
6
+ Dir[dictionaries].each { |file| require file }
7
7
 
8
8
  require "cryptozoologist/dictionary"
9
9
  require "cryptozoologist/dictionaries"
@@ -26,7 +26,7 @@ module Cryptozoologist
26
26
  end
27
27
 
28
28
  protected
29
- def self.dictionaries
29
+ def self.subdictionaries
30
30
  Dictionaries.library
31
31
  end
32
32
  end
@@ -15,7 +15,7 @@ module Cryptozoologist
15
15
  private
16
16
  def valid_exclusions
17
17
  keys = []
18
- Cryptozoologist.dictionaries.each { |key, value| keys += value.keys }
18
+ Cryptozoologist.subdictionaries.each { |key, value| keys += value.keys }
19
19
  keys
20
20
  end
21
21
  end
@@ -6,10 +6,18 @@ module Cryptozoologist
6
6
  create_list(:animals)
7
7
  end
8
8
 
9
+ def clothing
10
+ Clothing.list
11
+ end
12
+
9
13
  def colors
10
14
  create_list(:colors)
11
15
  end
12
16
 
17
+ def quantity
18
+ Quantity.list
19
+ end
20
+
13
21
  def library
14
22
  {
15
23
  animals: {
@@ -0,0 +1,286 @@
1
+ module Cryptozoologist
2
+ module Dictionaries
3
+ module Clothing
4
+ def self.list
5
+ [
6
+ "abaya",
7
+ "anorak",
8
+ "apparel",
9
+ "apron",
10
+ "ascot tie",
11
+ "attire",
12
+ "balaclava",
13
+ "ball gown",
14
+ "bandanna",
15
+ "baseball cap",
16
+ "bathing suit",
17
+ "battledress",
18
+ "beanie",
19
+ "bedclothes",
20
+ "bell bottoms",
21
+ "belt",
22
+ "beret",
23
+ "bermuda shorts",
24
+ "bib",
25
+ "bikini",
26
+ "blazer",
27
+ "bloomers",
28
+ "blouse",
29
+ "boa",
30
+ "bonnet",
31
+ "boot",
32
+ "bow",
33
+ "bow tie",
34
+ "boxer shorts",
35
+ "boxers",
36
+ "bra",
37
+ "bracelet",
38
+ "brassiere",
39
+ "breeches",
40
+ "briefs",
41
+ "buckle",
42
+ "button",
43
+ "button down shirt",
44
+ "caftan",
45
+ "camisole",
46
+ "camouflage",
47
+ "cap",
48
+ "cap and gown",
49
+ "cape",
50
+ "capris",
51
+ "cardigan",
52
+ "chemise",
53
+ "cloak",
54
+ "clogs",
55
+ "clothes",
56
+ "clothing",
57
+ "coat",
58
+ "collar",
59
+ "corset",
60
+ "costume",
61
+ "coveralls",
62
+ "cowboy boots",
63
+ "cowboy hat",
64
+ "cravat",
65
+ "crown",
66
+ "cuff",
67
+ "cuff links",
68
+ "culottes",
69
+ "cummerbund",
70
+ "dashiki",
71
+ "diaper",
72
+ "dinner jacket",
73
+ "dirndl",
74
+ "drawers",
75
+ "dress",
76
+ "dress shirt",
77
+ "duds",
78
+ "dungarees",
79
+ "earmuffs",
80
+ "earrings",
81
+ "elastic",
82
+ "evening gown",
83
+ "fashion",
84
+ "fatigues",
85
+ "fedora",
86
+ "fez",
87
+ "flak jacket",
88
+ "flannel nightgown",
89
+ "flannel shirt",
90
+ "flip flops",
91
+ "formal wear",
92
+ "frock",
93
+ "fur",
94
+ "fur coat",
95
+ "gaiters",
96
+ "galoshes",
97
+ "garb",
98
+ "gabardine",
99
+ "garment",
100
+ "garters",
101
+ "gear",
102
+ "getup",
103
+ "gilet",
104
+ "girdle",
105
+ "glasses",
106
+ "gloves",
107
+ "gown",
108
+ "halter top",
109
+ "handbag",
110
+ "handkerchief",
111
+ "hat",
112
+ "Hawaiian shirt",
113
+ "hazmat suit",
114
+ "headscarf",
115
+ "helmet",
116
+ "hem",
117
+ "high heels",
118
+ "hoodie",
119
+ "hook and eye",
120
+ "hose",
121
+ "hosiery",
122
+ "hospital gown",
123
+ "houndstooth",
124
+ "housecoat",
125
+ "jacket",
126
+ "jeans",
127
+ "jersey",
128
+ "jewelry",
129
+ "jodhpurs",
130
+ "jumper",
131
+ "jumpsuit",
132
+ "kerchief",
133
+ "khakis",
134
+ "kilt",
135
+ "kimono",
136
+ "kit",
137
+ "knickers",
138
+ "lab coat",
139
+ "lapel",
140
+ "leather jacket",
141
+ "leggings",
142
+ "leg warmers",
143
+ "leotard",
144
+ "life jacket",
145
+ "lingerie",
146
+ "loafers",
147
+ "loincloth",
148
+ "longjohns",
149
+ "long underwear",
150
+ "miniskirt",
151
+ "mittens",
152
+ "moccasins",
153
+ "muffler",
154
+ "mumu",
155
+ "neckerchief",
156
+ "necklace",
157
+ "nightgown",
158
+ "nightshirt",
159
+ "onesies",
160
+ "outerwear",
161
+ "outfit",
162
+ "overalls",
163
+ "overcoat",
164
+ "overshirt",
165
+ "pajamas",
166
+ "panama hat",
167
+ "pants",
168
+ "pantsuit",
169
+ "pantyhose",
170
+ "parka",
171
+ "pea coat",
172
+ "peplum",
173
+ "petticoat",
174
+ "pinafore",
175
+ "pleat",
176
+ "pocket",
177
+ "pocketbook",
178
+ "polo shirt",
179
+ "poncho",
180
+ "poodle skirt",
181
+ "porkpie hat",
182
+ "pullover",
183
+ "pumps",
184
+ "purse",
185
+ "raincoat",
186
+ "ring",
187
+ "robe",
188
+ "rugby shirt",
189
+ "sandals",
190
+ "sari",
191
+ "sarong",
192
+ "scarf",
193
+ "school uniform",
194
+ "scrubs",
195
+ "shawl",
196
+ "sheath dress",
197
+ "shift",
198
+ "shirt",
199
+ "shoe",
200
+ "shorts",
201
+ "shoulder pads",
202
+ "shrug",
203
+ "singlet",
204
+ "skirt",
205
+ "slacks",
206
+ "slip",
207
+ "slippers",
208
+ "smock",
209
+ "snaps",
210
+ "sneakers",
211
+ "sock",
212
+ "sombrero",
213
+ "spacesuit",
214
+ "stetson hat",
215
+ "stockings",
216
+ "stole",
217
+ "suit",
218
+ "sunbonnet",
219
+ "sundress",
220
+ "sunglasses",
221
+ "sun hat",
222
+ "suspenders",
223
+ "sweater",
224
+ "sweatpants",
225
+ "sweatshirt",
226
+ "sweatsuit",
227
+ "swimsuit",
228
+ "t shirt",
229
+ "tam",
230
+ "tank top",
231
+ "teddy",
232
+ "threads",
233
+ "tiara",
234
+ "tie",
235
+ "tie clip",
236
+ "tights",
237
+ "toga",
238
+ "togs",
239
+ "top",
240
+ "top coat",
241
+ "top hat",
242
+ "train",
243
+ "trench coat",
244
+ "trunks",
245
+ "turtleneck",
246
+ "tutu",
247
+ "trench coat",
248
+ "trousers",
249
+ "trunks",
250
+ "tube top",
251
+ "tunic",
252
+ "turban",
253
+ "turtleneck shirt",
254
+ "tux",
255
+ "tuxedo",
256
+ "tweed jacket",
257
+ "twill",
258
+ "twin set",
259
+ "umbrella",
260
+ "underclothes",
261
+ "undershirt",
262
+ "underwear",
263
+ "uniform",
264
+ "veil",
265
+ "vest",
266
+ "vestments",
267
+ "visor",
268
+ "waders",
269
+ "waistcoat",
270
+ "wear",
271
+ "wedding gown",
272
+ "wellingtons",
273
+ "wetsuit",
274
+ "white tie",
275
+ "wig",
276
+ "windbreaker",
277
+ "woollens",
278
+ "wrap",
279
+ "yoke",
280
+ "zipper",
281
+ "zoris"
282
+ ]
283
+ end
284
+ end
285
+ end
286
+ end
@@ -0,0 +1,95 @@
1
+ module Cryptozoologist
2
+ module Dictionaries
3
+ module Quantity
4
+ def self.list
5
+ [
6
+ "acres",
7
+ "army",
8
+ "assortment",
9
+ "batch",
10
+ "billions",
11
+ "blizzard",
12
+ "boatload",
13
+ "buckets",
14
+ "bunches",
15
+ "bundles",
16
+ "clusters",
17
+ "collection",
18
+ "congregation",
19
+ "crowds",
20
+ "deluge",
21
+ "dozens",
22
+ "droves",
23
+ "expansive",
24
+ "extensive",
25
+ "flock",
26
+ "gaggle",
27
+ "gargantuan",
28
+ "gathering",
29
+ "gazillions",
30
+ "giant",
31
+ "gigantic",
32
+ "ginormous",
33
+ "great",
34
+ "group",
35
+ "heaps",
36
+ "herd",
37
+ "horde",
38
+ "hundreds",
39
+ "humongous",
40
+ "infinite",
41
+ "jumble",
42
+ "limitless",
43
+ "loads",
44
+ "lots",
45
+ "mammoth",
46
+ "many",
47
+ "mass",
48
+ "masses",
49
+ "mega",
50
+ "miles",
51
+ "millions",
52
+ "mob",
53
+ "mountains",
54
+ "mountainous",
55
+ "multifarious",
56
+ "multitude",
57
+ "multiplicity",
58
+ "numerous",
59
+ "oceans",
60
+ "oodles",
61
+ "overabundance",
62
+ "pack",
63
+ "parcel",
64
+ "piles",
65
+ "plenty",
66
+ "pots",
67
+ "profusion",
68
+ "quantity",
69
+ "reams",
70
+ "sacks",
71
+ "scads",
72
+ "set",
73
+ "several",
74
+ "slew",
75
+ "some",
76
+ "stacks",
77
+ "sundry",
78
+ "swarm",
79
+ "sweeping",
80
+ "thousands",
81
+ "tons",
82
+ "throng",
83
+ "towering",
84
+ "tremendous",
85
+ "troop",
86
+ "umpteen",
87
+ "volumes",
88
+ "wide",
89
+ "yards",
90
+ "zillions"
91
+ ]
92
+ end
93
+ end
94
+ end
95
+ end
@@ -1,3 +1,3 @@
1
1
  module Cryptozoologist
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -1,6 +1,24 @@
1
1
  require_relative '../spec_helper'
2
2
 
3
3
  describe Cryptozoologist::Dictionaries do
4
+ subdictionaries = {
5
+ "animals": {
6
+ subtypes: [:common, :mythical],
7
+ common: Cryptozoologist::Dictionaries::Animals::Common,
8
+ mythical: Cryptozoologist::Dictionaries::Animals::Mythical
9
+ },
10
+ "colors": {
11
+ subtypes: [:paint, :web],
12
+ paint: Cryptozoologist::Dictionaries::Colors::Paint,
13
+ web: Cryptozoologist::Dictionaries::Colors::WebSafe
14
+ }
15
+ }
16
+
17
+ dictionaries = {
18
+ "clothing": Cryptozoologist::Dictionaries::Clothing,
19
+ "quantity": Cryptozoologist::Dictionaries::Quantity
20
+ }
21
+
4
22
  context '#libraries' do
5
23
  it 'contains animals' do
6
24
  keys = Cryptozoologist::Dictionaries.library[:animals].keys
@@ -13,63 +31,64 @@ describe Cryptozoologist::Dictionaries do
13
31
  end
14
32
  end
15
33
 
16
- context '#animals' do
17
- it 'has a word list' do
18
- expect(Cryptozoologist::Dictionaries.animals.length).to be > 1
19
- end
34
+ subdictionaries.each do |type, subdictionary|
35
+ context "##{type}" do
36
+ it 'has a word list' do
37
+ expect(Cryptozoologist::Dictionaries.send(type.to_sym).length).to be > 1
38
+ end
20
39
 
21
- it 'contains Common animals' do
22
- common = Cryptozoologist::Dictionaries::Animals::Common.list
23
- expect(Cryptozoologist::Dictionaries.animals.include?(common.sample)).to be true
24
- end
40
+ subdictionary[:subtypes].each do |subtype|
41
+ it "contains #{subtype} #{type}" do
42
+ sublist = subdictionary[subtype].list
43
+ expect(Cryptozoologist::Dictionaries.send(type.to_sym).include?(sublist.sample)).to be true
44
+ end
25
45
 
26
- it 'contains Mythical creatures' do
27
- mythical = Cryptozoologist::Dictionaries::Animals::Mythical.list
28
- expect(Cryptozoologist::Dictionaries.animals.include?(mythical.sample)).to be true
29
- end
46
+ it 'filters out exclusions' do
47
+ Cryptozoologist.reset
30
48
 
31
- it 'does not contain other types of words' do
32
- list = Cryptozoologist::Dictionaries::Animals::Common.list
33
- list += Cryptozoologist::Dictionaries::Animals::Mythical.list
34
- expect(list.sort).to eq(Cryptozoologist::Dictionaries.animals.sort)
35
- end
49
+ Cryptozoologist.configure do |config|
50
+ config.exclude = [subtype]
51
+ end
52
+
53
+ sublist = subdictionary[subtype].list
54
+ expect(Cryptozoologist::Dictionaries.send(type.to_sym).include?(sublist.sample)).to be false
55
+ end
56
+ end
36
57
 
37
- it 'filters out exclusions' do
38
- Cryptozoologist.configure do |config|
39
- config.exclude = [:mythical]
58
+ it 'does not contain other types of words' do
59
+ Cryptozoologist.reset
60
+
61
+ sublists = []
62
+ subdictionary[:subtypes].each do |subtype|
63
+ sublists += subdictionary[subtype].list
64
+ end
65
+
66
+ expect(sublists.sort).to eq(Cryptozoologist::Dictionaries.send(type.to_sym).sort)
40
67
  end
41
- mythical = Cryptozoologist::Dictionaries::Animals::Mythical.list
42
- expect(Cryptozoologist::Dictionaries.animals.include?(mythical.sample)).to be_falsy
43
68
  end
44
69
  end
45
70
 
46
- context '#colors' do
47
- it 'has a color list' do
48
- expect(Cryptozoologist::Dictionaries.colors.length).to be > 1
49
- end
71
+ dictionaries.each do |type, dictionary|
72
+ context "##{type}" do
73
+ it "has a #{type} list" do
74
+ expect(Cryptozoologist::Dictionaries.send(type.to_sym).length).to be > 1
75
+ end
50
76
 
51
- it 'contains paint colors' do
52
- paint = Cryptozoologist::Dictionaries::Colors::Paint.list
53
- expect(Cryptozoologist::Dictionaries.colors.include?(paint.sample)).to be true
54
- end
77
+ it "contains #{type} words" do
78
+ expect(Cryptozoologist::Dictionaries.send(type.to_sym).include?(dictionary.list.sample)).to be true
79
+ end
55
80
 
56
- it 'contains web colors' do
57
- web = Cryptozoologist::Dictionaries::Colors::WebSafe.list
58
- expect(Cryptozoologist::Dictionaries.colors.include?(web.sample)).to be true
59
- end
81
+ it "does not contain other types of words" do
82
+ expect(Cryptozoologist::Dictionaries.colors.sort).not_to eq(dictionary.list.sort)
83
+ end
60
84
 
61
- it 'does not contain other types of words' do
62
- list = Cryptozoologist::Dictionaries::Colors::Paint.list
63
- list += Cryptozoologist::Dictionaries::Colors::WebSafe.list
64
- expect(list.sort).to eq(Cryptozoologist::Dictionaries.colors.sort)
65
- end
85
+ it "is not a valid exclusion" do
86
+ Cryptozoologist.configure do |config|
87
+ config.exclude = [type.to_sym]
88
+ end
66
89
 
67
- it 'filters out exclusions' do
68
- Cryptozoologist.configure do |config|
69
- config.exclude = [:paint]
90
+ expect(Cryptozoologist::Dictionaries.send(type.to_sym).include?(dictionary.list.sample)).to be true
70
91
  end
71
- paint = Cryptozoologist::Dictionaries::Colors::Paint.list
72
- expect(Cryptozoologist::Dictionaries.colors.include?(paint.sample)).to be_falsy
73
92
  end
74
93
  end
75
94
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptozoologist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liz Abinante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-10 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,8 +99,10 @@ files:
99
99
  - lib/cryptozoologist/dictionaries.rb
100
100
  - lib/cryptozoologist/dictionaries/animals/common.rb
101
101
  - lib/cryptozoologist/dictionaries/animals/mythical.rb
102
+ - lib/cryptozoologist/dictionaries/clothing.rb
102
103
  - lib/cryptozoologist/dictionaries/colors/paint.rb
103
104
  - lib/cryptozoologist/dictionaries/colors/web_safe.rb
105
+ - lib/cryptozoologist/dictionaries/quantity.rb
104
106
  - lib/cryptozoologist/dictionary.rb
105
107
  - lib/cryptozoologist/errors.rb
106
108
  - lib/cryptozoologist/version.rb