Class: Bugzilla::Plugin::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/bugzilla/plugin.rb

Overview

rdoc

Bugzilla::Plugin::Template

Direct Known Subclasses

Novell, RedHat

Constant Summary collapse

@@plugins =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTemplate



35
36
37
# File 'lib/bugzilla/plugin.rb', line 35

def initialize
  @hostname = nil
end

Instance Attribute Details

#hostnameObject (readonly)

def initialize



39
40
41
# File 'lib/bugzilla/plugin.rb', line 39

def hostname
  @hostname
end

Class Method Details

.inherited(subclass) ⇒ Object



41
42
43
# File 'lib/bugzilla/plugin.rb', line 41

def self.inherited(subclass)
  @@plugins << subclass
end

Instance Method Details

#parserhook(parser, argv, opts) ⇒ Object

def run



60
# File 'lib/bugzilla/plugin.rb', line 60

def parserhook(parser, argv, opts); end

#posthook(cmd, opts) ⇒ Object

def posthook



64
# File 'lib/bugzilla/plugin.rb', line 64

def posthook(cmd, opts); end

#prehook(cmd, opts) ⇒ Object

def prehook



62
# File 'lib/bugzilla/plugin.rb', line 62

def prehook(cmd, opts); end

#run(hook, host, *args) ⇒ Object

def inherited



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/bugzilla/plugin.rb', line 45

def run(hook, host, *args)
  @@plugins.each do |k|
    i = k.new
    next unless i.hostname == host || host.nil?
    case hook
    when :parser
      i.parserhook(*args)
    when :pre
      i.prehook(*args)
    when :post
      i.posthook(*args)
    end
  end
end