Skip to content

Instantly share code, notes, and snippets.

@dalen
Created March 19, 2013 17:48
Show Gist options
  • Save dalen/5198354 to your computer and use it in GitHub Desktop.
Save dalen/5198354 to your computer and use it in GitHub Desktop.
diff --git a/lib/facter/util/confine.rb b/lib/facter/util/confine.rb
index 3bb504b..9c5a659 100644
--- a/lib/facter/util/confine.rb
+++ b/lib/facter/util/confine.rb
@@ -31,6 +31,13 @@ class Facter::Util::Confine
return false if value.nil?
- return @values.any? { |v| convert(v) === value }
+ return @values.any? do |v|
+ # Always use Ruby 1.9+ semantics on Proc confines.
+ if v.kind_of? Proc then
+ c.call(value)
+ else
+ convert(v) === value
+ end
+ end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment