Created
January 13, 2021 07:22
-
-
Save havenwood/5409cbd4f2538accbb9c1a8c1f1329d3 to your computer and use it in GitHub Desktop.
An, ahem, answer, of sorts for how to change default IRB colors (irc question)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
changes = {IRB::Color::BLUE => IRB::Color::YELLOW} | |
IRB::Color.const_get(:TOKEN_SEQ_EXPRS).tap do |token_seq_exprs| | |
changes.each do |old_color, new_color| | |
token_seq_exprs.filter_map do |type, ((color, _), _)| | |
color == old_color && type | |
end.each do |matching_type| | |
token_seq_exprs.dig(matching_type, 0)[0] = new_color | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment