dsl_compose 2.14.0 → 2.14.2

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: 952d89e2f9b95412aec641b8faa5219512290924b02923819ca3438f8d6d1500
4
- data.tar.gz: 3f66573596355a16a9477bd6844d552691ea9dded5525335de8ae4b1ca114cea
3
+ metadata.gz: f89114eef0fe1f670d05bfe9cb2b8fe7964285f8dfbc60638f979ec125ad5e88
4
+ data.tar.gz: 0ab64341226e7069d50016415a786b8525b93006d84378911d215b911f8526a1
5
5
  SHA512:
6
- metadata.gz: cc1ed1223977ff6acfa4eb6827180673f69f91449ce060f8a1c99e6756e459f78c22261c46bfcf9359e7ac2fc6ea4aa3ba44f9ed839462e04b7518c3a419e928
7
- data.tar.gz: af5c4e85b2d3368a57610af4ef4b580651e12b32896dcd61d270f5c2d1ebdcda2acf4341a83497f965c695ace817d1d46d827b3da5696f306bf2febf9e8ff04e
6
+ metadata.gz: 97f0cbe329fb957589f395cfdc7ee75c1b195ac897e01a494578efc45409375d5435ff17507b241d8d1f0b65bc014b1a50d2d9b2ec673c1b039cc937052d87a5
7
+ data.tar.gz: 235bf2593f1ef5e0309973eb45189dc7c634e8b959dde94c8a52673b933d0ddb996a2065d29707901ccc94466754d3c2f6d29cf4f0ad237d305d1d21c050aeea
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.14.2](https://github.com/craigulliott/dsl_compose/compare/v2.14.1...v2.14.2) (2023-09-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * freezing default arguments so that code within parsers can not modify the underlying values ([12674de](https://github.com/craigulliott/dsl_compose/commit/12674def81b7370f7e06b8036fea308dff95f30d))
9
+
10
+ ## [2.14.1](https://github.com/craigulliott/dsl_compose/compare/v2.14.0...v2.14.1) (2023-09-11)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * freezing dsl arguments so that other parts of the code can't change the underlying dsl configuration ([d3373d4](https://github.com/craigulliott/dsl_compose/commit/d3373d494b292241bc17f38e565a2434e5e0d187))
16
+
3
17
  ## [2.14.0](https://github.com/craigulliott/dsl_compose/compare/v2.13.1...v2.14.0) (2023-09-06)
4
18
 
5
19
 
@@ -278,7 +278,10 @@ module DSLCompose
278
278
  end
279
279
 
280
280
  def validate_end_with value
281
- unless value.is_a?(Symbol) || value.is_a?(String) || (value.is_a?(Array) && value.all? { |value| value.is_a? Symbol }) || (value.is_a?(Array) && value.all? { |value| value.is_a? String })
281
+ valid_type = value.is_a?(Symbol) || value.is_a?(String)
282
+ valid_array_of_symbols = (value.is_a?(Array) && value.all? { |value| value.is_a? Symbol })
283
+ valid_array_of_strings = (value.is_a?(Array) && value.all? { |value| value.is_a? String })
284
+ unless valid_type || valid_array_of_symbols || valid_array_of_strings
282
285
  raise ValidationInvalidArgumentError, "The value `#{value}` provided to this validator must be a Symbol/String or an Array of Symbols/Strings"
283
286
  end
284
287
 
@@ -295,7 +298,10 @@ module DSLCompose
295
298
  end
296
299
 
297
300
  def validate_not_end_with value
298
- unless value.is_a?(Symbol) || value.is_a?(String) || (value.is_a?(Array) && value.all? { |value| value.is_a? Symbol }) || (value.is_a?(Array) && value.all? { |value| value.is_a? String })
301
+ valid_type = value.is_a?(Symbol) || value.is_a?(String)
302
+ valid_array_of_symbols = (value.is_a?(Array) && value.all? { |value| value.is_a? Symbol })
303
+ valid_array_of_strings = (value.is_a?(Array) && value.all? { |value| value.is_a? String })
304
+ unless valid_type || valid_array_of_symbols || valid_array_of_strings
299
305
  raise ValidationInvalidArgumentError, "The value `#{value}` provided to this validator must be a Symbol/String or an Array of Symbols/Strings"
300
306
  end
301
307
 
@@ -312,7 +318,10 @@ module DSLCompose
312
318
  end
313
319
 
314
320
  def validate_start_with value
315
- unless value.is_a?(Symbol) || value.is_a?(String) || (value.is_a?(Array) && value.all? { |value| value.is_a? Symbol }) || (value.is_a?(Array) && value.all? { |value| value.is_a? String })
321
+ valid_type = value.is_a?(Symbol) || value.is_a?(String)
322
+ valid_array_of_symbols = (value.is_a?(Array) && value.all? { |value| value.is_a? Symbol })
323
+ valid_array_of_strings = (value.is_a?(Array) && value.all? { |value| value.is_a? String })
324
+ unless valid_type || valid_array_of_symbols || valid_array_of_strings
316
325
  raise ValidationInvalidArgumentError, "The value `#{value}` provided to this validator must be a Symbol/String or an Array of Symbols/Strings"
317
326
  end
318
327
 
@@ -329,7 +338,10 @@ module DSLCompose
329
338
  end
330
339
 
331
340
  def validate_not_start_with value
332
- unless value.is_a?(Symbol) || value.is_a?(String) || (value.is_a?(Array) && value.all? { |value| value.is_a? Symbol }) || (value.is_a?(Array) && value.all? { |value| value.is_a? String })
341
+ valid_type = value.is_a?(Symbol) || value.is_a?(String)
342
+ valid_array_of_symbols = (value.is_a?(Array) && value.all? { |value| value.is_a? Symbol })
343
+ valid_array_of_strings = (value.is_a?(Array) && value.all? { |value| value.is_a? String })
344
+ unless valid_type || valid_array_of_symbols || valid_array_of_strings
333
345
  raise ValidationInvalidArgumentError, "The value `#{value}` provided to this validator must be a Symbol/String or an Array of Symbols/Strings"
334
346
  end
335
347
 
@@ -73,7 +73,7 @@ module DSLCompose
73
73
  # unless the argument is an array or a boolean, in which case it defaults
74
74
  # to an empty array or false
75
75
  if optional_argument.array
76
- @arguments[optional_argument.name] = []
76
+ @arguments[optional_argument.name] = [].freeze
77
77
  elsif optional_argument.type == :boolean
78
78
  @arguments[optional_argument.name] = false
79
79
  end
@@ -101,7 +101,7 @@ module DSLCompose
101
101
  ClassCoerce.new optional_arg[optional_argument_name]
102
102
  end
103
103
  else
104
- optional_arg[optional_argument_name]
104
+ optional_arg[optional_argument_name].freeze
105
105
  end
106
106
 
107
107
  if optional_arg_value.is_a?(Array) && !optional_argument.array
@@ -164,7 +164,7 @@ module DSLCompose
164
164
  # If the argument accepts an array of values, then automatically convert valid singular values
165
165
  # into an array.
166
166
  @arguments[optional_argument_name] = if optional_argument.array && !optional_arg_value.is_a?(Array)
167
- [optional_arg_value]
167
+ [optional_arg_value].freeze
168
168
  else
169
169
  optional_arg_value
170
170
  end
@@ -191,7 +191,7 @@ module DSLCompose
191
191
  ClassCoerce.new required_args[i]
192
192
  end
193
193
  else
194
- required_args[i]
194
+ required_args[i].freeze
195
195
  end
196
196
 
197
197
  if required_arg_value.is_a?(Array) && !required_argument.array
@@ -254,7 +254,7 @@ module DSLCompose
254
254
  # If the argument accepts an array of values, then automatically convert valid singular values
255
255
  # into an array.
256
256
  @arguments[argument_name] = if required_argument.array && !required_arg_value.is_a?(Array)
257
- [required_arg_value]
257
+ [required_arg_value].freeze
258
258
  else
259
259
  required_arg_value
260
260
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DSLCompose
4
- VERSION = "2.14.0"
4
+ VERSION = "2.14.2"
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.0
4
+ version: 2.14.2
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-06 00:00:00.000000000 Z
11
+ date: 2023-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: class_spec_helper