wannabe_bool 0.5.0 → 0.6.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: 8be47f9bd1c7e8f4c39b6186fe6f6fe8c4c5c638
4
- data.tar.gz: 466811c19ea0b1d2d5b069c5f362ef703956c096
3
+ metadata.gz: 9e7cd3d1239a38da5d61de3c93b3fc69a5360780
4
+ data.tar.gz: d04b86b2681366494b5d43a6e9b7ee6b5c9d3d5c
5
5
  SHA512:
6
- metadata.gz: 98a600076e2b33f70f863d9a1b62d29ac9fbcaa9e393bc9a06c580954b43593183617b142297e07a7c652a142f15a4fcb8b389b72d73c306fc9b9fe8366c2f3a
7
- data.tar.gz: 7098d24507ce3eb02f0ea3854c984584659852cf0fd13907cc25faa69aad8f4828c09c2a65a1c83168bde57077121a308a183b648fe776b85bcc2efb20b6f490
6
+ metadata.gz: 04e2b48c0164dba042a5045281f8341266ca1ff6fec0bad05f8ab3ab950c6c5eca7eec263f9b2d3592020b65fc623a60c9679f6b81c22ad2a646516abd4e4566
7
+ data.tar.gz: 16bbfc7517b8f63ff091a80473d0f97e2919fd266beb0499f90bd63394473067f38875b196518d6fdb727278ebbc97e725b46a8e635f13d925e9990c1b5427bc
@@ -1,14 +1,28 @@
1
1
  language: ruby
2
+
2
3
  rvm:
3
- - 1.9.2
4
- - 1.9.3
5
4
  - 2.0.0
6
- - 2.1.8
7
- - 2.2.4
8
- - 2.3.0
5
+ - 2.1.10
6
+ - 2.2.5
7
+ - 2.3.1
8
+ - ruby-head
9
+ - jruby-9
10
+ - jruby
9
11
  - jruby-19mode
10
12
  - jruby-head
11
13
  - rbx
14
+ - rbx-2
15
+
16
+ matrix:
17
+ allow_failures:
18
+ - rvm: jruby
19
+ - rvm: jruby-19mode
20
+ - rvm: jruby-head
21
+ - rvm: ruby-head
22
+ - rvm: rbx
23
+ - rvm: rbx-2
24
+ fast_finish: true
25
+
12
26
  script: bundle exec rspec
13
27
  cache: bundler
14
28
  sudo: false
@@ -1,5 +1,6 @@
1
1
  | Version | Changes |
2
2
  | ------- | ------- |
