text-interpolator 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGM0ZDI0YTQ4MWU1MmQyNWY1YTlmZjAyOTc1Y2M0ODdjYmJmMTE0Yg==
4
+ MjdmMGU5OTNkMDYwZGFkN2JkYzdhNWVkZDY2MjIyZTRlYmMyNDAzMg==
5
5
  data.tar.gz: !binary |-
6
- Nzk1YmJlMjQ4MTFmODk2Y2I2ZTBiMTliZTU3ZDdmZjM1OTEwNDFiNw==
6
+ NTViZDRiMTQ0NzkxMDhkM2Y5ZGIwNWM3YjM5ODM3NTZlNzY3ZDIxNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NmViNDM5NjY4YmM2ZDQ4MDc4YTQ0ZTljMWQ1MWUzNWEyYjliOWI0Njk1NDcw
10
- N2NmYWM0Njg1MmNiMTI3Nzg2MmQ0NWJlOTQ0ZDBlMDJhMGNiZTJkNzQ1OTAz
11
- NmRmY2E2OGI3MGFkYzA4YTc2OTFlNzViZGZiMGNhNjEyNGQ3NTc=
9
+ NDRhZTVmYzNkYWY2OGQzNTg4ZTgzYjNmOWQwZmEyMWRkZWNjYzc2NmRhMDlm
10
+ YjAwYzYyYmRjY2EyMDQwNDE5M2YxMjFhYTIxNDkxYzE4ZjYyOTgzNDY2ZjBi
11
+ MDk4ZWE4NDMyZGJkNmY0Y2QwYzNjNmM2M2ZjZmExNjM3ZDg1MmI=
12
12
  data.tar.gz: !binary |-
13
- ZjM0MTcwNjViZDVmOWI2MWM0NzI5YmFjMDgyNWY0ZTM4N2E5NGNlNTE0Y2I3
14
- NWQwNDllN2U4MTBjNTI0NTQyZGRiODgwNDYzOGM2MGE5OTM1ZDhlNGE2MmQw
15
- MTEyYmE4MTM3ZGU1YmVlODZiNDJlOGMwZWJmYjQ0YTIwOTVkZmM=
13
+ ZWQ5NDM2M2UxZTcyMmQ5YjcxMDdiZTZkOGUwNjY4NTRjMDYzODE5ZjJiNWI0
14
+ Njg2N2JlNDBkMTEzZjg4MzZiNGE4NTE3MjBmNTM1ZDZmZGI4MTkxNTU5MmZk
15
+ ZGExOTg3MDEwMWIyMGFmMWNkYjUyOTEyMWIxMjkzZDU5NGQ3MzU=
data/CHANGES CHANGED
@@ -34,4 +34,8 @@
34
34
 
35
35
  == Version 1.1.2
36
36
 
37
+ * Bug fix.
38
+
39
+ == Version 1.1.3
40
+
37
41
  * Bug fix.
@@ -2,7 +2,13 @@ require 'stringio'
2
2
 
3
3
  class TextInterpolator
4
4
 
5
- attr_reader :errors
5
+ def errors
6
+ @errors ||= []
7
+ end
8
+
9
+ def clear_errors
10
+ errors.clear
11
+ end
6
12
 
7
13
  def interpolate object, env={}
8
14
  if object.kind_of? String
@@ -17,13 +23,14 @@ class TextInterpolator
17
23
  end
18
24
 
19
25
  def interpolate_string string, env={}
20
- @errors = []
26
+ clear_errors
21
27
 
22
28
  value = interpolate_system_variable string
23
29
 
24
30
  begin
25
31
  new_value = interpolate_variable value, env
26
32
  rescue KeyError => e
33
+ new_value = string
27
34
  errors << e.message
28
35
  end
29
36
 
@@ -31,7 +38,7 @@ class TextInterpolator
31
38
  end
32
39
 
33
40
  def interpolate_hash hash
34
- @errors = []
41
+ clear_errors
35
42
 
36
43
  content = interpolate_system_variables(hash)
37
44
 
@@ -1,3 +1,3 @@
1
1
  class TextInterpolator
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
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.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets