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

Don't cause warnings, Pry.

This commit is contained in:
Rob Gleeson 2011-06-05 23:48:15 +01:00
parent 30d0b7b2f4
commit b2dcfba761
3 changed files with 5 additions and 5 deletions

View file

@ -46,7 +46,7 @@ class Pry
# @param [String] val The line of input.
# @return [Array] The command data and arg string pair
def command_matched(val)
_, cmd_data = commands.commands.find do |name, cmd_data|
_, cmd_data = commands.commands.find do |name, data|
/^#{convert_to_regex(name)}(?!\S)/ =~ val
end

View file

@ -12,8 +12,8 @@ class Pry
render_output(false, 0, Pry.color ? CodeRay.scan(eval_string, :ruby).term : eval_string)
end
command /amend-line-?(\d+)?/, "Experimental amend-line, where the N in amend-line-N represents line to replace. Aliases: %N",
:interpolate => false, :listing => "amend-line-N" do |line_number, replacement_line|
command(/amend-line-?(\d+)?/, "Experimental amend-line, where the N in amend-line-N represents line to replace. Aliases: %N",
:interpolate => false, :listing => "amend-line-N") do |line_number, replacement_line|
replacement_line = "" if !replacement_line
input_array = eval_string.each_line.to_a
line_num = line_number ? line_number.to_i : input_array.size - 1
@ -21,7 +21,7 @@ class Pry
eval_string.replace input_array.join
end
alias_command /%(\d+)?/, /amend-line-?(\d+)?/, ""
alias_command(/%(\d+)?/, /amend-line-?(\d+)?/, "")
command "hist", "Show and replay Readline history. Type `hist --help` for more info." do |*args|
Slop.parse(args) do |opt|

View file

@ -3,7 +3,7 @@ class Pry
Shell = Pry::CommandSet.new do
command /\.(.*)/, "All text following a '.' is forwarded to the shell.", :listing => ".<shell command>" do |cmd|
command(/\.(.*)/, "All text following a '.' is forwarded to the shell.", :listing => ".<shell command>") do |cmd|
if cmd =~ /^cd\s+(.+)/i
begin
Dir.chdir File.expand_path($1)