summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-06-09 16:43:02 +0000
committerLuke Kanies <luke@madstop.com>2005-06-09 16:43:02 +0000
commit90b9b2d9893ffad3b79bd5e0e0d15e7fc5f38698 (patch)
treef030647d75064a343a05a62fae22f839108c5aea /lib
parent3f0687b9dddb5bc52c538c64cc9226a0f0d84522 (diff)
downloadpuppet-90b9b2d9893ffad3b79bd5e0e0d15e7fc5f38698.tar.gz
puppet-90b9b2d9893ffad3b79bd5e0e0d15e7fc5f38698.tar.xz
puppet-90b9b2d9893ffad3b79bd5e0e0d15e7fc5f38698.zip
updates
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@296 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/blink/type/file.rb23
-rw-r--r--lib/blink/type/package.rb4
-rw-r--r--lib/blink/type/state.rb2
3 files changed, 27 insertions, 2 deletions
diff --git a/lib/blink/type/file.rb b/lib/blink/type/file.rb
index 57f58fbe4..772ab26ae 100644
--- a/lib/blink/type/file.rb
+++ b/lib/blink/type/file.rb
@@ -415,4 +415,27 @@ module Blink
end # Blink::Type::File
end # Blink::Type
+ class FileSource
+ attr_accessor :name
+
+ @sources = Hash.new(nil)
+
+ def FileSource.[]=(name,sub)
+ @sources[name] = sub
+ end
+
+ def FileSource.[](name)
+ return @sources[name]
+ end
+
+ def initialize(name)
+ @name = name
+
+ if block_given?
+ yield self
+ end
+
+ FileSource[name] = self
+ end
+ end
end
diff --git a/lib/blink/type/package.rb b/lib/blink/type/package.rb
index 23a8abb95..4433d8a23 100644
--- a/lib/blink/type/package.rb
+++ b/lib/blink/type/package.rb
@@ -2,13 +2,15 @@
# $Id$
+require 'blink/type/state'
+
module Blink
class State
class PackageInstalled < Blink::State
@name = :install
def retrieve
- self.is = Blink::PackageType[object.format][object.name]
+ self.is = Blink::PackageType[@object.format][@object.name]
Blink.debug "package install state is %d" % self.is
end
diff --git a/lib/blink/type/state.rb b/lib/blink/type/state.rb
index 80c0a933b..4706b04b7 100644
--- a/lib/blink/type/state.rb
+++ b/lib/blink/type/state.rb
@@ -15,7 +15,7 @@ require 'blink/statechange'
# a file's owner is what you want, but you could not create two file objects
# and use these methods to verify that they have the same owner
module Blink
-class Blink::State < Blink::Element
+class State < Blink::Element
attr_accessor :is, :should, :parent
@virtual = true