cryptozoologist 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5194fc1eb6c2f18cb94a039b6b00ca65823a0d08
4
- data.tar.gz: b71030cb012397c241032b5507ba249707dfc2bd
3
+ metadata.gz: 06601375b1385300471f4c3483d20b4b6879aa14
4
+ data.tar.gz: 129ff159258be07a66bd4bf7964e52171a60f871
5
5
  SHA512:
6
- metadata.gz: ab8911f252691d0b7925025bc7ceab8204c13a90c588782199c611e63f5ed13530ba551ffd2e9c9276015482860a2da1fe82e315124a57dee6d27c9f84a5cb4e
7
- data.tar.gz: 55ff8bf8eb73545896e9ce082ecff1a23ba92f33f5d9567519238f1ba56c46405c04b1dd5e95927f427ed08ca3fbecb0a700db322795b3f63c2818c95dd96bac
6
+ metadata.gz: 1cbbc6fb596e675a5d220c76813b745cfc37e23ac3cb3f3f5300adb5eee590a74ee37acd017834b03b03ae7abd870f8bfec0ec40daa7a934fc7da7f511421bfe
7
+ data.tar.gz: b7a67f991bd65d65559cb18e8659e9b1d307b1ad7d6586af4380e941bc88dbd02f0f7851970d49b8bddacc58d981c7ea847963b3717caf55c53a33d0414b6525
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.0
4
+
5
+ - added test coverage
6
+ - fix spelling of `delimiter`
7
+
3
8
  ## 2.0.1
4
9
 
5
10
  - specify ruby 2.0.0 or higher requirement (wow, i hope you're not using 1.9.3 still...)
data/README.md CHANGED
@@ -40,7 +40,7 @@ Cryptozoologist.generate # => 'forest-green-wasp-getup'
40
40
 
41
41
  ### Generate a random color, animal, clothing item, or measure of quantity
42
42
 
43
- These dictionaries will also follow your configuration settings (see below), _except for your delimeter_ (the delimeter is not used here).
43
+ These dictionaries will also follow your configuration settings (see below), _except for your delimiter_ (the delimiter is not used here).
44
44
 
45
45
  ```ruby
46
46
  Cryptozoologist::Dictionary.animals.sample # => 'sun bear'
@@ -58,14 +58,14 @@ Configuration blocks take the following options:
58
58
  config.exclude = []
59
59
  config.include = []
60
60
  config.order = []
61
- config.delimeter = ''
61
+ config.delimiter = ''
62
62
  end
63
63
  ```
64
64
 
65
65
  - `exclude` (array of symbols) allows you to exclude dictionary subtypes; defaults to no exclusions
66
66
  - `include` (array of symbols) allows you to include optional dictionaries; defaults to no inclusions
67
67
  - `order` (array of symbols) allows you to change the word order; defaults to animal-color-clothing
68
- - `delimeter` (string) allows you to specify a delimeter; defaults to `-`
68
+ - `delimiter` (string) allows you to specify a delimiter; defaults to `-`
69
69
 
70
70
  ### Configuration options
71
71
 
@@ -86,7 +86,7 @@ Configuration blocks take the following options:
86
86
  - **must provide all 3 keys** as an array in the order in which you want words to appear
87
87
  - `[:animals, :colors, :clothing]`
88
88
 
89
- **Delimeter (`config.delimeter`, `''`):**
89
+ **delimiter (`config.delimiter`, `''`):**
90
90
 
91
91
  - defaults to `'-'`
92
92
  - any string is valid
@@ -98,7 +98,7 @@ Configuration blocks take the following options:
98
98
  config.exclude = [:common]
99
99
  config.include = [:quantity]
100
100
  config.order = [:colors, :animals, :clothing]
101
- config.delimeter = '_'
101
+ config.delimiter = '_'
102
102
  end
103
103
 
104
104
  Cryptozoologist.generate # => 'masses_yellow_zombie_shrug'
@@ -33,11 +33,11 @@ module Cryptozoologist
33
33
 
34
34
  order.each do |library|
35
35
  word = Dictionary.send(library).sample
36
- compound_word = word.split(' ').join(@configuration.delimeter)
36
+ compound_word = word.split(' ').join(@configuration.delimiter)
37
37
  string += "#{compound_word}"
38
38
 
39
39
  unless library == @configuration.order.last
40
- string += "#{@configuration.delimeter}"
40
+ string += "#{@configuration.delimiter}"
41
41
  end
42
42
  end
43
43
 
@@ -1,10 +1,10 @@
1
1
  module Cryptozoologist
2
2
  class Configuration
3
- attr_reader :exclude, :delimeter, :order, :include
3
+ attr_reader :exclude, :delimiter, :order, :include
4
4
 
5
5
  def initialize
6
6
  @exclude = []
7
- @delimeter = "-"
7
+ @delimiter = "-"
8
8
  @order = [:colors, :animals, :clothing]
9
9
  @include = []
10
10
  end
@@ -18,10 +18,10 @@ module Cryptozoologist
18
18
  @order = list
19
19
  end
20
20
 
21
- def delimeter=(string)
22
- raise Errors::Configuration, "Delimeter must be a a string" unless string.is_a?(String)
21
+ def delimiter=(string)
22
+ raise Errors::Configuration, "delimiter must be a a string" unless string.is_a?(String)
23
23
 
24
- @delimeter = string
24
+ @delimiter = string
25
25
  end
26
26
 
27
27
  def include=(inclusions)
@@ -1,3 +1,3 @@
1
1
  module Cryptozoologist
2
- VERSION = "2.0.1"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -54,9 +54,17 @@ describe Cryptozoologist::Configuration do
54
54
 
55
55
  expect(Cryptozoologist.configuration.include).to eq([:quantity])
56
56
  end
57
+
58
+ it 'sets valid inclusions' do
59
+ Cryptozoologist.configure do |config|
60
+ config.include = [:quantity]
61
+ end
62
+
63
+ expect(Cryptozoologist.configuration.include_quantity?).to be true
64
+ end
57
65
  end
58
66
 
59
- context '#delimeter' do
67
+ context '#delimiter' do
60
68
  it 'defaults to "-"' do
61
69
  expect(Cryptozoologist.generate.match('-')).to be_instance_of(MatchData)
62
70
  end
@@ -64,14 +72,14 @@ describe Cryptozoologist::Configuration do
64
72
  it 'requires a string' do
65
73
  expect {
66
74
  Cryptozoologist.configure do |config|
67
- config.delimeter = 1
75
+ config.delimiter = 1
68
76
  end
69
77
  }.to raise_error(Cryptozoologist::Errors::Configuration)
70
78
  end
71
79
 
72
- it 'changes the delimeter when provided' do
80
+ it 'changes the delimiter when provided' do
73
81
  Cryptozoologist.configure do |config|
74
- config.delimeter ='$'
82
+ config.delimiter ='$'
75
83
  end
76
84
 
77
85
  expect(Cryptozoologist.generate.match('$')).to be_instance_of(MatchData)
@@ -20,7 +20,7 @@ describe Cryptozoologist do
20
20
  expect(Cryptozoologist.generate).to be_instance_of(String)
21
21
  end
22
22
 
23
- it 'returns a string with the delimeter' do
23
+ it 'returns a string with the delimiter' do
24
24
  expect(Cryptozoologist.generate.match('-')).to be_instance_of(MatchData)
25
25
  end
26
26
  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: 2.0.1
4
+ version: 2.1.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-06-13 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler