text-interpolator 1.1.7 → 1.1.8

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
  SHA1:
3
- metadata.gz: e26bf5c71c891d3838b25a290f597ef5390146f0
4
- data.tar.gz: 604093a12a2843ccf75c2246c904efa57841520e
3
+ metadata.gz: 8ce45d986f4fc09df277c1f39581c3647764908d
4
+ data.tar.gz: a8b9db64372214261f93dee30fe3511da2bac3fa
5
5
  SHA512:
6
- metadata.gz: 0b2be5d598f0473900f6ebef41fe5939cbc0c28cd309a6299d4ca20c7d407cfd8049236783fbfc160450d5163e9e2a7b0fd8b83b70e440363e34a8f60b4e9416
7
- data.tar.gz: dc94f4b54cb6b6ed55b4892806adb00bfaec018d804b7a77918da51ecedcb57bfff1c7cb850ac111bb6d040fa4f48cbf698ac550ab5f26549f99d0f8080623ce
6
+ metadata.gz: 6f0dd9506b4434bdddcf4c4f15a850d4e79365cc6443a5904b52334c158df8db0c1938c76ec725d3d24a3f51203c7e6604f3925d20ba8d0442ce943e84f2573d
7
+ data.tar.gz: 9e9373f5d10496b8498e8be6a560dc66c4e12c3f8ed6397a8cfe954ce921fc73a6a5df3b730b07239f2c693c33159ffaca9c5fe06271e09fcf8280bdbaed0f36
data/CHANGES CHANGED
@@ -48,6 +48,6 @@
48
48
 
49
49
  * Bug fix.
50
50
 
51
- == Version 1.1.6, 1.1.7
51
+ == Version 1.1.6, 1.1.7, 1.1.8
52
52
 
53
53
  * Bug fix.
@@ -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(/#\{(.*)\}/, '%{\1}').gsub(/%\{(.*)\}/) {|s| s.gsub(/\s+/, '') }
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
@@ -1,3 +1,3 @@
1
1
  class TextInterpolator
2
- VERSION = "1.1.7"
2
+ VERSION = "1.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text-interpolator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets