* ext/strscan/strscan.c: don't use rb_eval_string, it defines classes under the module when required in module clauses. [ruby-dev:22951]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2004-02-18 17:42:54 +00:00
Родитель 6f77e4b4ba
Коммит e55e640a6f
2 изменённых файлов: 14 добавлений и 3 удалений

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

@ -1,6 +1,13 @@
Thu Feb 19 02:42:19 2004 Minero Aoki <aamine@loveruby.net>
* ext/strscan/strscan.c: don't use rb_eval_string, it defines
classes under the module when required in module clauses.
[ruby-dev:22951]
Thu Feb 19 02:37:28 2004 Minero Aoki <aamine@loveruby.net>
* ext/strscan/strscan.c: merge documentation from 1.8 branch. Thanks Gavin Sinclair.
* ext/strscan/strscan.c: merge documentation from 1.8 branch.
Thanks Gavin Sinclair.
Wed Feb 19 00:20:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>

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

@ -1245,10 +1245,14 @@ inspect2(p)
void
Init_strscan()
{
volatile VALUE tmp;
ID id_scanerr = rb_intern("ScanError");
VALUE tmp;
StringScanner = rb_define_class("StringScanner", rb_cObject);
ScanError = rb_eval_string("class StringScanner; class Error < StandardError; end; end; ScanError = StringScanner::Error unless defined?(ScanError); StringScanner::Error");
ScanError = rb_define_class_under(StringScanner, "Error", rb_eStandardError);
if (!rb_const_defined(rb_cObject, id_scanerr)) {
rb_const_set(rb_cObject, id_scanerr, ScanError);
}
tmp = rb_str_new2(STRSCAN_VERSION);
rb_obj_freeze(tmp);
rb_const_set(StringScanner, rb_intern("Version"), tmp);