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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6530220e9e104f3eb840fc5ad28514e4e9bb29f6831f1c8cefa96e3d511454b
4
- data.tar.gz: 0bfaf68aae3bd5f5887c2da31b3cc1b8f8fe9c8e12b88f1365c03836bd4615cf
3
+ metadata.gz: a69ecebbd8549a3067d41ac4d8981d51c175614f4e052b296226cdce3ad15b30
4
+ data.tar.gz: e375bae8ee9f1e73ff3eb3128373d50e4cd20af0cf68eaeef16af28688ca2d36
5
5
  SHA512:
6
- metadata.gz: 2c7e809eac6e059bed7029907f4a153b388d564c0ac93b9dde0397a6ef15c5cb57fe816b2b31fdd4d2547dafbbc8d12d52493aebe61aa550afa6c430f2db820a
7
- data.tar.gz: 74d0b0c8c647e3f97fa0899c18a33fbddf7aa7b88a878f22740cd0edacbaf873f7181a164347b88425c1a891662565433d3e6c5dfd5a35f602b785c9b4f7341c
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 = {}|
@@ -4,7 +4,7 @@ module Subroutine
4
4
 
5
5
  MAJOR = 3
6
6
  MINOR = 0
7
- PATCH = 1
7
+ PATCH = 2
8
8
  PRE = nil
9
9
 
10
10
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
@@ -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.1
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: 2023-09-14 00:00:00.000000000 Z
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.10
224
+ rubygems_version: 3.4.19
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: Feature-driven operation objects.