bootstripe 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
@@ -8,8 +8,8 @@ class String
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def to_bool
|
11
|
-
return true if self == true || self =~ (/(true|t|yes|y|1)$/i)
|
12
|
-
return false if self == false || self.empty? || self =~ (/(false|f|no|n|0)$/i)
|
11
|
+
return true if self == true || self =~ (/(true|t|yes|y|1|on)$/i)
|
12
|
+
return false if self == false || self.empty? || self =~ (/(false|f|no|n|0|off)$/i)
|
13
13
|
raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
|
14
14
|
end
|
15
15
|
end
|
data/lib/bootstripe/version.rb
CHANGED
data/lib/bootstripe.rb
CHANGED
@@ -12,6 +12,7 @@ describe String do
|
|
12
12
|
"yes".to_bool.should be_true
|
13
13
|
"y".to_bool.should be_true
|
14
14
|
"1".to_bool.should be_true
|
15
|
+
"on".to_bool.should be_true
|
15
16
|
end
|
16
17
|
|
17
18
|
it 'should parse false booleans' do
|
@@ -22,6 +23,7 @@ describe String do
|
|
22
23
|
"no".to_bool.should be_false
|
23
24
|
"n".to_bool.should be_false
|
24
25
|
"0".to_bool.should be_false
|
26
|
+
"off".to_bool.should be_false
|
25
27
|
end
|
26
28
|
|
27
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- lib/bootstripe/date_additions.rb
|
44
44
|
- lib/bootstripe/enumerable_additions.rb
|
45
45
|
- lib/bootstripe/hash_additions.rb
|
46
|
+
- lib/bootstripe/nil_class_additions.rb
|
46
47
|
- lib/bootstripe/number_additions.rb
|
47
48
|
- lib/bootstripe/string_additions.rb
|
48
49
|
- lib/bootstripe/version.rb
|
@@ -51,6 +52,7 @@ files:
|
|
51
52
|
- spec/enumberable_additions_spec.rb
|
52
53
|
- spec/frequency_spec.rb
|
53
54
|
- spec/hash_additions_spec.rb
|
55
|
+
- spec/nil_class_additions_spec.rb
|
54
56
|
- spec/number_additions_spec.rb
|
55
57
|
- spec/spec_helper.rb
|
56
58
|
- spec/string_additions_spec.rb
|
@@ -83,6 +85,7 @@ test_files:
|
|
83
85
|
- spec/enumberable_additions_spec.rb
|
84
86
|
- spec/frequency_spec.rb
|
85
87
|
- spec/hash_additions_spec.rb
|
88
|
+
- spec/nil_class_additions_spec.rb
|
86
89
|
- spec/number_additions_spec.rb
|
87
90
|
- spec/spec_helper.rb
|
88
91
|
- spec/string_additions_spec.rb
|