summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-08-09 19:17:03 +0000
committerLuke Kanies <luke@madstop.com>2005-08-09 19:17:03 +0000
commit0f7d185fb1f05e6674ed12ad5f0dabc1ad3f34db (patch)
treef201bf029f6acbc89939c99073af46618b285dc3 /lib
parentaf1b97950fd1556b90883febb251405b4788c10f (diff)
downloadpuppet-0f7d185fb1f05e6674ed12ad5f0dabc1ad3f34db.tar.gz
puppet-0f7d185fb1f05e6674ed12ad5f0dabc1ad3f34db.tar.xz
puppet-0f7d185fb1f05e6674ed12ad5f0dabc1ad3f34db.zip
fact.rb is obsolete
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@520 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/fact.rb64
1 files changed, 0 insertions, 64 deletions
diff --git a/lib/puppet/fact.rb b/lib/puppet/fact.rb
deleted file mode 100644
index f17131d02..000000000
--- a/lib/puppet/fact.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/local/bin/ruby -w
-
-# $Id$
-
-# an interface for registering and retrieving facts
-# this is an abstract interface, and should just be used to interact
-# with another library
-
-# currently a very thin veneer on 'facter'
-
-require 'facter'
-require 'puppet'
-require 'puppet/type'
-
-module Puppet
- class Fact
- def Fact.[](name)
- fact = Facter[name]
- if fact.value.nil?
- raise "Could not retrieve fact %s" % name
- end
- return fact.value
- end
-
- # just pass the block to 'add'
- # the block has to do things like set the interpreter,
- # the code (which can be a ruby block), and maybe the
- # os and osrelease
- def Fact.add(name,&block)
- Facter[name].add(&block)
- end
-
- def Fact.name
- return :fact
- end
-
- def Fact.namevar
- return :name
- end
-
- #Puppet::Type.newtype(self)
-
- # we're adding a new resolution mechanism here; this is just how
- # types work
- # we don't have any real interest in the returned object
- def initialize(hash)
- name = hash[:name]
- hash.delete(:name)
- Fact.add(name) { |fact|
- method = nil
- hash.each { |key,value|
- if key.is_a?(String)
- method = key + "="
- elsif key.is_a?(Symbol)
- method = key.id2name + "="
- else
- raise "Key must be either string or symbol"
- end
- fact.send(method,value)
- }
- }
- end
- end
-end