From eb73b23245fdd9406329fc5844d7d80e60eed5b1 Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Thu, 26 Jul 2012 00:32:19 +0300 Subject: [PATCH] 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 --- lib/pry/command.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/pry/command.rb b/lib/pry/command.rb index a6db6b57..05e5159c 100644 --- a/lib/pry/command.rb +++ b/lib/pry/command.rb @@ -209,7 +209,6 @@ class Pry 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 @@ class Pry 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 @@ class Pry 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