Skip to content

Commit

Permalink
Merge pull request #38 from amazing-print/colorize-20200608
Browse files Browse the repository at this point in the history
Remove pale and black string color aliases
  • Loading branch information
paddor authored Jun 9, 2020
2 parents 2c7bc2d + 9bc3db3 commit b193566
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
3 changes: 0 additions & 3 deletions lib/amazing_print/core_ext/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ class String
end
end

alias black grayish
alias pale whiteish

# Remove ANSI color codes.
def uncolor
gsub(/\e\[[0-9;]*m/, '')
Expand Down
6 changes: 3 additions & 3 deletions lib/amazing_print/inspector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def initialize(options = {})
class_name: :class, # Method used to get Instance class name.
object_id: true, # Show object_id.
color: {
args: :pale,
args: :whiteish,
array: :white,
bigdecimal: :blue,
class: :yellow,
Expand All @@ -37,13 +37,13 @@ def initialize(options = {})
fixnum: :blue,
integer: :blue,
float: :blue,
hash: :pale,
hash: :whiteish,
keyword: :cyan,
method: :purpleish,
nilclass: :red,
rational: :blue,
string: :yellowish,
struct: :pale,
struct: :whiteish,
symbol: :cyanish,
time: :greenish,
trueclass: :green,
Expand Down
7 changes: 0 additions & 7 deletions spec/core_ext/string_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,4 @@
expect(color.to_s.send(:"#{color}ish")).to eq("\e[0;#{30 + i}m#{color}\e[0m")
end
end

it 'should have black and pale colors' do
expect('black'.send(:black)).to eq('black'.send(:grayish))
expect('pale'.send(:pale)).to eq('pale'.send(:whiteish))
expect('pale'.send(:pale)).to eq("\e[0;37mpale\e[0m")
expect('whiteish'.send(:whiteish)).to eq("\e[0;37mwhiteish\e[0m")
end
end

0 comments on commit b193566

Please sign in to comment.