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

Add a "default" pseudo-colour

This commit is contained in:
Conrad Irwin 2011-10-09 21:41:33 -07:00
parent ccb399a93d
commit 65e6e6a788
3 changed files with 15 additions and 5 deletions

View file

@ -46,7 +46,7 @@ class Pry
index == 0 ? text.bright_green(spec.version.to_s) : text.green(spec.version.to_s)
end
output.puts "#{text.white gem} (#{versions.join ', '})"
output.puts "#{text.default gem} (#{versions.join ', '})"
end
end

View file

@ -50,6 +50,16 @@ class Pry
Pry.color ? "\e[1m#{text}\e[0m" : text.to_s
end
# Returns _text_ in the default foreground colour.
# Use this instead of "black" or "white" when you mean absence of colour.
#
# @param [String, #to_s]
# @return [String] _text_
def default(text)
text.to_s
end
alias_method :bright_default, :bold
# Executes _block_ with _Pry.color_ set to false.
#
# @param [Proc]

View file

@ -212,22 +212,22 @@ class Pry
config.ls ||= OpenStruct.new({
:heading_color => :grey,
:public_method_color => :black,
:public_method_color => :default,
:private_method_color => :green,
:protected_method_color => :yellow,
:method_missing_color => :bright_red,
:local_var_color => :black,
:local_var_color => :default,
:pry_var_color => :red, # e.g. _, _pry_, _file_
:instance_var_color => :blue, # e.g. @foo
:class_var_color => :bright_blue, # e.g. @@foo
:global_var_color => :black, # e.g. $CODERAY_DEBUG, $eventmachine_library
:global_var_color => :default, # e.g. $CODERAY_DEBUG, $eventmachine_library
:builtin_global_color => :cyan, # e.g. $stdin, $-w, $PID
:pseudo_global_color => :cyan, # e.g. $~, $1..$9, $LAST_MATCH_INFO
:constant_color => :black, # e.g. VERSION, ARGF
:constant_color => :default, # e.g. VERSION, ARGF
:class_constant_color => :blue, # e.g. Object, Kernel
:exception_constant_color => :magenta, # e.g. Exception, RuntimeError