ruby-changes:14199
From: yugui <ko1@a...>
Date: Sat, 5 Dec 2009 18:49:34 +0900 (JST)
Subject: [ruby-changes:14199] Ruby:r26020 (ruby_1_9_1): * lib/irb/extend-command.rb (IRB::ExtendCommandBundle::def_extend_command):
yugui 2009-12-05 18:41:11 +0900 (Sat, 05 Dec 2009) New Revision: 26020 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26020 Log: * lib/irb/extend-command.rb (IRB::ExtendCommandBundle::def_extend_command): gives eval a source location for readability of backtrace. * lib/irb/extend-command.rb (IRB::ContextExtender::def_extend_command): ditto * lib/irb/extend-command.rb (IRB::MethodExtender::def_pre_proc): ditto * lib/irb/extend-command.rb (IRB::MethodExtender::def_post_proc): ditto Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/lib/irb/extend-command.rb branches/ruby_1_9_1/version.h Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 26019) +++ ruby_1_9_1/ChangeLog (revision 26020) @@ -1,3 +1,17 @@ +Sat Dec 5 14:24:10 2009 Yuki Sonoda (Yugui) <yugui@y...> + + * lib/irb/extend-command.rb (IRB::ExtendCommandBundle::def_extend_command): + gives eval a source location for readability of backtrace. + + * lib/irb/extend-command.rb (IRB::ContextExtender::def_extend_command): + ditto + + * lib/irb/extend-command.rb (IRB::MethodExtender::def_pre_proc): + ditto + + * lib/irb/extend-command.rb (IRB::MethodExtender::def_post_proc): + ditto + Tue Jul 21 21:37:19 2009 Keiju Ishitsuka <keiju@e...> * lib/irb/cmd/help.rb: fixed irb's "help" command. [ruby-core:22310]. Index: ruby_1_9_1/lib/irb/extend-command.rb =================================================================== --- ruby_1_9_1/lib/irb/extend-command.rb (revision 26019) +++ ruby_1_9_1/lib/irb/extend-command.rb (revision 26020) @@ -122,28 +122,28 @@ end if load_file - eval %[ + eval <<-"EOS", binding, __FILE__, __LINE__+1 def #{cmd_name}(*opts, &b) require "#{load_file}" arity = ExtendCommand::#{cmd_class}.instance_method(:execute).arity - args = (1..arity.abs).map {|i| "arg" + i.to_s } + args = (1..arity).map {|i| "arg" + i.to_s } args << "*opts" if arity < 0 args << "&block" args = args.join(", ") - eval %[ + eval <<-"EOS2", binding, __FILE__, __LINE__+1 def #{cmd_name}(\#{args}) ExtendCommand::#{cmd_class}.execute(irb_context, \#{args}) end - ] + EOS2 send :#{cmd_name}, *opts, &b end - ] + EOS else - eval %[ + eval <<-"EOS", binding, __FILE__, __LINE__+1 def #{cmd_name}(*opts, &b) ExtendCommand::#{cmd_class}.execute(irb_context, *opts, &b) end - ] + EOS end for ali, flag in aliases @@ -207,7 +207,7 @@ end def self.def_extend_command(cmd_name, load_file, *aliases) - Context.module_eval %[ + Context.module_eval <<-"EOS", __FILE__, __LINE__+1 def #{cmd_name}(*opts, &b) Context.module_eval {remove_method(:#{cmd_name})} require "#{load_file}" @@ -216,7 +216,7 @@ for ali in aliases alias_method ali, cmd_name end - ] + EOS end CE.install_extend_commands @@ -228,13 +228,13 @@ extend_method = extend_method.to_s alias_name = new_alias_name(base_method) - module_eval %[ + module_eval <<-"EOS", __FILE__, __LINE__+1 alias_method alias_name, base_method def #{base_method}(*opts) send :#{extend_method}, *opts send :#{alias_name}, *opts end - ] + EOS end def def_post_proc(base_method, extend_method) @@ -242,13 +242,13 @@ extend_method = extend_method.to_s alias_name = new_alias_name(base_method) - module_eval %[ + module_eval <<-"EOS", __FLIE__, __LINE__+1 alias_method alias_name, base_method def #{base_method}(*opts) send :#{alias_name}, *opts send :#{extend_method}, *opts end - ] + EOS end # return #{prefix}#{name}#{postfix}<num> Index: ruby_1_9_1/version.h =================================================================== --- ruby_1_9_1/version.h (revision 26019) +++ ruby_1_9_1/version.h (revision 26020) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 373 +#define RUBY_PATCHLEVEL 374 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/