1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/erb.rb: new method ERB#filename(=). [ruby-dev:22208]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2003-12-10 09:07:52 +00:00
parent ba18b0c6cb
commit 62b368dc4a
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Wed Dec 10 18:07:25 2003 Minero Aoki <aamine@loveruby.net>
* lib/erb.rb: new method ERB#filename(=). [ruby-dev:22208]
Wed Dec 10 17:54:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c (strio_read): do not set EOF flag when

View file

@ -387,8 +387,10 @@ class ERB
compiler = ERB::Compiler.new(trim_mode)
set_eoutvar(compiler, eoutvar)
@src = compiler.compile(str)
@filename = nil
end
attr :src
attr_reader :src
attr_accessor :filename
def set_eoutvar(compiler, eoutvar = '_erbout')
compiler.put_cmd = "#{eoutvar}.concat"
@ -416,7 +418,7 @@ class ERB
}
return th.value
else
return eval(@src, b)
return eval(@src, b, (@filename || '(erb)'), 1)
end
end