Skip to content
Browse files

Make use of `Command#text` method

Use `Command#text` method instead of `Pry::Helpers::Text` to make the
text bold , since that's just an alias and easier to read.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
  • Loading branch information...
1 parent 49867f3 commit eb73b23245fdd9406329fc5844d7d80e60eed5b1 @kyrylo kyrylo committed
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/pry/command.rb
View
5 lib/pry/command.rb
@@ -209,7 +209,6 @@ def void
include Pry::Helpers::BaseHelpers
include Pry::Helpers::CommandHelpers
-
# Instantiate a command, in preparation for calling it.
# @param [Hash] context The runtime context to use with this command.
def initialize(context={})
@@ -256,7 +255,7 @@ def check_for_command_collision(command_match, arg_string)
collision_type ||= 'local-variable' if arg_string.match(%r{\A\s*[-+*/%&|^]*=})
if collision_type
- output.puts "#{Pry::Helpers::Text.bold('WARNING:')} Calling Pry command '#{command_match}'," +
+ output.puts "#{text.bold('WARNING:')} Calling Pry command '#{command_match}'," +
"which conflicts with a #{collision_type}.\n\n"
end
rescue Pry::RescuableException
@@ -359,7 +358,7 @@ def call_safely(*args)
unless dependencies_met?
gems_needed = Array(command_options[:requires_gem])
gems_not_installed = gems_needed.select { |g| !gem_installed?(g) }
- output.puts "\nThe command '#{command_name}' is #{Helpers::Text.bold("unavailable")} because it requires the following gems to be installed: #{(gems_not_installed.join(", "))}"
+ 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."
return void

0 comments on commit eb73b23

Please sign in to comment.
Something went wrong with that request. Please try again.