diff options
author | Luke Kanies <luke@madstop.com> | 2005-04-14 04:59:46 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-04-14 04:59:46 +0000 |
commit | 5e19d7d7af63de224bffb9fac70083c8dbd45eac (patch) | |
tree | 6830ed2f80369de175ca088bbf2550dedaae9287 | |
parent | afd434921c9c71afd62b361970410644559e028f (diff) | |
download | puppet-5e19d7d7af63de224bffb9fac70083c8dbd45eac.tar.gz puppet-5e19d7d7af63de224bffb9fac70083c8dbd45eac.tar.xz puppet-5e19d7d7af63de224bffb9fac70083c8dbd45eac.zip |
renaming objects to types
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@153 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/blink/types.rb | 36 | ||||
-rw-r--r-- | lib/blink/types/file.rb | 8 | ||||
-rw-r--r-- | lib/blink/types/package.rb | 12 | ||||
-rw-r--r-- | lib/blink/types/process.rb | 8 | ||||
-rw-r--r-- | lib/blink/types/service.rb | 8 | ||||
-rw-r--r-- | lib/blink/types/symlink.rb | 8 |
6 files changed, 40 insertions, 40 deletions
diff --git a/lib/blink/types.rb b/lib/blink/types.rb index 4e5f9b268..00e9b1804 100644 --- a/lib/blink/types.rb +++ b/lib/blink/types.rb @@ -12,7 +12,7 @@ require 'blink/interface' # See attribute.rb for how work is actually done. module Blink - class Objects + class Types include Enumerable @objects = Hash.new @@allobjects = Array.new # and then an array for all objects @@ -28,7 +28,7 @@ module Blink #--------------------------------------------------------------- # retrieve a named object - def Objects.[](name) + def Types.[](name) if @objects.has_key?(name) return @objects[name] else @@ -40,12 +40,12 @@ module Blink #--------------------------------------------------------------- # this is special, because it can be equivalent to running new # this allows cool syntax like Blink::File["/etc/inetd.conf"] = ... - def Objects.[]=(name,object) + def Types.[]=(name,object) newobj = nil - if object.is_a?(Blink::Objects) + if object.is_a?(Blink::Types) newobj = object else - raise "must pass a Blink::Objects object" + raise "must pass a Blink::Types object" end if @objects.has_key?(newobj.name) @@ -61,14 +61,14 @@ module Blink #--------------------------------------------------------------- #--------------------------------------------------------------- - def Objects.has_key?(name) + def Types.has_key?(name) return @objects.has_key?(name) end #--------------------------------------------------------------- #----------------------------------- # all objects total - def Objects.push(object) + def Types.push(object) @@allobjects.push object Blink.debug("adding %s of type %s to master list" % [object.name,object.class]) @@ -78,7 +78,7 @@ module Blink #----------------------------------- # this is meant to be run multiple times, e.g., when a new # type is defined at run-time - def Objects.buildtypehash + def Types.buildtypehash @@typeary.each { |otype| if @@typehash.include?(otype.name) if @@typehash[otype.name] != otype @@ -94,7 +94,7 @@ module Blink #----------------------------------- # this should make it so our subclasses don't have to worry about # defining these class instance variables - def Objects.inherited(sub) + def Types.inherited(sub) sub.module_eval %q{ @objects = Hash.new @actions = Hash.new @@ -109,23 +109,23 @@ module Blink #----------------------------------- #----------------------------------- - # this is used for mapping object types (e.g., Blink::Objects::File) + # this is used for mapping object types (e.g., Blink::Types::File) # to names (e.g., "file") - def Objects.name + def Types.name return @name end #----------------------------------- #----------------------------------- # some simple stuff to make it easier to get a name from everyone - def Objects.namevar + def Types.namevar return @namevar end #----------------------------------- #----------------------------------- # accessor for the list of acceptable params - def Objects.classparams + def Types.classparams return @params end #----------------------------------- @@ -133,7 +133,7 @@ module Blink #----------------------------------- # our param list is by class, so we need to convert it to names # (see blink/objects/file.rb for an example of how params are defined) - def Objects.classparambyname + def Types.classparambyname unless defined? @paramsbyname @paramsbyname = Hash.new { |hash,key| fail TypeError.new( @@ -405,7 +405,7 @@ module Blink self.class[name] = self # and then add it to the master list - Blink::Objects.push(self) + Blink::Types.push(self) @notify = Hash.new #@encloses = Array.new @@ -414,10 +414,10 @@ module Blink #@opsgenned = false # XXX i've no idea wtf is going on with enclosures - #if self.class == Blink::Objects::Root + #if self.class == Blink::Types::Root # Blink.debug "not enclosing root (#{self.class}) in self" #else - # Blink::Objects.root.encloses(self) + # Blink::Types.root.encloses(self) #end end # initialize @@ -510,5 +510,5 @@ module Blink #----------------------------------- #--------------------------------------------------------------- - end # Blink::Objects + end # Blink::Types end diff --git a/lib/blink/types/file.rb b/lib/blink/types/file.rb index 502a5a404..77e977993 100644 --- a/lib/blink/types/file.rb +++ b/lib/blink/types/file.rb @@ -193,8 +193,8 @@ module Blink end end end - class Objects - class File < Objects + class Types + class File < Types attr_reader :stat, :path, :params # class instance variable @params = [ @@ -207,7 +207,7 @@ module Blink @name = :file @namevar = :path - end # Blink::Objects::File - end # Blink::Objects + end # Blink::Types::File + end # Blink::Types end diff --git a/lib/blink/types/package.rb b/lib/blink/types/package.rb index 407b5871a..c431a4693 100644 --- a/lib/blink/types/package.rb +++ b/lib/blink/types/package.rb @@ -3,11 +3,11 @@ # $Id$ module Blink - class Objects + class Types # packages are complicated because each package format has completely # different commands. We need some way to convert specific packages # into the general package object... - class Package < Objects + class Package < Types attr_reader :version, :format # class instance variable @params = [ @@ -38,7 +38,7 @@ module Blink def sync end - end # Blink::Objects::Package + end # Blink::Types::Package class PackagingType attr_writer :list, :install, :remove, :check @@ -108,7 +108,7 @@ module Blink fields.zip(match.captures) { |field,value| hash[field] = value } - packages.push Blink::Objects::Package.new(hash) + packages.push Blink::Types::Package.new(hash) else raise "failed to match dpkg line %s" % line end @@ -162,7 +162,7 @@ module Blink process.each { |line| case line when /^$/ then - packages.push Blink::Objects::Package.new(hash) + packages.push Blink::Types::Package.new(hash) hash.clear when /\s*(\w+):\s+(.+)/ name = $1 @@ -238,5 +238,5 @@ module Blink end } } - end # Blink::Objects + end # Blink::Types end diff --git a/lib/blink/types/process.rb b/lib/blink/types/process.rb index e2e5722fc..333191e37 100644 --- a/lib/blink/types/process.rb +++ b/lib/blink/types/process.rb @@ -60,8 +60,8 @@ module Blink end end end - class Objects - class BProcess < Objects + class Types + class BProcess < Types attr_reader :stat, :path @params = [:start, :stop, :user, :pattern, :binary, :arguments] @name = :process @@ -80,7 +80,7 @@ module Blink :pattern => :pattern }) - end # Blink::Objects::BProcess - end # Blink::Objects + end # Blink::Types::BProcess + end # Blink::Types end diff --git a/lib/blink/types/service.rb b/lib/blink/types/service.rb index 4e7f4b17e..0abfc7b32 100644 --- a/lib/blink/types/service.rb +++ b/lib/blink/types/service.rb @@ -69,8 +69,8 @@ module Blink end end end - class Objects - class Service < Objects + class Types + class Service < Types attr_reader :stat @params = [ Blink::Attribute::ServiceRunning, @@ -133,6 +133,6 @@ module Blink @initscript = Service.search(self.name) end end - end # Blink::Objects::BProcess - end # Blink::Objects + end # Blink::Types::BProcess + end # Blink::Types end diff --git a/lib/blink/types/symlink.rb b/lib/blink/types/symlink.rb index ca08ea952..b4a2f9a2e 100644 --- a/lib/blink/types/symlink.rb +++ b/lib/blink/types/symlink.rb @@ -86,8 +86,8 @@ module Blink end end - class Objects - class Symlink < Objects + class Types + class Symlink < Types attr_reader :stat, :path, :params # class instance variable @params = [ @@ -100,7 +100,7 @@ module Blink @name = :symlink @namevar = :path - end # Blink::Objects::File - end # Blink::Objects + end # Blink::Types::File + end # Blink::Types end |