parameter_substitution 3.0.0.pre.2 → 3.0.0

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: 470d5abf687490b1aa41c54794478f9c0ffa4fd904b360cab55b60351eb2e9f7
4
- data.tar.gz: acda768f6ff4e072b6769cb4cbb3d82cf81951ce0cc9a210a5fc541f04e006a9
3
+ metadata.gz: 2982671f39e3663e9749b8a5e81aae3b4e34a6b56b8a4d976ed4ccc349d002d8
4
+ data.tar.gz: a381620ec380bb1b879b6b771b61b86b35602569b3974c4243ffbea94e0a6e99
5
5
  SHA512:
6
- metadata.gz: 360e3825227457357b8c4a244862f889171d2f4c369e82b3a2907f2d8114297da9094fb4914c20f8885b42f544daf6563e0075f8fc9f02a4071ac2fc0ebb0d79
7
- data.tar.gz: c339269735f7ba01a811c068a06ac5bb8a4100848eca49cc01f5e8903854c8cca570def8233a6cc0ee464b9525724d3c580a9f10fe5ff8b360d32e2457356508
6
+ metadata.gz: e84595532cc14d0880e11a1a2a87818c9b9f6ffe0868ae90ac512f138ada87f3faa09b573072cbd230afabb6a71feeb9ba3bddb7aa20a432fe5964bcc1d3ff9b
7
+ data.tar.gz: a3d95534125a8ebf276ed79f4fcf454f9abf570f897996dd839a5a927ddeab8b72a67cc602645eb2c7c908ec5f0f0cebbba78e96ac01f4871afe343e0f53cbc8
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ParameterSubstitution
4
- VERSION = "3.0.0-2"
4
+ VERSION = "3.0.0"
5
5
  end
@@ -81,6 +81,17 @@ class ParameterSubstitution
81
81
 
82
82
  private
83
83
 
84
+ VALID_CONTEXT_OVERRIDE_KEYS = %i[
85
+ required_parameters
86
+ parameter_start
87
+ parameter_end
88
+ destination_encoding
89
+ allow_unknown_replacement_parameters
90
+ allow_nil
91
+ allow_unmatched_parameter_end
92
+ ].to_set
93
+ private_constant :VALID_CONTEXT_OVERRIDE_KEYS
94
+
84
95
  # Build context with optional overrides
85
96
  # @param [String] string_with_tokens The input string containing tokens
86
97
  # @param [Hash] mapping The mapping of parameters to values
@@ -95,7 +106,9 @@ class ParameterSubstitution
95
106
  mapping: mapping
96
107
  }
97
108
 
98
- ParameterSubstitution::Context.new(**context_overrides.merge(base_options))
109
+ symbolized_overrides = context_overrides.transform_keys(&:to_sym)
110
+
111
+ ParameterSubstitution::Context.new(**symbolized_overrides.merge(base_options))
99
112
  end
100
113
 
101
114
  # @param [Hash] context_overrides The overrides to validate
@@ -103,21 +116,11 @@ class ParameterSubstitution
103
116
  def validate_context_overrides!(context_overrides)
104
117
  return if context_overrides.empty?
105
118
 
106
- valid_keys = %i[
107
- required_parameters
108
- parameter_start
109
- parameter_end
110
- destination_encoding
111
- allow_unknown_replacement_parameters
112
- allow_nil
113
- allow_unmatched_parameter_end
114
- ].to_set
115
-
116
- invalid_keys = context_overrides.keys.reject { |key| valid_keys.include?(key.to_sym) }
119
+ invalid_keys = context_overrides.keys.reject { |key| VALID_CONTEXT_OVERRIDE_KEYS.include?(key.to_sym) }
117
120
 
118
121
  if invalid_keys.any?
119
122
  invalid_keys_list = invalid_keys.join(", ")
120
- valid_keys_list = valid_keys.sort.join(", ")
123
+ valid_keys_list = VALID_CONTEXT_OVERRIDE_KEYS.sort.join(", ")
121
124
  raise ArgumentError, "Invalid context_overrides keys: #{invalid_keys_list}. Valid keys are: #{valid_keys_list}"
122
125
  end
123
126
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parameter_substitution
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.2
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca Development
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-18 00:00:00.000000000 Z
11
+ date: 2025-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport