From d3fcd766ea6d6a21d892f3fab264606dfacf14a7 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 10 Mar 2013 18:06:32 -0700 Subject: fixed misc. bugs with switch to 'environment' flag. --- lib/leap_cli/config/object_list.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/leap_cli/config/object_list.rb') diff --git a/lib/leap_cli/config/object_list.rb b/lib/leap_cli/config/object_list.rb index 9001834..0c7711f 100644 --- a/lib/leap_cli/config/object_list.rb +++ b/lib/leap_cli/config/object_list.rb @@ -37,6 +37,7 @@ module LeapCli key.each do |field, match_value| field = field.is_a?(Symbol) ? field.to_s : field match_value = match_value.is_a?(Symbol) ? match_value.to_s : match_value + operator = match_value =~ /^!/ ? :not_equal : :equal each do |name, config| value = config[field] if !value.nil? @@ -45,7 +46,9 @@ module LeapCli results[name] = config end else - if value == match_value + if operator == :equal && value == match_value + results[name] = config + elsif operator == :not_equal && value != match_value results[name] = config end end -- cgit v1.2.3