serbea 0.4.0 → 0.4.1

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
  SHA256:
3
- metadata.gz: 18caf5a2b809d0cf64dc3d6ed6b05186ec6c1cdbb6faf4c3c8f01ec607f65918
4
- data.tar.gz: f94c3df3de70cbfbac1cd481ee41706beff8a0cfc78a23ee54b13ec4345d39fe
3
+ metadata.gz: 2403adca3b4cbb2e82ad7bb758df50c04257d45f1b303a1a9b03a15453d66953
4
+ data.tar.gz: 1ccfc568da131dd13d9cc627b05fb13577854d4edfbf2ea0a3353b69b097a5f2
5
5
  SHA512:
6
- metadata.gz: 27f9d07b128e5b7537be078b8056add0da4caed1304375a3f2decbd00d14232a60ade8d07817f7c520f2479f78957aff9774ba980391edd4643bb1c4b72454b2
7
- data.tar.gz: dfe541a83671109526c0b9069ef2054dfb9a57c21474180d572ccba8cfcf13b3b59cab5a58e3e9b70e3952ca00ff46ab239a0fdf5f260a07e7956d646ef059b9
6
+ metadata.gz: 22633765cd7a2ce0020cdd27708e2bc349cc9ccd168d1d15f7f135926d4a0333098fa05ebd34b7f77811371620f01860d7876935e0be47160e03714f8efc01d6
7
+ data.tar.gz: 9c5a097fe9fdb43738e3d61f3d61d973d15bff640ad3ae85cc9fb670e61c4a31154f67522bf9651f65ec6a1e67bf755d1b50ea6bc2508b42dfe9dd6f24c627d3
@@ -76,6 +76,7 @@ module Serbea
76
76
 
77
77
  buff << text
78
78
  if code.length > 0
79
+ original_line_length = code.lines.size
79
80
  processed_filters = false
80
81
 
81
82
  code = code.gsub('\|', "__PIPE_C__")
@@ -90,7 +91,13 @@ module Serbea
90
91
 
91
92
  pipeline_suffix = processed_filters ? ") %}" : ")) %}"
92
93
 
93
- buff << subs.sub("{{", "{%= pipeline(self, (").sub("}}", pipeline_suffix).gsub("__PIPE_C__", '\|')
94
+ subs = subs.sub("{{", "{%= pipeline(self, (").sub("}}", pipeline_suffix).gsub("__PIPE_C__", '\|')
95
+
96
+ buff << subs
97
+
98
+ (original_line_length - subs.lines.size).times do
99
+ buff << "\n{% %}" # preserve original line length
100
+ end
94
101
  end
95
102
  end
96
103
 
@@ -113,6 +120,8 @@ module Serbea
113
120
  code.sub! /^\{%@/, ""
114
121
  code.sub! /%}$/, ""
115
122
  unless ["end", ""].include? code.strip
123
+ original_line_length = code.lines.size
124
+
116
125
  pieces = code.split(" ")
117
126
  if pieces[0].start_with?(/[A-Z]/) # Ruby class name
118
127
  pieces[0].prepend " "
@@ -136,6 +145,9 @@ module Serbea
136
145
  pieces.last << ")"
137
146
  buff << "{%= #{self.class.render_directive}#{pieces.join(" ")} %}"
138
147
  end
148
+ (original_line_length - 1).times do
149
+ buff << "\n{% %}" # preserve original directive line length
150
+ end
139
151
  else
140
152
  buff << "{%: end %}"
141
153
  end
@@ -1,3 +1,3 @@
1
1
  module Serbea
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serbea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team