summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-05 09:41:18 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-05 09:41:18 +0000
commit005667167bf133737959beba7fc7532d1df8995b (patch)
tree0cdd407d8b4a483ffe9ee18d4a12ba7e24cb1502
parentccddc7b05df595f2514752cc4b38829a0b3444f0 (diff)
* lib/irb/extend-command.rb (IRB::ExtendCommandBundle::def_extend_command):
extension commands with optional parameters have been broken because of a spec change of UnboundMethod#arity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/irb/extend-command.rb8
-rw-r--r--version.h2
3 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 55359f7aaf..de812d3603 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Dec 5 14:29:49 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * lib/irb/extend-command.rb (IRB::ExtendCommandBundle::def_extend_command):
+ extension commands with optional parameters have been broken because of
+ a spec change of UnboundMethod#arity.
+
Sat Dec 5 14:24:10 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* lib/irb/extend-command.rb (IRB::ExtendCommandBundle::def_extend_command):
diff --git a/lib/irb/extend-command.rb b/lib/irb/extend-command.rb
index 84c4c05e15..862857466a 100644
--- a/lib/irb/extend-command.rb
+++ b/lib/irb/extend-command.rb
@@ -126,8 +126,12 @@ module IRB
def #{cmd_name}(*opts, &b)
require "#{load_file}"
arity = ExtendCommand::#{cmd_class}.instance_method(:execute).arity
- args = (1..arity).map {|i| "arg" + i.to_s }
- args << "*opts" if arity < 0
+ args = []
+ if arity < 0
+ args << "*opts"
+ arity = -arity - 1
+ end
+ args.unshift *(1..arity).map {|i| "arg" + i.to_s }
args << "&block"
args = args.join(", ")
eval <<-"EOS2", binding, __FILE__, __LINE__+1
diff --git a/version.h b/version.h
index 8923a4a234..22b9c47c2b 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 374
+#define RUBY_PATCHLEVEL 375
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1