Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix line off by one issue in Erubis under 1.9

  • Loading branch information...
commit 5af596f33d0620c99147ae52cfa9827344473d76 1 parent 0675f80
@rtomayko authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/tilt.rb
View
11 lib/tilt.rb
@@ -262,6 +262,17 @@ def compile!
Erubis::Eruby.class_eval(%Q{def add_preamble(src) src << "@_out_buf = _buf = '';" end})
@engine = ::Erubis::Eruby.new(data, options)
end
+
+ private
+
+ # Erubis doesn't have ERB's line-off-by-one under 1.9 problem. Override
+ # and adjust back.
+ if RUBY_VERSION >= '1.9.0'
+ def local_assignment_code(locals)
+ source, offset = super
+ [source, offset - 1]
+ end
+ end
end
register 'erubis', ErubisTemplate
Please sign in to comment.
Something went wrong with that request. Please try again.