1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 24911:

* lib/irb/ext/multi-irb.rb: Fix arguments handling for shell commands
	  in irb; a patch by Yusuke Endoh [ruby-dev:35075]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@25814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2009-11-17 06:51:29 +00:00
parent d9abe0513d
commit 29929d799d
4 changed files with 17 additions and 7 deletions

View file

@ -1,3 +1,8 @@
Tue Nov 17 15:49:00 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* lib/irb/ext/multi-irb.rb: Fix arguments handling for shell commands
in irb; a patch by Yusuke Endoh [ruby-dev:35075]
Tue Nov 17 15:32:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_binmode): check if closed regardless platforms.

View file

@ -70,7 +70,7 @@ module IRB
end
def search(key)
case key
job = case key
when Integer
@jobs[key]
when Irb
@ -78,10 +78,10 @@ module IRB
when Thread
@jobs.assoc(key)
else
assoc = @jobs.find{|k, v| v.context.main.equal?(key)}
IRB.fail NoSuchJob, key if assoc.nil?
assoc
@jobs.find{|k, v| v.context.main.equal?(key)}
end
IRB.fail NoSuchJob, key if job.nil?
job
end
def delete(key)

View file

@ -126,9 +126,14 @@ module IRB
eval %[
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 << "*opts" if arity < 0
args << "&block"
args = args.join(", ")
eval %[
def #{cmd_name}(*opts, &b)
ExtendCommand::#{cmd_class}.execute(irb_context, *opts, &b)
def #{cmd_name}(\#{args})
ExtendCommand::#{cmd_class}.execute(irb_context, \#{args})
end
]
send :#{cmd_name}, *opts, &b

View file

@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2009-11-17"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20091117
#define RUBY_PATCHLEVEL 207
#define RUBY_PATCHLEVEL 208
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8