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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17774b03847bead6d36c230eddf5d793cacc9889b35c19e344a8be1a973b0878
4
- data.tar.gz: 88f35af779073c7ba55f6907075a6ab3f58df2a2c9de05daa14e88e7555c06c6
3
+ metadata.gz: 4d74bd02b7ed73774461fd981d7480392694d3008ccbddb6af7e9d6a0a543f18
4
+ data.tar.gz: cb8ea0c65743b6c42026c7373dd0f5785fecc06ccb37967fe50073ca6ccc104c
5
5
  SHA512:
6
- metadata.gz: ea95cf8bba3f6a7cfcbe1b9cb5e310b6e990421fe2ff8669d6c41338c14653a264a0de427f02b8b93c0101ddddab4b61e81b1459674265197291ba940c5941d5
7
- data.tar.gz: cd99d161b3d5b651717855223c57db1d254ea0c2ecde3ab9656735a9a27ef83b978e376f761aa83887118805eb66f044d2d6d1a82a21a334cab4de1a75429440
6
+ metadata.gz: 72ad8421903cffbb40210de327ee8fde88df461f1412fd4c3b3c10566bc82bb825fa8ae1b19457f391d45311dc56457956f1f6ea903a285a9e5ddd842f2b6ca7
7
+ data.tar.gz: 753bbe2e2d1d5af55c99973b6c01cf60e255cba347130548b56de08f15ca620eba5ff1a322885760fbdfe893b8c9d1fb05c06318f2c408f39e66c866868f1a5c
@@ -110,13 +110,17 @@ module Chieftain
110
110
 
111
111
  if settings[:required] || provided?(name)
112
112
  value = get_raw_parameter_value(name)
113
- convertor = get_convertor(settings.type)
114
- if !convertor.convertible?(value)
115
- raise ParameterError.new("The value of the '#{name}' parameter cannot be converted to the '#{settings.type}' type.", name)
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
- nil
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.")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chieftain
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
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.0
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-14 00:00:00.000000000 Z
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