diff options
| author | Luke Kanies <luke@madstop.com> | 2005-04-14 04:49:28 +0000 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2005-04-14 04:49:28 +0000 |
| commit | c6755f5f30be79ddb42c0afc4d89be42a2df47f9 (patch) | |
| tree | 0ff0ccc7d1b013680346bba10c7d5216ea693ad7 /lib/blink/objects | |
| parent | e5676ab347399a1f32e77bf4f64eaa73d54a895b (diff) | |
adding class collection and naming stuff
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@149 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/blink/objects')
| -rw-r--r-- | lib/blink/objects/file.rb | 3 | ||||
| -rw-r--r-- | lib/blink/objects/package.rb | 1 | ||||
| -rw-r--r-- | lib/blink/objects/process.rb | 46 | ||||
| -rw-r--r-- | lib/blink/objects/service.rb | 3 | ||||
| -rw-r--r-- | lib/blink/objects/symlink.rb | 3 |
5 files changed, 27 insertions, 29 deletions
diff --git a/lib/blink/objects/file.rb b/lib/blink/objects/file.rb index 3f2a8dcfc..502a5a404 100644 --- a/lib/blink/objects/file.rb +++ b/lib/blink/objects/file.rb @@ -205,8 +205,7 @@ module Blink :path ] - @objects = Hash.new - @actions = Hash.new + @name = :file @namevar = :path end # Blink::Objects::File end # Blink::Objects diff --git a/lib/blink/objects/package.rb b/lib/blink/objects/package.rb index faf8905af..407b5871a 100644 --- a/lib/blink/objects/package.rb +++ b/lib/blink/objects/package.rb @@ -16,6 +16,7 @@ module Blink :version ] + @name = :package @namevar = :name # this is already being done in objects.rb diff --git a/lib/blink/objects/process.rb b/lib/blink/objects/process.rb index 182667d7c..e2e5722fc 100644 --- a/lib/blink/objects/process.rb +++ b/lib/blink/objects/process.rb @@ -7,29 +7,6 @@ require 'blink/operation/processes' # I'm only working on services, not processes, right now module Blink - class Objects - class BProcess < Objects - attr_reader :stat, :path - @params = [:start, :stop, :user, :pattern, :binary, :arguments] # class instance variable - - @objects = Hash.new - @namevar = :pattern - - Blink::Relation.new(self, Blink::Operation::Start, { - :user => :user, - :pattern => :pattern, - :binary => :binary, - :arguments => :arguments - }) - - Blink::Relation.new(self, Blink::Operation::Stop, { - :user => :user, - :pattern => :pattern - }) - - end # Blink::Objects::BProcess - end # Blink::Objects - class Attribute class ProcessRunning < Attribute def retrieve @@ -83,4 +60,27 @@ module Blink end end end + class Objects + class BProcess < Objects + attr_reader :stat, :path + @params = [:start, :stop, :user, :pattern, :binary, :arguments] + @name = :process + + @namevar = :pattern + + Blink::Relation.new(self, Blink::Operation::Start, { + :user => :user, + :pattern => :pattern, + :binary => :binary, + :arguments => :arguments + }) + + Blink::Relation.new(self, Blink::Operation::Stop, { + :user => :user, + :pattern => :pattern + }) + + end # Blink::Objects::BProcess + end # Blink::Objects + end diff --git a/lib/blink/objects/service.rb b/lib/blink/objects/service.rb index 8e69d1407..4e7f4b17e 100644 --- a/lib/blink/objects/service.rb +++ b/lib/blink/objects/service.rb @@ -78,8 +78,7 @@ module Blink :pattern ] - @objects = Hash.new - @actions = Hash.new + @name = :service @namevar = :name @searchpaths = Array.new diff --git a/lib/blink/objects/symlink.rb b/lib/blink/objects/symlink.rb index 11187e2cf..ca08ea952 100644 --- a/lib/blink/objects/symlink.rb +++ b/lib/blink/objects/symlink.rb @@ -98,8 +98,7 @@ module Blink :path ] - @objects = Hash.new - @actions = Hash.new + @name = :symlink @namevar = :path end # Blink::Objects::File end # Blink::Objects |
