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:
parent
30d0b7b2f4
commit
b2dcfba761
3 changed files with 5 additions and 5 deletions
|
@ -46,7 +46,7 @@ class Pry
|
||||||
# @param [String] val The line of input.
|
# @param [String] val The line of input.
|
||||||
# @return [Array] The command data and arg string pair
|
# @return [Array] The command data and arg string pair
|
||||||
def command_matched(val)
|
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
|
/^#{convert_to_regex(name)}(?!\S)/ =~ val
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ class Pry
|
||||||
render_output(false, 0, Pry.color ? CodeRay.scan(eval_string, :ruby).term : eval_string)
|
render_output(false, 0, Pry.color ? CodeRay.scan(eval_string, :ruby).term : eval_string)
|
||||||
end
|
end
|
||||||
|
|
||||||
command /amend-line-?(\d+)?/, "Experimental amend-line, where the N in amend-line-N represents line to replace. Aliases: %N",
|
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|
|
:interpolate => false, :listing => "amend-line-N") do |line_number, replacement_line|
|
||||||
replacement_line = "" if !replacement_line
|
replacement_line = "" if !replacement_line
|
||||||
input_array = eval_string.each_line.to_a
|
input_array = eval_string.each_line.to_a
|
||||||
line_num = line_number ? line_number.to_i : input_array.size - 1
|
line_num = line_number ? line_number.to_i : input_array.size - 1
|
||||||
|
@ -21,7 +21,7 @@ class Pry
|
||||||
eval_string.replace input_array.join
|
eval_string.replace input_array.join
|
||||||
end
|
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|
|
command "hist", "Show and replay Readline history. Type `hist --help` for more info." do |*args|
|
||||||
Slop.parse(args) do |opt|
|
Slop.parse(args) do |opt|
|
||||||
|
|
|
@ -3,7 +3,7 @@ class Pry
|
||||||
|
|
||||||
Shell = Pry::CommandSet.new do
|
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
|
if cmd =~ /^cd\s+(.+)/i
|
||||||
begin
|
begin
|
||||||
Dir.chdir File.expand_path($1)
|
Dir.chdir File.expand_path($1)
|
||||||
|
|
Loading…
Reference in a new issue