text-interpolator 1.1.7 → 1.1.8
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/CHANGES +1 -1
- data/lib/text_interpolator/text_interpolator.rb +1 -5
- data/lib/text_interpolator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ce45d986f4fc09df277c1f39581c3647764908d
|
4
|
+
data.tar.gz: a8b9db64372214261f93dee30fe3511da2bac3fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f0dd9506b4434bdddcf4c4f15a850d4e79365cc6443a5904b52334c158df8db0c1938c76ec725d3d24a3f51203c7e6604f3925d20ba8d0442ce943e84f2573d
|
7
|
+
data.tar.gz: 9e9373f5d10496b8498e8be6a560dc66c4e12c3f8ed6397a8cfe954ce921fc73a6a5df3b730b07239f2c693c33159ffaca9c5fe06271e09fcf8280bdbaed0f36
|
data/CHANGES
CHANGED
@@ -23,8 +23,6 @@ class TextInterpolator
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def interpolate_string string, env={}
|
26
|
-
clear_errors
|
27
|
-
|
28
26
|
env = symbolize_keys env
|
29
27
|
|
30
28
|
value = interpolate_system_variable string
|
@@ -42,8 +40,6 @@ class TextInterpolator
|
|
42
40
|
end
|
43
41
|
|
44
42
|
def interpolate_hash hash
|
45
|
-
clear_errors
|
46
|
-
|
47
43
|
content = interpolate_system_variables(hash)
|
48
44
|
|
49
45
|
var_table = build_variables_table(content) # one-dimensional collection of variables
|
@@ -172,7 +168,7 @@ class TextInterpolator
|
|
172
168
|
end
|
173
169
|
|
174
170
|
def interpolate_variable value, env
|
175
|
-
new_value = value.gsub(/#\{(
|
171
|
+
new_value = value.gsub(/#\{([a-zA-Z\d\._]*)\}/, '%{\1}').gsub(/%\{([a-zA-Z\d\._]*)\}/) {|s| s.gsub(/\s+/, '') }
|
176
172
|
|
177
173
|
StringIO.new(new_value).read % env
|
178
174
|
end
|