3
+ | 0.6.0 | Invalid value behaviours. [Issue #5](https://github.com/prodis/wannabe_bool/issues/5). |
3
4
  | 0.5.0 | No Ruby version required. |
4
5
  | 0.4.0 | `to_b` in `Numeric` class, not only in `Integer` class. |
5
6
  | 0.3.0 | Fix integer to boolean conversion. [Issue #2](https://github.com/prodis/wannabe_bool/issues/2) |
@@ -0,0 +1,10 @@
1
+ # Contributing to wannabe_bool
2
+
3
+ - Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
4
+ - Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
5
+ - Fork the project.
6
+ - Start a feature/bugfix branch.
7
+ - Commit and push until you are happy with your contribution.
8
+ - Don't forget to rebase with branch master in main project before submit the pull request.
9
+ - Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
10
+ - Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-2015 Fernando Hamasaki de Amorim
3
+ Copyright (c) 2014-2016 Fernando Hamasaki de Amorim
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -32,84 +32,103 @@ require 'wannabe_bool'
32
32
  ```
33
33
 
34
34
  #### String
35
- Returns `true` if string is one of **t**, **true**, **on**, **y**, **yes** or **1** values. Returns `false` otherwise.
35
+ * Returns `true` if string is one of these values: **t**, **true**, **on**, **y**, **yes**, **1**.
36
+ * Returns `false` if string is one of these values: **f**, **false**, **off**, **n**, **no**, **0**.
37
+ * For invalid boolean string representations, returns `false` by default. See "Invalid Value Behaviour" section for more options.
36
38
 
37
- Ignores trailing spaces and letter cases.
39
+ It ignores trailing spaces and letter cases.
38
40
 
39
41
  ```ruby
40
- '1'.to_b # => true
41
- 't'.to_b # => true
42
- 'T'.to_b # => true
43
- 'true'.to_b # => true
44
- 'TRUE'.to_b # => true
45
- 'on'.to_b # => true
46
- 'ON'.to_b # => true
47
- 'y'.to_b # => true
48
- 'yes'.to_b # => true
49
- 'YES'.to_b # => true
50
-
51
- ' 1 '.to_b # => true
52
- ' t '.to_b # => true
53
- ' T '.to_b # => true
54
- ' true '.to_b # => true
55
- ' TRUE '.to_b # => true
56
- ' on '.to_b # => true
57
- ' ON '.to_b # => true
58
- ' y '.to_b # => true
59
- 'Y'.to_b # => true
60
- ' Y '.to_b # => true
61
- ' yes '.to_b # => true
62
- ' YES '.to_b # => true
63
-
64
- ''.to_b # => false
65
- '0'.to_b # => false
66
- '2'.to_b # => false
67
- '-1'.to_b # => false
68
- '-2'.to_b # => false
69
- 'f'.to_b # => false
70
- 'F'.to_b # => false
71
- 'false'.to_b # => false
72
- 'FALSE'.to_b # => false
73
- 'off'.to_b # => false
74
- 'OFF'.to_b # => false
75
- 'n'.to_b # => false
76
- 'N'.to_b # => false
77
- 'no'.to_b # => false
78
- 'NO'.to_b # => false
79
- 'not'.to_b # => false
80
- 'NOT'.to_b # => false
42
+ '1'.to_b # => true
43
+ 't'.to_b # => true
44
+ 'T'.to_b # => true
45
+ 'true'.to_b # => true
46
+ 'TRUE'.to_b # => true
47
+ 'on'.to_b # => true
48
+ 'ON'.to_b # => true
49
+ 'y'.to_b # => true
50
+ 'yes'.to_b # => true
51
+ 'YES'.to_b # => true
52
+
53
+ ' 1 '.to_b # => true
54
+ ' t '.to_b # => true
55
+ ' T '.to_b # => true
56
+ ' true '.to_b # => true
57
+ ' TRUE '.to_b # => true
58
+ ' on '.to_b # => true
59
+ ' ON '.to_b # => true
60
+ ' y '.to_b # => true
61
+ 'Y'.to_b # => true
62
+ ' Y '.to_b # => true
63
+ ' yes '.to_b # => true
64
+ ' YES '.to_b # => true
65
+
66
+ '0'.to_b # => false
67
+ 'f'.to_b # => false
68
+ 'F'.to_b # => false
69
+ 'false'.to_b # => false
70
+ 'FALSE'.to_b # => false
71
+ 'off'.to_b # => false
72
+ 'OFF'.to_b # => false
73
+ 'n'.to_b # => false
74
+ 'N'.to_b # => false
75
+ 'no'.to_b # => false
76
+ 'NO'.to_b # => false
77
+
78
+ ' 0 '.to_b # => false
79
+ ' f '.to_b # => false
80
+ ' F '.to_b # => false
81
+ ' false '.to_b # => false
82
+ ' FALSE '.to_b # => false
83
+ ' off '.to_b # => false
84
+ ' OFF '.to_b # => false
85
+ ' n '.to_b # => false
86
+ ' N '.to_b # => false
87
+ ' no '.to_b # => false
88
+ ' NO '.to_b # => false
89
+ ```
90
+ ##### Invalid Value Behaviour
91
+ You can configure the result for invalid boolean string representations, using the `WannabeBool.invalid_value_behaviour` option.
92
+
93
+ There are 3 predefined behaviours available: to return `false` (default), `nil` or raise an `ArgumentError`:
94
+
95
+ ```ruby
96
+ # WannabeBool.invalid_value_behaviour = WannabeBool::InvalidValueBehaviour::False
81
97
  'wherever'.to_b # => false
98
+
99
+ WannabeBool.invalid_value_behaviour = WannabeBool::InvalidValueBehaviour::Nil
100
+ 'wherever'.to_b # => nil
101
+
102
+ WannabeBool.invalid_value_behaviour = WannabeBool::InvalidValueBehaviour::Error
103
+ 'wherever'.to_b # => ArgumentError: is not a valid boolean representation
82
104
  ```
83
105
 
106
+ Moreover you can provide your own behaviour for invalid boolean string representations. Just set a proc or lambda, or even any class or object that responds to `call` method.
107
+
108
+ ```ruby
109
+ WannabeBool.invalid_value_behaviour = -> { :prodis }
110
+ 'wherever'.to_b # => :prodis
111
+ ```
112
+
113
+ Note that `WannabeBool.invalid_value_behaviour` is a global configuration, so all results for `to_b` method with invalid boolean string representations will be affected.
114
+
84
115
  #### Symbol
85
116
  Same as `symbol.to_s.to_b`.
86
117
 
87
118
  ```ruby
88
- :'1'.to_b # => true
89
- :t.to_b # => true
90
- :T.to_b # => true
91
- :true.to_b # => true
92
- :TRUE.to_b # => true
93
- :on.to_b # => true
94
- :ON.to_b # => true
95
- :y.to_b # => true
96
- :Y.to_b # => true
97
- :yes.to_b # => true
98
- :YES.to_b # => true
99
-
100
- :f.to_b # => false
101
- :F.to_b # => false
102
- :false.to_b # => false
103
- :FALSE.to_b # => false
104
- :off.to_b # => false
105
- :OFF.to_b # => false
106
- :n.to_b # => false
107
- :N.to_b # => false
108
- :no.to_b # => false
109
- :NO.to_b # => false
110
- :not.to_b # => false
111
- :NOT.to_b # => false
112
- :wherever.to_b # => false
119
+ :'1'.to_b # => true
120
+ :t.to_b # => true
121
+ :true.to_b # => true
122
+ :on.to_b # => true
123
+ :y.to_b # => true
124
+ :yes.to_b # => true
125
+
126
+ :'0'.to_b # => false
127
+ :f.to_b # => false
128
+ :false.to_b # => false
129
+ :off.to_b # => false
130
+ :n.to_b # => false
131
+ :no.to_b # => false
113
132
  ```
114
133
 
115
134
  #### Numeric
@@ -165,7 +184,7 @@ Returns `false`.
165
184
  nil.to_b # => false
166
185
  ```
167
186
 
168
- #### Creating predicate methods
187
+ ### Creating predicate methods
169
188
 
170
189
  ```ruby
171
190
  class Fake
@@ -201,15 +220,7 @@ fake.published? # => true
201
220
 
202
221
  ![Prodis Logo](http://prodis.net.br/images/prodis_150.gif)
203
222
 
223
+ ## Contributing to wannabe_bool
204
224
 
205
- ## Contributing to **wannabe_bool**
206
-
207
- - Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
208
- - Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
209
- - Fork the project.
210
- - Start a feature/bugfix branch.
211
- - Commit and push until you are happy with your contribution.
212
- - Don't forget to rebase with branch master in main project before submit the pull request.
213
- - Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
214
- - Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
225
+ [See the contributing guide.](CONTRIBUTING.md)
215
226
 
@@ -1,5 +1,7 @@
1
1
  module WannabeBool; end
2
2
 
3
+ require 'wannabe_bool/invalid_value_behaviour'
4
+ require 'wannabe_bool/configuration'
3
5
  require 'wannabe_bool/boolean'
4
6
  require 'wannabe_bool/nil'
5
7
  require 'wannabe_bool/numeric'
@@ -0,0 +1,15 @@
1
+ module WannabeBool::Configuration
2
+ def invalid_value_behaviour=(behaviour)
3
+ raise ArgumentError, 'behaviour does not respond to call method' unless behaviour.respond_to?(:call)
4
+
5
+ @invalid_value_behaviour = behaviour
6
+ end
7
+
8
+ def invalid_value_behaviour
9
+ @invalid_value_behaviour ||= WannabeBool::InvalidValueBehaviour::False
10
+ end
11
+ end
12
+
13
+ module WannabeBool
14
+ extend WannabeBool::Configuration
15
+ end
@@ -0,0 +1,19 @@
1
+ module WannabeBool::InvalidValueBehaviour
2
+ module False
3
+ def self.call
4
+ false
5
+ end
6
+ end
7
+
8
+ module Nil
9
+ def self.call
10
+ nil
11
+ end
12
+ end
13
+
14
+ module Error
15
+ def self.call
16
+ raise ArgumentError, 'is not a valid boolean representation'
17
+ end
18
+ end
19
+ end
@@ -1,8 +1,13 @@
1
1
  module WannabeBool::String
2
- TRUES = %W{t true on y yes 1}.freeze
2
+ TRUES = %W{t true on y yes 1}.freeze
3
+ FALSES = %W{f false off n no 0}.freeze
3
4
 
4
5
  def to_b
5
- TRUES.include?(self.strip.downcase)
6
+ value = self.strip.downcase
7
+ return true if TRUES.include?(value)
8
+ return false if FALSES.include?(value)
9
+
10
+ WannabeBool.invalid_value_behaviour.call
6
11
  end
7
12
  end
8
13
 
@@ -1,3 +1,3 @@
1
1
  module WannabeBool
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
@@ -3,9 +3,23 @@ require 'wannabe_bool'
3
3
 
4
4
  Coveralls.wear!
5
5
 
6
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
6
  RSpec.configure do |config|
7
+ config.expect_with :rspec do |expectations|
8
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
9
+ end
10
+
11
+ config.mock_with :rspec do |mocks|
12
+ mocks.verify_partial_doubles = true
13
+ end
14
+
15
+ config.disable_monkey_patching!
8
16
  config.run_all_when_everything_filtered = true
9
17
  config.filter_run :focus
10
- config.order = 'random'
18
+ config.order = :random
19
+
20
+ if config.files_to_run.one?
21
+ config.default_formatter = 'doc'
22
+ end
23
+
24
+ Kernel.srand config.seed
11
25
  end
@@ -15,7 +15,7 @@ class Fake
15
15
  end
16
16
  end
17
17
 
18
- describe WannabeBool::Attributes do
18
+ RSpec.describe WannabeBool::Attributes do
19
19
  context 'when reader attribute exists' do
20
20
  let(:subject_methods) do
21
21
  fake = Fake.new(true, true)
@@ -1,4 +1,4 @@
1
- describe WannabeBool::Boolean do
1
+ RSpec.describe WannabeBool::Boolean do
2
2
  context TrueClass do
3
3
  subject { true }
4
4
 
@@ -0,0 +1,22 @@
1
+ RSpec.describe WannabeBool::InvalidValueBehaviour do
2
+ context 'False' do
3
+ describe '#call' do
4
+ subject { WannabeBool::InvalidValueBehaviour::False.call }
5
+ it { is_expected.to be false }
6
+ end
7
+ end
8
+
9
+ context 'Nil' do
10
+ describe '#call' do
11
+ subject { WannabeBool::InvalidValueBehaviour::Nil.call }
12
+ it { is_expected.to be nil }
13
+ end
14
+ end
15
+
16
+ context 'Error' do
17
+ describe '#call' do
18
+ subject { WannabeBool::InvalidValueBehaviour::Error.call }
19
+ it { expect { subject }.to raise_error(ArgumentError, 'is not a valid boolean representation') }
20
+ end
21
+ end
22
+ end
@@ -1,4 +1,4 @@
1
- describe WannabeBool::Nil do
1
+ RSpec.describe WannabeBool::Nil do
2
2
  context NilClass do
3
3
  subject { nil }
4
4
 
@@ -1,6 +1,6 @@
1
1
  require 'bigdecimal'
2
2
 
3
- describe WannabeBool::Numeric do
3
+ RSpec.describe WannabeBool::Numeric do
4
4
  context Integer do
5
5
  describe '#to_b' do
6
6
  context 'when value is 0' do
@@ -1,39 +1,66 @@
1
- describe WannabeBool::String do
1
+ RSpec.describe WannabeBool::String do
2
2
  describe '#to_b' do
3
- [ '1', '1 ', ' 1', ' 1 ',
4
- 't', 't ', ' t', ' t ',
5
- 'T', 'T ', ' T', ' T ',
6
- 'true', 'true ', ' true', ' true ',
7
- 'TRUE', 'TRUE ', ' TRUE', ' TRUE ',
8
- 'on', 'on ', ' on', ' on ',
9
- 'ON', 'ON ', ' ON ', ' ON ',
10
- 'y', 'y ', ' y', ' y ',
11
- 'Y', 'Y ', ' Y', ' Y ',
12
- 'yes', 'yes ', ' yes', ' yes ',
13
- 'YES', 'YES ', ' YES', ' YES '
14
- ].each do |value|
15
- context "when string is '#{value}'" do
16
- subject { value }
17
- it { expect(subject.to_b).to be true }
3
+ context 'truthy values' do
4
+ [ '1', '1 ', ' 1', ' 1 ',
5
+ 't', 't ', ' t', ' t ',
6
+ 'T', 'T ', ' T', ' T ',
7
+ 'true', 'true ', ' true', ' true ',
8
+ 'TRUE', 'TRUE ', ' TRUE', ' TRUE ',
9
+ 'on', 'on ', ' on', ' on ',
10
+ 'ON', 'ON ', ' ON ', ' ON ',
11
+ 'y', 'y ', ' y', ' y ',
12
+ 'Y', 'Y ', ' Y', ' Y ',
13
+ 'yes', 'yes ', ' yes', ' yes ',
14
+ 'YES', 'YES ', ' YES', ' YES '
15
+ ].each do |value|
16
+ context "when string is '#{value}'" do
17
+ subject { value.to_b }
18
+ it { is_expected.to be true }
19
+ end
18
20
  end
19
21
  end
20
22
 
21
- [ '',
22
- '0',
23
- '2', '2 ', ' 2', ' 2 ',
24
- '-1', '-1 ', ' -1', ' -1 ',
25
- '-2', '-2 ', ' -2', ' -2 ',
26
- 'f', 'F',
27
- 'false', 'FALSE',
28
- 'off', 'OFF',
29
- 'n', 'N',
30
- 'no', 'NO',
31
- 'not', 'NOT',
32
- 'wherever', 'Prodis'
33
- ].each do |value|
34
- context "when string is '#{value}'" do
35
- subject { value }
36
- it { expect(subject.to_b).to be false }
23
+ context 'falsey values' do
24
+ [ '0', '0 ', ' 0', ' 0 ',
25
+ 'f', 'f ', ' f', ' f ',
26
+ 'F', 'F ', ' F', ' F ',
27
+ 'false', 'false ', ' false', ' false ',
28
+ 'FALSE', 'FALSE ', ' FALSE', ' FALSE ',
29
+ 'off', 'off ', ' off', ' off ',
30
+ 'OFF', 'OFF ', ' OFF ', ' OFF ',
31
+ 'n', 'n ', ' n', ' n ',
32
+ 'N', 'N ', ' N', ' N ',
33
+ 'no', 'no ', ' no', ' no ',
34
+ 'NO', 'NO ', ' NO', ' NO '
35
+ ].each do |value|
36
+ context "when string is '#{value}'" do
37
+ subject { value.to_b }
38
+ it { is_expected.to be false }
39
+ end
40
+ end
41
+ end
42
+
43
+ context 'invalid values' do
44
+ after do
45
+ WannabeBool.invalid_value_behaviour = WannabeBool::InvalidValueBehaviour::False
46
+ end
47
+
48
+ context 'when an invalid value behaviour is given' do
49
+ before do
50
+ WannabeBool.invalid_value_behaviour = -> { :wherever }
51
+ end
52
+
53
+ [ '', 'nil',
54
+ '2', '-1', '-2',
55
+ 'not', 'NOT',
56
+ 'wherever', 'Prodis'
57
+ ].each do |value|
58
+ context "when string is '#{value}'" do
59
+ it 'returns the result of the given behaviour' do
60
+ expect(value.to_b).to be :wherever
61
+ end
62
+ end
63
+ end
37
64
  end
38
65
  end
39
66
  end
@@ -1,4 +1,4 @@
1
- describe WannabeBool::Symbol do
1
+ RSpec.describe WannabeBool::Symbol do
2
2
  describe '#to_b' do
3
3
  [ :'1', :'1 ', :' 1 ', :' 1',
4
4
  :t, :'t ', :' t', :' t ',
@@ -0,0 +1,39 @@
1
+ RSpec.describe WannabeBool do
2
+ context 'configuration' do
3
+ subject { described_class }
4
+
5
+ describe '.invalid_value_behaviour' do
6
+ context 'default behaviour' do
7
+ it 'is WannabeBool::InvalidValueBehaviour::False' do
8
+ expect(subject.invalid_value_behaviour).to eq WannabeBool::InvalidValueBehaviour::False
9
+ end
10
+ end
11
+ end
12
+
13
+ describe '.invalid_value_behaviour=' do
14
+ context 'when behaviour responds to call method' do
15
+ let(:behaviour) do
16
+ -> { :wherever }
17
+ end
18
+
19
+ before do
20
+ subject.invalid_value_behaviour = behaviour
21
+ end
22
+
23
+ after do
24
+ subject.invalid_value_behaviour = WannabeBool::InvalidValueBehaviour::False
25
+ end
26
+
27
+ it "sets the behaviour" do
28
+ expect(subject.invalid_value_behaviour).to eq behaviour
29
+ end
30
+ end
31
+
32
+ context 'when behaviour does not respond to call method' do
33
+ it 'raises argument error' do
34
+ expect { subject.invalid_value_behaviour = String }.to raise_error(ArgumentError, 'behaviour does not respond to call method')
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_development_dependency 'coveralls'
23
23
  spec.add_development_dependency 'rake'
24
- spec.add_development_dependency 'rspec'
24
+ spec.add_development_dependency 'rspec', '~> 3.5'
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wannabe_bool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Prodis a.k.a. Fernando Hamasaki de Amorim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-30 00:00:00.000000000 Z
11
+ date: 2016-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '3.5'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '3.5'
55
55
  description: 'If string, numeric, symbol and nil values wanna be a boolean value,
56
56
  they can with the new #to_b method (and more).'
57
57
  email: prodis@gmail.com
@@ -63,6 +63,7 @@ files:
63
63
  - ".rspec"
64
64
  - ".travis.yml"
65
65
  - CHANGELOG.md
66
+ - CONTRIBUTING.md
66
67
  - Gemfile
67
68
  - LICENSE
68
69
  - README.md
@@ -70,6 +71,8 @@ files:
70
71
  - lib/wannabe_bool.rb
71
72
  - lib/wannabe_bool/attributes.rb
72
73
  - lib/wannabe_bool/boolean.rb
74
+ - lib/wannabe_bool/configuration.rb
75
+ - lib/wannabe_bool/invalid_value_behaviour.rb
73
76
  - lib/wannabe_bool/nil.rb
74
77
  - lib/wannabe_bool/numeric.rb
75
78
  - lib/wannabe_bool/string.rb
@@ -78,10 +81,12 @@ files:
78
81
  - spec/spec_helper.rb
79
82
  - spec/wannabe_bool/attributes_spec.rb
80
83
  - spec/wannabe_bool/boolean_spec.rb
84
+ - spec/wannabe_bool/invalid_value_behaviour_spec.rb
81
85
  - spec/wannabe_bool/nil_spec.rb
82
86
  - spec/wannabe_bool/numeric_spec.rb
83
87
  - spec/wannabe_bool/string_spec.rb
84
88
  - spec/wannabe_bool/symbol_spec.rb
89
+ - spec/wannabe_bool_spec.rb
85
90
  - wannabe_bool.gemspec
86
91
  homepage: https://github.com/prodis/wannabe_bool
87
92
  licenses:
@@ -103,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
108
  version: '0'
104
109
  requirements: []
105
110
  rubyforge_project:
106
- rubygems_version: 2.5.1
111
+ rubygems_version: 2.6.6
107
112
  signing_key:
108
113
  specification_version: 4
109
114
  summary: 'If string, numeric, symbol and nil values wanna be a boolean value, they
@@ -112,7 +117,9 @@ test_files:
112
117
  - spec/spec_helper.rb
113
118
  - spec/wannabe_bool/attributes_spec.rb
114
119
  - spec/wannabe_bool/boolean_spec.rb
120
+ - spec/wannabe_bool/invalid_value_behaviour_spec.rb
115
121
  - spec/wannabe_bool/nil_spec.rb
116
122
  - spec/wannabe_bool/numeric_spec.rb
117
123
  - spec/wannabe_bool/string_spec.rb
118
124
  - spec/wannabe_bool/symbol_spec.rb
125
+ - spec/wannabe_bool_spec.rb