Skip to content

Commit

Permalink
Remove Context#use_colorize cause it's redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Jun 27, 2022
1 parent 088b5f4 commit 6be5a08
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/irb/color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ module Color

class << self
def colorable?
# NOT using context.use_colorize? of IRB.conf[:MAIN_CONTEXT] because this method may be called before IRB::Irb#run
$stdout.tty? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb')) && IRB.conf.fetch(:USE_COLORIZE, true)
end

Expand Down
5 changes: 0 additions & 5 deletions lib/irb/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def initialize(irb, workspace = nil, input_method = nil)
else
@use_multiline = nil
end
@use_colorize = IRB.conf[:USE_COLORIZE]
@use_autocomplete = IRB.conf[:USE_AUTOCOMPLETE]
@verbose = IRB.conf[:VERBOSE]
@io = nil
Expand Down Expand Up @@ -186,8 +185,6 @@ def main
attr_reader :use_singleline
# Whether colorization is enabled or not.
#
# A copy of the default <code>IRB.conf[:USE_COLORIZE]</code>
attr_reader :use_colorize
# A copy of the default <code>IRB.conf[:USE_AUTOCOMPLETE]</code>
attr_reader :use_autocomplete
# A copy of the default <code>IRB.conf[:INSPECT_MODE]</code>
Expand Down Expand Up @@ -332,8 +329,6 @@ def main
alias use_readline use_singleline
# backward compatibility
alias use_readline? use_singleline
# Alias for #use_colorize
alias use_colorize? use_colorize
# Alias for #use_autocomplete
alias use_autocomplete? use_autocomplete
# Alias for #rc
Expand Down
1 change: 0 additions & 1 deletion test/irb/test_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ def test_output_to_pipe
end

def test_default_config
assert_equal(true, @context.use_colorize?)
assert_equal(true, @context.use_autocomplete?)
end

Expand Down

0 comments on commit 6be5a08

Please sign in to comment.