to_bool 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/to_bool.rb +1 -1
- data/spec/to_bool_spec.rb +14 -0
- data/to_bool.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f74c30f848ad6c680456ade1596e64e56cf300a4679fc043994b731daa77d9d8
|
4
|
+
data.tar.gz: 0b138f38fa312c2ff228873db0f04c77dc79f6edffd19bd0772527dae0a3eed0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4d3b41a40a2cbc59e5c315879e1f6029c00d975ff6683c9ea6f9a151e7ad88e12284ddff4d69fe83797ca4d1c1f7f3129c6a127e59ed54946f5845fdcb63b20
|
7
|
+
data.tar.gz: 7476fb2ee6902dfdf34d0c43467b8d1bf51c9aad895acd58cb9ca2f89c5f52df20ebe19806aff66ff049b9fbc0f21ec5e9b72b3ed996f561c03d8a08f0bbdbb1
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Natural coercion into boolean (true / false). Useful for API interaction.
|
|
12
12
|
|
13
13
|
Call `to_bool` on any object. It will *usually* return false, except:
|
14
14
|
|
15
|
-
* String: `"true"`, `"1"`, and `"yes"` are true
|
15
|
+
* String: `"true"`, `"1"`, `"y"`, and `"yes"` are true
|
16
16
|
* Integer: `1` is true
|
17
17
|
* TrueClass: `true` is true
|
18
18
|
* Symbol: `:true` is true
|
data/lib/to_bool.rb
CHANGED
data/spec/to_bool_spec.rb
CHANGED
@@ -10,6 +10,14 @@ describe "String" do
|
|
10
10
|
expect("YES".to_bool).to eq true
|
11
11
|
end
|
12
12
|
|
13
|
+
it "is true if 'y'" do
|
14
|
+
expect("y".to_bool).to eq true
|
15
|
+
end
|
16
|
+
|
17
|
+
it "is true if 'Y'" do
|
18
|
+
expect("Y".to_bool).to eq true
|
19
|
+
end
|
20
|
+
|
13
21
|
it "is true if '1'" do
|
14
22
|
expect("1".to_bool).to eq true
|
15
23
|
end
|
@@ -32,7 +40,13 @@ describe "String" do
|
|
32
40
|
|
33
41
|
it "is false otherwise" do
|
34
42
|
expect("no".to_bool).to eq false
|
43
|
+
expect("NO".to_bool).to eq false
|
44
|
+
expect("n".to_bool).to eq false
|
45
|
+
expect("N".to_bool).to eq false
|
35
46
|
expect("false".to_bool).to eq false
|
47
|
+
expect("FALSE".to_bool).to eq false
|
48
|
+
expect("f".to_bool).to eq false
|
49
|
+
expect("F".to_bool).to eq false
|
36
50
|
expect("0".to_bool).to eq false
|
37
51
|
end
|
38
52
|
|
data/to_bool.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "to_bool"
|
7
|
-
gem.version = "
|
7
|
+
gem.version = "2.0.0"
|
8
8
|
gem.authors = ["Bryan Ricker"]
|
9
9
|
gem.email = ["bryancricker@gmail.com"]
|
10
10
|
gem.description = %q{Super-simple gem that extends some Ruby classes with a "to_bool" method, which converts any object naturally into a boolean.}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to_bool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Ricker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -33,6 +33,7 @@ extensions: []
|
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
35
|
- ".gitignore"
|
36
|
+
- CHANGELOG.md
|
36
37
|
- Gemfile
|
37
38
|
- README.md
|
38
39
|
- Rakefile
|
@@ -57,8 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
58
|
- !ruby/object:Gem::Version
|
58
59
|
version: '0'
|
59
60
|
requirements: []
|
60
|
-
|
61
|
-
rubygems_version: 2.7.6
|
61
|
+
rubygems_version: 3.0.3
|
62
62
|
signing_key:
|
63
63
|
specification_version: 4
|
64
64
|
summary: Convert any object naturally into a boolean
|