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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e563101a2b20c22542bb36a78d6f8fbb0bf87cd17bb1472f6c21e122b2eb2819
4
- data.tar.gz: 9c2508b000f0325a1cea0bc695e283434bac5c85b6890e8ffda47f26a6aac602
3
+ metadata.gz: 21a636694ba1cd1ee95f811ff908df685edf5567cba179932af52f12a1121c45
4
+ data.tar.gz: e50110c5a8715bc469d52054134696f0152c58428caffc73cbf5322536aa7463
5
5
  SHA512:
6
- metadata.gz: 762bf3b4458c6ab07ea64c158133bf626981002dc241e49648de3ceef20ee2f25b439cdaae674b3118de5d910d17f72d2fcfb0cee3bf058a0c7ad9eafa2b87c4
7
- data.tar.gz: 6720d6fce5e53fd978321fdcc2041adf32aeca2a84619e3be20eab79a273ed4a0cf2824651ab5438c1b4f2a706c3143fec6ba801efd0daebe2ec6bf8be63303c
6
+ metadata.gz: 7d67dfd7146e89f6e4614db80d395b26ae6925689b3b86bb7c44de7df39169de7dae3a4cbcc3c59629f03cb60afd44ff9ddb30906c750705b0ca8c408c27258e
7
+ data.tar.gz: b7003a87e4e4b78eac201bf1cf00e1c951f25e3cfa12ec0369196f733c862ed9a62a4304b558381828dcc6c4ea9da07cea1a64abfa009d9310d541db0a949113
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chieftain (0.1.3)
4
+ chieftain (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chieftain
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.6"
5
5
  end
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
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: 2022-11-25 00:00:00.000000000 Z
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