summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-05-16 18:08:04 +0000
committerLuke Kanies <luke@madstop.com>2005-05-16 18:08:04 +0000
commit4a9c1a256d12cf8c4af1f7e5754a9fcbb61078ca (patch)
tree08e70cd0fcd0011234b92ab4192a5d1257857f08
parentf91451d90114ff31e69ea66a15932a0e9cba5f04 (diff)
downloadpuppet-4a9c1a256d12cf8c4af1f7e5754a9fcbb61078ca.tar.gz
puppet-4a9c1a256d12cf8c4af1f7e5754a9fcbb61078ca.tar.xz
puppet-4a9c1a256d12cf8c4af1f7e5754a9fcbb61078ca.zip
enabling mucking with debug and noop
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@257 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/blink/type.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/blink/type.rb b/lib/blink/type.rb
index 50061047d..859005574 100644
--- a/lib/blink/type.rb
+++ b/lib/blink/type.rb
@@ -38,6 +38,10 @@ class Blink::Type < Blink::Element
@@allobjects = Array.new # an array for all objects
@abstract = true
+ @name = :blink # a little fakery, since Blink itself isn't a type
+
+ @allowedmethods = [:noop,:debug]
+
#---------------------------------------------------------------
#---------------------------------------------------------------
# class methods dealing with Type management
@@ -50,7 +54,7 @@ class Blink::Type < Blink::Element
# called before the <subclass>.name method is defined, we need
# to store each class in an array, and then later actually iterate
# across that array and make a map
- @@typeary = []
+ @@typeary = [self]
@@typehash = Hash.new { |hash,key|
if key.is_a?(String)
key = key.intern
@@ -87,6 +91,18 @@ class Blink::Type < Blink::Element
#---------------------------------------------------------------
#---------------------------------------------------------------
+ def noop(ary)
+ Blink[:noop] = ary.shift
+ end
+ #---------------------------------------------------------------
+
+ #---------------------------------------------------------------
+ def debug(ary)
+ Blink[:debug] = ary.shift
+ end
+ #---------------------------------------------------------------
+
+ #---------------------------------------------------------------
# this is meant to be run multiple times, e.g., when a new
# type is defined at run-time
def Type.buildtypehash