зеркало из https://github.com/github/ruby.git
* ruby.c (process_options): script name should not be shown in an
error message before loaded. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
fe01a3434d
Коммит
0e4121aa5b
|
@ -1,3 +1,8 @@
|
|||
Wed Oct 14 13:24:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ruby.c (process_options): script name should not be shown in an
|
||||
error message before loaded.
|
||||
|
||||
Wed Oct 14 09:06:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* eval.c (ruby_run_node): need to call ruby_cleaup() always even
|
||||
|
|
4
ruby.c
4
ruby.c
|
@ -1341,8 +1341,6 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
|
|||
}
|
||||
}
|
||||
ruby_init_gems(!(opt->disable & DISABLE_BIT(gems)));
|
||||
rb_progname = opt->script_name;
|
||||
rb_vm_set_progname(rb_progname);
|
||||
ruby_set_argv(argc, argv);
|
||||
process_sflag(&opt->sflag);
|
||||
|
||||
|
@ -1387,6 +1385,8 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
|
|||
tree = load_file(parser, opt->script, 1, opt);
|
||||
});
|
||||
}
|
||||
rb_progname = opt->script_name;
|
||||
rb_vm_set_progname(rb_progname);
|
||||
if (opt->dump & DUMP_BIT(yydebug)) return Qtrue;
|
||||
|
||||
if (opt->ext.enc.index >= 0) {
|
||||
|
|
|
@ -311,4 +311,13 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||
ensure
|
||||
t.close(true) if t
|
||||
end
|
||||
|
||||
def test_notfound
|
||||
notexist = "./notexist.rb"
|
||||
rubybin = Regexp.quote(EnvUtil.rubybin)
|
||||
pat = /\A#{rubybin}:.* -- #{Regexp.quote(notexist)} \(LoadError\)\Z/
|
||||
assert_equal(false, File.exist?(notexist))
|
||||
assert_in_out_err(["-r", notexist, "-ep"], [], [], pat)
|
||||
assert_in_out_err([notexist], [], [], pat)
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче