chieftain 0.1.4 → 0.1.6
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 +4 -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: 21a636694ba1cd1ee95f811ff908df685edf5567cba179932af52f12a1121c45
|
4
|
+
data.tar.gz: e50110c5a8715bc469d52054134696f0152c58428caffc73cbf5322536aa7463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d67dfd7146e89f6e4614db80d395b26ae6925689b3b86bb7c44de7df39169de7dae3a4cbcc3c59629f03cb60afd44ff9ddb30906c750705b0ca8c408c27258e
|
7
|
+
data.tar.gz: b7003a87e4e4b78eac201bf1cf00e1c951f25e3cfa12ec0369196f733c862ed9a62a4304b558381828dcc6c4ea9da07cea1a64abfa009d9310d541db0a949113
|
data/Gemfile.lock
CHANGED
data/lib/chieftain/command.rb
CHANGED
@@ -50,7 +50,7 @@ module Chieftain
|
|
50
50
|
def initialize(parameters={})
|
51
51
|
@convertors = Command.convertors_for(self.class)
|
52
52
|
@errors = []
|
53
|
-
@parameters = {}.merge(parameters)
|
53
|
+
@parameters = {}.merge(parameters).inject({}) {|t,v| t[v[0].to_s.to_sym] = v[1]; t}
|
54
54
|
@settings = Command.parameters(self.class)
|
55
55
|
@validators = Command.validators_for(self.class)
|
56
56
|
end
|
@@ -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
|
@@ -363,7 +363,7 @@ module Chieftain
|
|
363
363
|
# Fetches the parameter list registered for a specific Command class
|
364
364
|
# instance.
|
365
365
|
def self.parameters(command_class)
|
366
|
-
@@parameters[command_class]
|
366
|
+
@@parameters[command_class] || {}
|
367
367
|
end
|
368
368
|
|
369
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.6
|
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-09-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
|