erb-formatter 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 +4 -4
- data/lib/erb/formatter/version.rb +1 -1
- data/lib/erb/formatter.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30ad88d7ebea80bf22ba7b6801a3ed030803b64725d618df54570442b351987d
|
4
|
+
data.tar.gz: 64f2fb608592b02e4ca2ba009495eaba662bd09dba8da215f88a8800b9f14915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fc9ffcb7b3539d287f4cb318ebafdd8fcc422d6cb1e93950f5d39d28ff0febe1754212204eccdc657461a97329673f43556e483c281d0ecd8cc1df53a4755d8
|
7
|
+
data.tar.gz: 7a7313fd434fa69f286f4cab42d2a5ee4739dcc0a555acadf9727a1bb9f4ebbf3f063384d2c1eb923908aa9e82b74984a25e48dee15bc3343a68856be5943d3d
|
data/lib/erb/formatter.rb
CHANGED
@@ -222,6 +222,8 @@ class ERB::Formatter
|
|
222
222
|
|
223
223
|
def format_text(text)
|
224
224
|
p format_text: text if @debug
|
225
|
+
return unless text
|
226
|
+
|
225
227
|
starting_space = text.match?(/\A\s/)
|
226
228
|
|
227
229
|
final_newlines_count = text.match(/(\s*)\z/m).captures.last.count("\n")
|
@@ -289,7 +291,7 @@ class ERB::Formatter
|
|
289
291
|
if erb_scanner.scan_until(erb_tags_regexp)
|
290
292
|
p PRE_MATCH: [erb_pre_pos, '..', erb_scanner.pre_match] if @debug
|
291
293
|
erb_pre_match = erb_scanner.pre_match
|
292
|
-
erb_pre_match = erb_pre_match[erb_pre_pos..]
|
294
|
+
erb_pre_match = erb_pre_match[erb_pre_pos..].to_s
|
293
295
|
erb_pre_pos = erb_scanner.pos
|
294
296
|
|
295
297
|
erb_code = erb_tags[erb_scanner.captures.first]
|