Class: Bugzilla::Plugin::Template
- Inherits:
-
Object
- Object
- Bugzilla::Plugin::Template
- Defined in:
- lib/bugzilla/plugin.rb
Overview
rdoc
Bugzilla::Plugin::Template
Constant Summary collapse
- @@plugins =
[]
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
def initialize.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Template
constructor
A new instance of Template.
-
#parserhook(parser, argv, opts) ⇒ Object
def run.
-
#posthook(cmd, opts) ⇒ Object
def posthook.
-
#prehook(cmd, opts) ⇒ Object
def prehook.
-
#run(hook, host, *args) ⇒ Object
def inherited.
Constructor Details
#initialize ⇒ Template
35 36 37 |
# File 'lib/bugzilla/plugin.rb', line 35 def initialize @hostname = nil end |
Instance Attribute Details
#hostname ⇒ Object (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 |