summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
author(no author) <(no author)@c9e70521-770b-0410-b9ac-ce6205b42a9f>2007-02-02 14:47:36 +0000
committer(no author) <(no author)@c9e70521-770b-0410-b9ac-ce6205b42a9f>2007-02-02 14:47:36 +0000
commit7d51b94ac92857fb71e2b33f74ce03530b83ec63 (patch)
tree620bc9407304e0b228d1d1b8582f559111226aa6 /lib
parentc0d6a4d75427b00dc8273572dbea925a802bc650 (diff)
downloaderubis-7d51b94ac92857fb71e2b33f74ce03530b83ec63.tar.gz
- [change] engine/eruby.rb: class Erubis::Eruby changed to include StringBufferEnhancer instead of ArrayBufferEnhancer
Diffstat (limited to 'lib')
-rw-r--r--lib/erubis/engine/eruby.rb4
-rw-r--r--lib/erubis/enhancer.rb2
-rw-r--r--lib/erubis/tiny.rb8
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/erubis/engine/eruby.rb b/lib/erubis/engine/eruby.rb
index 9390253..50ee07b 100644
--- a/lib/erubis/engine/eruby.rb
+++ b/lib/erubis/engine/eruby.rb
@@ -16,8 +16,8 @@ module Erubis
##
module RubyGenerator
include Generator
- #include StringBufferEnhancer
- include ArrayBufferEnhancer
+ #include ArrayBufferEnhancer
+ include StringBufferEnhancer
def init_generator(properties={})
super
diff --git a/lib/erubis/enhancer.rb b/lib/erubis/enhancer.rb
index fb5d226..f42cb2b 100644
--- a/lib/erubis/enhancer.rb
+++ b/lib/erubis/enhancer.rb
@@ -214,7 +214,7 @@ module Erubis
def add_postamble(src)
src << "\n" unless src[-1] == ?\n
- src << "_buf\n"
+ src << "_buf.to_s\n"
end
end
diff --git a/lib/erubis/tiny.rb b/lib/erubis/tiny.rb
index 64ea985..767de35 100644
--- a/lib/erubis/tiny.rb
+++ b/lib/erubis/tiny.rb
@@ -25,7 +25,7 @@ module Erubis
EMBEDDED_PATTERN = /<%(=+|\#)?(.*?)-?%>/m
def convert(input)
- src = "_buf = [];" # preamble
+ src = "_buf = '';" # preamble
pos = 0
input.scan(EMBEDDED_PATTERN) do |indicator, code|
match = Regexp.last_match
@@ -47,7 +47,7 @@ module Erubis
#src << " _buf << '" << escape_text(rest) << "';"
rest.gsub!(/['\\]/, '\\\\\&')
src << " _buf << '" << rest << "';" unless rest.empty?
- src << "\n_buf.join\n" # postamble
+ src << "\n_buf.to_s\n" # postamble
return src
end
@@ -87,7 +87,7 @@ module Erubis
EMBEDDED_PATTERN = /(^[ \t]*)?<\?rb(\s.*?)\?>([ \t]*\r?\n)?|@(!+)?\{(.*?)\}@/m
def convert(input)
- src = "_buf = [];" # preamble
+ src = "_buf = '';" # preamble
pos = 0
input.scan(EMBEDDED_PATTERN) do |lspace, stmt, rspace, indicator, expr|
match = Regexp.last_match
@@ -117,7 +117,7 @@ module Erubis
#src << " _buf << '" << escape_text(rest) << "';"
rest.gsub!(/['\\]/, '\\\\\&')
src << " _buf << '" << rest << "';" unless rest.empty?
- src << "\n_buf.join\n" # postamble
+ src << "\n_buf.to_s\n" # postamble
return src
end