subroutine 3.0.1 → 3.0.2
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 +4 -4
- data/lib/subroutine/type_caster.rb +1 -1
- data/lib/subroutine/version.rb +1 -1
- data/test/subroutine/type_caster_test.rb +30 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a69ecebbd8549a3067d41ac4d8981d51c175614f4e052b296226cdce3ad15b30
|
4
|
+
data.tar.gz: e375bae8ee9f1e73ff3eb3128373d50e4cd20af0cf68eaeef16af28688ca2d36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc51e2794c9a41589aec6d47097cc13644f6e9683b5d5e99ce13310dcf07184d23896dd493ab00ddf54dfa648d7b6236a45968318194b8da53ac66663ae28fc7
|
7
|
+
data.tar.gz: ef4e70f7bf48e180485082f1107b84a9ffbc02037dcc100432435d07d6a634d427ce58546f3010f24723f7e9fbdac52067944fba1294c71078ce11cf30e66488
|
@@ -86,7 +86,7 @@ end
|
|
86
86
|
end
|
87
87
|
|
88
88
|
::Subroutine::TypeCaster.register :boolean, :bool do |value, _options = {}|
|
89
|
-
!!(String(value) =~ /^(yes|true|1|ok)$/)
|
89
|
+
!!(String(value) =~ /^(yes|true|1|ok)$/i)
|
90
90
|
end
|
91
91
|
|
92
92
|
::Subroutine::TypeCaster.register :iso_date do |value, _options = {}|
|
data/lib/subroutine/version.rb
CHANGED
@@ -96,15 +96,45 @@ module Subroutine
|
|
96
96
|
op.boolean_input = 'no'
|
97
97
|
assert_equal false, op.boolean_input
|
98
98
|
|
99
|
+
op.boolean_input = 'Yes'
|
100
|
+
assert_equal true, op.boolean_input
|
101
|
+
|
102
|
+
op.boolean_input = 'No'
|
103
|
+
assert_equal false, op.boolean_input
|
104
|
+
|
105
|
+
op.boolean_input = 'YES'
|
106
|
+
assert_equal true, op.boolean_input
|
107
|
+
|
108
|
+
op.boolean_input = 'NO'
|
109
|
+
assert_equal false, op.boolean_input
|
110
|
+
|
99
111
|
op.boolean_input = 'true'
|
100
112
|
assert_equal true, op.boolean_input
|
101
113
|
|
102
114
|
op.boolean_input = 'false'
|
103
115
|
assert_equal false, op.boolean_input
|
104
116
|
|
117
|
+
op.boolean_input = 'True'
|
118
|
+
assert_equal true, op.boolean_input
|
119
|
+
|
120
|
+
op.boolean_input = 'False'
|
121
|
+
assert_equal false, op.boolean_input
|
122
|
+
|
123
|
+
op.boolean_input = 'TRUE'
|
124
|
+
assert_equal true, op.boolean_input
|
125
|
+
|
126
|
+
op.boolean_input = 'FALSE'
|
127
|
+
assert_equal false, op.boolean_input
|
128
|
+
|
105
129
|
op.boolean_input = 'ok'
|
106
130
|
assert_equal true, op.boolean_input
|
107
131
|
|
132
|
+
op.boolean_input = 'OK'
|
133
|
+
assert_equal true, op.boolean_input
|
134
|
+
|
135
|
+
op.boolean_input = 'Ok'
|
136
|
+
assert_equal true, op.boolean_input
|
137
|
+
|
108
138
|
op.boolean_input = ''
|
109
139
|
assert_equal false, op.boolean_input
|
110
140
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subroutine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
223
|
requirements: []
|
224
|
-
rubygems_version: 3.4.
|
224
|
+
rubygems_version: 3.4.19
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: Feature-driven operation objects.
|