* 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
Родитель ba18b0c6cb
Коммит 62b368dc4a
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -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