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

command: delete deprecated #text

This commit is contained in:
Kyrylo Silin 2018-11-08 14:44:36 +08:00
parent 51ab3e1a49
commit 784bda7804
2 changed files with 12 additions and 17 deletions

View file

@ -252,18 +252,6 @@ class Pry
command_set.to_hash
end
#
# @deprecated
# Please use black(), white(), etc directly instead (as you would with helper
# functions from BaseHelpers and CommandHelpers)
#
# @return [Module]
# Returns Pry::Helpers::Text
#
def text
Pry::Helpers::Text
end
def void
VOID_VALUE
end
@ -319,7 +307,10 @@ class Pry
collision_type ||= 'local-variable' if arg_string.match(%r{\A\s*[-+*/%&|^]*=})
if collision_type
output.puts "#{text.bold('WARNING:')} Calling Pry command '#{command_match}', which conflicts with a #{collision_type}.\n\n"
output.puts(
"#{Helpers::Text.bold('WARNING:')} Calling Pry command '#{command_match}', " \
"which conflicts with a #{collision_type}.\n\n"
)
end
rescue Pry::RescuableException
end
@ -425,9 +416,13 @@ class Pry
unless dependencies_met?
gems_needed = Array(command_options[:requires_gem])
gems_not_installed = gems_needed.select { |g| !Rubygem.installed?(g) }
output.puts "\nThe command '#{command_name}' is #{text.bold("unavailable")} because it requires the following gems to be installed: #{(gems_not_installed.join(", "))}"
output.puts "-"
output.puts "Type `install-command #{command_name}` to install the required gems and activate this command."
output.puts(<<WARN)
The command #{Helpers::Text.bold(command_name)} is unavailable because it requires the following
gems to be installed: #{(gems_not_installed.join(", "))}
Type #{Helpers::Text.bold('install-command ' + command_name)} to install the required gems
and activate this command.
WARN
return void
end

View file

@ -36,7 +36,7 @@ class Pry
if exception.respond_to? :cause
cause = exception.cause
while cause
output.puts "#{text.bold('Caused by:')} #{cause.class}: #{cause}\n--"
output.puts "#{bold('Caused by:')} #{cause.class}: #{cause}\n--"
if opts.verbose?
output.puts with_line_numbers(cause.backtrace)
else