chieftain 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chieftain/command.rb +9 -5
- data/lib/chieftain/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d74bd02b7ed73774461fd981d7480392694d3008ccbddb6af7e9d6a0a543f18
|
4
|
+
data.tar.gz: cb8ea0c65743b6c42026c7373dd0f5785fecc06ccb37967fe50073ca6ccc104c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72ad8421903cffbb40210de327ee8fde88df461f1412fd4c3b3c10566bc82bb825fa8ae1b19457f391d45311dc56457956f1f6ea903a285a9e5ddd842f2b6ca7
|
7
|
+
data.tar.gz: 753bbe2e2d1d5af55c99973b6c01cf60e255cba347130548b56de08f15ca620eba5ff1a322885760fbdfe893b8c9d1fb05c06318f2c408f39e66c866868f1a5c
|
data/lib/chieftain/command.rb
CHANGED
@@ -110,13 +110,17 @@ module Chieftain
|
|
110
110
|
|
111
111
|
if settings[:required] || provided?(name)
|
112
112
|
value = get_raw_parameter_value(name)
|
113
|
-
|
114
|
-
|
115
|
-
|
113
|
+
if settings[:type]
|
114
|
+
convertor = get_convertor(settings.type)
|
115
|
+
if !convertor.convertible?(value)
|
116
|
+
raise ParameterError.new("The value of the '#{name}' parameter cannot be converted to the '#{settings.type}' type.", name)
|
117
|
+
end
|
118
|
+
convertor.convert(value)
|
119
|
+
else
|
120
|
+
value
|
116
121
|
end
|
117
|
-
convertor.convert(value)
|
118
122
|
else
|
119
|
-
|
123
|
+
settings[:default]
|
120
124
|
end
|
121
125
|
else
|
122
126
|
raise ParameterError.new("Unknown parameter '#{name}' requested from a '#{self.class.name}' command instance.")
|
data/lib/chieftain/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chieftain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Wood
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: An implementation of the command design pattern that attempts to simplify
|
14
14
|
usage by enchancing the offering making use of the facilities offered by the Ruby
|