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

Explicitly extract help from Options object [Fixes #381]

Without this, when the default implementation of puts on ruby-1.9.2
tries to call .to_ary on the options object, you get:

ArgumentError: no id given
gems/ruby-1.9.2-p290@pry/gems/slop-2.4.2/lib/slop.rb:705:in `method_missing'
This commit is contained in:
Conrad Irwin 2011-12-23 18:34:24 +00:00
parent a068e22414
commit 322460f06d
4 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,7 @@ class Pry
USAGE
opt.on :h, :help, "This message." do
output.puts opt
output.puts opt.help
end
end
@ -74,7 +74,7 @@ class Pry
opt.on :f, "file", 'The file to replay in context.', true
opt.on :o, "open", 'When used with the -m switch, it plays the entire method except the last line, leaving the method definition "open". `amend-line` can then be used to modify the method.'
opt.on :h, :help, "This message." do
output.puts opt
output.puts opt.help
end
end

View file

@ -57,7 +57,7 @@ class Pry
opt.on :l, "line-numbers", "Show line numbers."
opt.on :f, :flood, "Do not use a pager to view text longer than one screen."
opt.on :h, :help, "This message." do
output.puts opt
output.puts opt.help
end
end
@ -111,7 +111,7 @@ class Pry
opt.on :n, :"no-reload", "Don't automatically reload the edited code"
opt.on :r, :reload, "Reload the edited code immediately (default for ruby files)"
opt.on :h, :help, "This message." do
output.puts opt
output.puts opt.help
end
end
next if opts.present?(:help)
@ -214,7 +214,7 @@ class Pry
opt.on "no-jump", "Do not fast forward editor to first line of method."
opt.on :p, :patch, "Instead of editing the method's file, try to edit in a tempfile and apply as a monkey patch."
opt.on :h, :help, "This message." do
output.puts opt
output.puts opt.help
end
end

View file

@ -74,7 +74,7 @@ class Pry
opt.on :t, :type, "The specific file type for syntax higlighting (e.g ruby, python)", true, :as => Symbol
opt.on :f, :flood, "Do not use a pager to view text longer than one screen."
opt.on :h, :help, "This message." do
output.puts opt
output.puts opt.help
end
end

View file

@ -22,7 +22,7 @@ class Pry
yield opt
opt.on :h, :help, "This message" do
output.puts opt.to_s
output.puts opt.help
throw :command_done
end
end