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:
parent
ba18b0c6cb
commit
62b368dc4a
2 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue