chieftain 0.1.3 → 0.1.5
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/Gemfile.lock +1 -1
- data/lib/chieftain/command.rb +11 -4
- 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: '074395540ebc204adcd075304d3d5b0cbbc77a961f8c8b9db3187bd44b215b9c'
|
4
|
+
data.tar.gz: 0e8e237323c6d5d78673598a7ec6cf32ee57167b4d7d01512cadef85a4691bce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3281130f57efb0b2749f457f3868b10cc32f1e3d4b523d1a5d62d9a064a68d66812b5db1662b2a90230c5b9c4a8a81f31a22a508de73a5e011386567ef0fc9ae
|
7
|
+
data.tar.gz: e2780f525037e94273e25ac26753b7f6ad22d4008f3e5e4bbf68c5fb07ae50ea4b01bd077213ad13e271672d7ec80eb67e1604e6c0b3125deb20e6c6084937b9
|
data/Gemfile.lock
CHANGED
data/lib/chieftain/command.rb
CHANGED
@@ -72,8 +72,8 @@ module Chieftain
|
|
72
72
|
end
|
73
73
|
|
74
74
|
# Register an error with the execution of the current Command.
|
75
|
-
def error(message)
|
76
|
-
@errors << Error.new(message)
|
75
|
+
def error(message, code=nil)
|
76
|
+
@errors << Error.new(message, code)
|
77
77
|
end
|
78
78
|
|
79
79
|
# Invokes the #perform() method if and only if the Command instance tests as
|
@@ -121,7 +121,14 @@ module Chieftain
|
|
121
121
|
end
|
122
122
|
|
123
123
|
else
|
124
|
-
raw_value =
|
124
|
+
raw_value = nil
|
125
|
+
if provided?(name)
|
126
|
+
raw_value = get_raw_parameter_value(name)
|
127
|
+
raw_value = settings[:default] if raw_value.nil?
|
128
|
+
else
|
129
|
+
raw_value = settings[:default]
|
130
|
+
end
|
131
|
+
|
125
132
|
if provided?(name)
|
126
133
|
if settings[:type]
|
127
134
|
convertor = get_convertor(settings.type)
|
@@ -356,7 +363,7 @@ module Chieftain
|
|
356
363
|
# Fetches the parameter list registered for a specific Command class
|
357
364
|
# instance.
|
358
365
|
def self.parameters(command_class)
|
359
|
-
@@parameters[command_class]
|
366
|
+
@@parameters[command_class] || {}
|
360
367
|
end
|
361
368
|
|
362
369
|
# Registers an optional parameter for the command. See the #parameter() method
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Wood
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-21 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
|