highline
highline copied to clipboard
`::add_to_color_scheme` improvement
Hi, thanks for the useful gem. I've been using the following extension for a while, and if you like it too, I could make it into a PR or something.
class HighLine
class << self
def add_to_color_scheme(hash)
old_hash = (color_scheme || {}).to_hash
fail "Overlapping color schemes: #{old_hash.keys & hash.keys}" unless
(old_hash.keys & hash.keys).empty?
self.color_scheme = ColorScheme.new(old_hash.merge hash)
end
end
end