lib/pastel/alias_importer.rb in pastel-0.7.4 vs lib/pastel/alias_importer.rb in pastel-0.8.0

- old
+ new

@@ -1,6 +1,6 @@ -# encoding: utf-8 +# frozen_string_literal: true module Pastel # A class responsible for importing color aliases class AliasImporter # Create alias importer @@ -23,18 +23,19 @@ # # @return [nil] # # @api public def import - color_aliases = env['PASTEL_COLORS_ALIASES'] + color_aliases = env["PASTEL_COLORS_ALIASES"] return unless color_aliases - color_aliases.split(',').each do |color_alias| - new_color, old_colors = color_alias.split('=') + + color_aliases.split(",").each do |color_alias| + 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.to_sym, - *old_colors.split('.').map(&:to_sym)) + *old_colors.split(".").map(&:to_sym)) end end end protected