Created
September 9, 2009 23:24
-
-
Save reinh/184167 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
module Facter | |
def self.add(name, &block) | |
collection.add(name, &block) # eventually becomes Factor::Util::Resolvers.instance_eval(block) | |
end | |
end | |
class Factor::Util::Resolvers | |
class << self | |
def setcode(string=nil, &block) | |
return Facter::Util::Resolvers::Exec.new(string) if string | |
return Facter::Util::Resolvers::Proc.new(block) if block | |
raise ArgumentError, "You must pass either code or a block" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment