lib/pastel/alias_importer.rb in pastel-0.7.1 vs lib/pastel/alias_importer.rb in pastel-0.7.2
- old
+ new
@@ -16,24 +16,25 @@
end
# Import aliases from the environment
#
# @example
- # importer = Pastel::AliasImporter.new(Pastel::Color.new)
+ # importer = Pastel::AliasImporter.new(Pastel::Color.new, {})
# importer.import
#
# @return [nil]
#
# @api public
def import
color_aliases = env['PASTEL_COLORS_ALIASES']
return unless color_aliases
color_aliases.split(',').each do |color_alias|
- new_color, old_color = color_alias.split('=').map(&:to_sym)
- if !new_color || !old_color
+ new_color, old_colors = color_alias.split('=')
+ if !new_color || !old_colors
output.puts "Bad color mapping `#{color_alias}`"
else
- color.alias_color(new_color, old_color)
+ color.alias_color(new_color.to_sym,
+ *old_colors.split('.').map(&:to_sym))
end
end
end
protected