parameter_substitution 2.1.0 → 3.0.0.pre.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 +4 -4
- data/lib/parameter_substitution/version.rb +1 -1
- data/lib/parameter_substitution.rb +20 -12
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7d5937f29714849ed0f6dcb964e0976a010cf106cf0c7a3abc8fc431d93b770
|
|
4
|
+
data.tar.gz: b5410f60e594f40f6becd805a050b0e385ad58f71e049a421b6a7c07f76d8542
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 385b533cc23ad5c51c9e3e8de2aa4898617b375d1692523cd4f1c34df0a20256cb074e73fb7d5c7303b18540797164c58e2fca212392b35a74d685439c31c014
|
|
7
|
+
data.tar.gz: 8b4f90595113426f82ca45c691056f0fcb602bdad90df6f0e15e7996edb0d2f60b3f09fc432a0defd023ef5a8f5ce048e6482b792340f29a1e0daa395c8afc46
|
|
@@ -63,27 +63,35 @@ class ParameterSubstitution
|
|
|
63
63
|
ParameterSubstitution.config = config
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
def find_tokens(string_with_tokens, mapping: {},
|
|
67
|
-
|
|
66
|
+
def find_tokens(string_with_tokens, mapping: {}, context_overrides: nil)
|
|
67
|
+
context = build_context(string_with_tokens, mapping, context_overrides)
|
|
68
|
+
parse_expression(context).substitution_parameter_names
|
|
68
69
|
end
|
|
69
70
|
|
|
70
|
-
def find_formatters(string_with_tokens, mapping: {},
|
|
71
|
-
|
|
71
|
+
def find_formatters(string_with_tokens, mapping: {}, context_overrides: nil)
|
|
72
|
+
context = build_context(string_with_tokens, mapping, context_overrides)
|
|
73
|
+
parse_expression(context).method_names
|
|
72
74
|
end
|
|
73
75
|
|
|
74
|
-
def find_warnings(string_with_tokens, mapping: {},
|
|
75
|
-
|
|
76
|
+
def find_warnings(string_with_tokens, mapping: {}, context_overrides: nil)
|
|
77
|
+
context = build_context(string_with_tokens, mapping, context_overrides)
|
|
78
|
+
parse_expression(context).parameter_and_method_warnings || []
|
|
76
79
|
end
|
|
77
80
|
|
|
78
81
|
private
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
# Build context with optional overrides
|
|
84
|
+
# @param [String] string_with_tokens The input string containing tokens
|
|
85
|
+
# @param [Hash] mapping The mapping of parameters to values
|
|
86
|
+
# @param [Hash, nil] context_overrides Optional overrides for context attributes
|
|
87
|
+
# @return [ParameterSubstitution::Context] The constructed context
|
|
88
|
+
def build_context(string_with_tokens, mapping, context_overrides)
|
|
89
|
+
base_options = {
|
|
82
90
|
input: string_with_tokens,
|
|
83
|
-
mapping
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
)
|
|
91
|
+
mapping: mapping
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
ParameterSubstitution::Context.new(**base_options.merge(context_overrides || {}))
|
|
87
95
|
end
|
|
88
96
|
|
|
89
97
|
def parse_expression(context)
|
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:
|
|
4
|
+
version: 3.0.0.pre.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-
|
|
11
|
+
date: 2025-11-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|