Created
March 19, 2013 17:48
-
-
Save dalen/5198354 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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