dsl_compose 2.14.1 → 2.14.3

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: 7dae8c4f74589b916fbfc6f67f181d58b6e2044aa9eed65a4e26e2e2d05b1fbc
4
- data.tar.gz: c9663b356014625a531f22fc093b3f0c0117be81b49a6157b9068b196c4db2dc
3
+ metadata.gz: ddbe8b1e65763bba6eb8893aae605c7a3767c2d14f5aa5e120340cca933c6b1b
4
+ data.tar.gz: bdec4caaf6784bb0721fbd00593b0112d79f9fbf9c807f97bb89c3c713341053
5
5
  SHA512:
6
- metadata.gz: 7e6ccea99702dc7e02344b4dfe169433b61a363e6ea0d3c3bf4abae0c531c240e4a37a68e384e5d9b7b96a63438e768b3b8beb2ae37fc657ffd141ff80e707b1
7
- data.tar.gz: 2eec3427dc377746dce4e708a6c2c1d12bcb6ec94637ae9f425810d7b5665b90e51178b62ff0ce6d0f22409697c7611e3c363bb636d4f8f9a88ae990c39ddfcb
6
+ metadata.gz: 81c959506de138f0d4598d152d5d9b66756e0018bb0cee870fc749a49cbdcca6132c4252b7cb0c38308c517ead07102fe644ac12301aff743d3054e32efff404
7
+ data.tar.gz: 4f02a341c854c005c2212b6387b40f5ce805fe1c5aabf277d69ce91b0d85e34cb003c805d6fad3681b33964c5cc8c6952216d2152b57165ade6e793db242ad4e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.14.3](https://github.com/craigulliott/dsl_compose/compare/v2.14.2...v2.14.3) (2023-09-27)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * better error if passing a scalar arg instead of kwargs ([7a47775](https://github.com/craigulliott/dsl_compose/commit/7a47775e7b13329c82c2497a017d2d67c5c56d75))
9
+
10
+ ## [2.14.2](https://github.com/craigulliott/dsl_compose/compare/v2.14.1...v2.14.2) (2023-09-11)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * freezing default arguments so that code within parsers can not modify the underlying values ([12674de](https://github.com/craigulliott/dsl_compose/commit/12674def81b7370f7e06b8036fea308dff95f30d))
16
+
3
17
  ## [2.14.1](https://github.com/craigulliott/dsl_compose/compare/v2.14.0...v2.14.1) (2023-09-11)
4
18
 
5
19
 
@@ -38,6 +38,11 @@ module DSLCompose
38
38
 
39
39
  # process all the required arguments which are kwargs
40
40
  required_kwargs = arguments.required_arguments.filter { |a| a.kwarg }
41
+
42
+ if required_kwargs.any? && !all_kwargs.is_a?(Hash)
43
+ raise MissingRequiredArgumentsError, "This has required keyword arguments, but no keyword arguments were provided"
44
+ end
45
+
41
46
  required_kwargs.each do |required_kwarg|
42
47
  if all_kwargs.key? required_kwarg.name
43
48
  # add the keyword argument to the required args
@@ -73,7 +78,7 @@ module DSLCompose
73
78
  # unless the argument is an array or a boolean, in which case it defaults
74
79
  # to an empty array or false
75
80
  if optional_argument.array
76
- @arguments[optional_argument.name] = []
81
+ @arguments[optional_argument.name] = [].freeze
77
82
  elsif optional_argument.type == :boolean
78
83
  @arguments[optional_argument.name] = false
79
84
  end
@@ -164,7 +169,7 @@ module DSLCompose
164
169
  # If the argument accepts an array of values, then automatically convert valid singular values
165
170
  # into an array.
166
171
  @arguments[optional_argument_name] = if optional_argument.array && !optional_arg_value.is_a?(Array)
167
- [optional_arg_value]
172
+ [optional_arg_value].freeze
168
173
  else
169
174
  optional_arg_value
170
175
  end
@@ -254,7 +259,7 @@ module DSLCompose
254
259
  # If the argument accepts an array of values, then automatically convert valid singular values
255
260
  # into an array.
256
261
  @arguments[argument_name] = if required_argument.array && !required_arg_value.is_a?(Array)
257
- [required_arg_value]
262
+ [required_arg_value].freeze
258
263
  else
259
264
  required_arg_value
260
265
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DSLCompose
4
- VERSION = "2.14.1"
4
+ VERSION = "2.14.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsl_compose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.1
4
+ version: 2.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-11 00:00:00.000000000 Z
11
+ date: 2023-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: class_spec_helper