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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99fe1b05ebefe5681b38008db8759fbed289cde52599fef2f142b98f54a40fdd
4
- data.tar.gz: f088cfbed3b92ae1654f36c1f771bc600f9f73a17375cc9ac7ef8e6c6301505f
3
+ metadata.gz: '074395540ebc204adcd075304d3d5b0cbbc77a961f8c8b9db3187bd44b215b9c'
4
+ data.tar.gz: 0e8e237323c6d5d78673598a7ec6cf32ee57167b4d7d01512cadef85a4691bce
5
5
  SHA512:
6
- metadata.gz: 2de2134328177e0692bf3c17b5f7910706c1f02eac305b924819ce05192c664b8bb47e88a879c581703defba79bbc27894bbab5693f6a6ed2b300b94a86ca9e8
7
- data.tar.gz: 276ef574c8cda62b8dd1631391cd6337cb17b0ae561c58baf1cacc1061cea9e51e38279581777ba604fa1ee36a7a69dc5d94911002cad0bed89b1e9608069336
6
+ metadata.gz: 3281130f57efb0b2749f457f3868b10cc32f1e3d4b523d1a5d62d9a064a68d66812b5db1662b2a90230c5b9c4a8a81f31a22a508de73a5e011386567ef0fc9ae
7
+ data.tar.gz: e2780f525037e94273e25ac26753b7f6ad22d4008f3e5e4bbf68c5fb07ae50ea4b01bd077213ad13e271672d7ec80eb67e1604e6c0b3125deb20e6c6084937b9
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.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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 = (provided?(name) ? get_raw_parameter_value(name) : settings[:default])
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chieftain
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.5"
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.3
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: 2022-11-25 00:00:00.000000000 Z
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