]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
fixed bug with config list not supporting correctly not filters (eg nodes[:name ...
authorelijah <elijah@riseup.net>
Wed, 22 May 2013 23:36:49 +0000 (16:36 -0700)
committerelijah <elijah@riseup.net>
Wed, 22 May 2013 23:36:49 +0000 (16:36 -0700)
lib/leap_cli/config/object_list.rb

index 0c0da14df9731443c0bfe9d782ca4326dfc4a264..ebb0bb024d93285eff670be61707390a330def67 100644 (file)
@@ -37,7 +37,12 @@ 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
+            if match_value.is_a?(String) && match_value =~ /^!/
+              operator = :not_equal
+              match_value = match_value.sub(/^!/, '')
+            else
+              operator = :equal
+            end
             each do |name, config|
               value = config[field]
               if value.is_a? Array