general 2.0.1 → 2.0.2

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
  SHA1:
3
- metadata.gz: 7116b5cf6208b7332acd88c3f5f2d9a5fc7e3029
4
- data.tar.gz: 7dcc9fc52866b7f27f176055fd4ffab9d6734dbf
3
+ metadata.gz: f3811fd53824c1198a6fda65a7cdcef373f25385
4
+ data.tar.gz: b74c9fffde42b92ec0ca6ca768689109852382e5
5
5
  SHA512:
6
- metadata.gz: 1c17be95ef162c2ef46d3e2b5ee5b6106261cab92073ce5e3d9cd9600e141b06586ca70500b5039c0f8273cf3373af77af864d843c3686e3011fc18a32bc5990
7
- data.tar.gz: f0de9474c076cbf105cd29546346292efcb8f5bfc9e86661500edbda853e295d1606d0291b8b98aabfc8486aaeb3016b0ba09cdd4886703debc656ff870ec6a4
6
+ metadata.gz: aa543b2e2d7ed4be03377a05609cccc99f384de309131e6fabe29ade150d3ee34780eea61d9f043c03b1ef67ff44471c83c41821fdadc2cff5921a6102ae1cbc
7
+ data.tar.gz: d904d520a54b247ad76935d8f4330b90de91c76f3833a44ded9f7fdec1c6b3fd71b70e48541a42bbaa2e8201155ff1075502578d527df2dc708e4d841e035d0b
@@ -27,7 +27,7 @@ module General
27
27
  # Created: 7 - 1 - 2016
28
28
  class GText < GPartial
29
29
  # Regular expression that matches text partials
30
- REGEX = /\A[^@]+?(?=(@|\\@|\z))/m
30
+ REGEX = /\A[^@]+?(?=(@|\z))/m
31
31
 
32
32
  # The partial name of a text
33
33
  PTNAME = :__text
@@ -44,7 +44,7 @@ module General
44
44
  partial = partials.find { |partial| m = partial::REGEX.match(string) }
45
45
 
46
46
  # Raise error if no matching partial can be found
47
- raise GError.new("Unmatched partial at #{(string.length <= 5 ? string : string[0..5] + "...").inspect}") if partial.nil?
47
+ raise GError.new("Unmatched character at #{(string.length <= 5 ? string : string[0..5] + "...").inspect}") if partial.nil?
48
48
 
49
49
  # Add the partial to the array
50
50
  @partials << partial.new(m, @defaults)
@@ -113,7 +113,11 @@ module General
113
113
  Dir.chdir cwd
114
114
 
115
115
  # Return new GIO
116
- return self.new text, path
116
+ begin
117
+ return self.new text, path
118
+ rescue GError => e
119
+ raise GError.new "Error when parsing template file #{path}"
120
+ end
117
121
  end
118
122
 
119
123
  # Creates a GIO with the given template string and source filename
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: general
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anshul Kharbanda