Class: Bugzilla::Plugin::Template
- Inherits:
-
Object
- Object
- Bugzilla::Plugin::Template
- Defined in:
- lib/bugzilla/plugin.rb
Overview
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 prehook.
-
#prehook(cmd, opts) ⇒ Object
def parserhook.
-
#run(hook, host, *args) ⇒ Object
def inherited.
Constructor Details
#initialize ⇒ Template
Returns a new instance of Template.
40 41 42 |
# File 'lib/bugzilla/plugin.rb', line 40 def initialize @hostname = nil end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
def initialize
44 45 46 |
# File 'lib/bugzilla/plugin.rb', line 44 def hostname @hostname end |
Class Method Details
.inherited(subclass) ⇒ Object
46 47 48 |
# File 'lib/bugzilla/plugin.rb', line 46 def Template.inherited(subclass) @@plugins << subclass end |
Instance Method Details
#parserhook(parser, argv, opts) ⇒ Object
def run
67 68 |
# File 'lib/bugzilla/plugin.rb', line 67 def parserhook(parser, argv, opts) end |
#posthook(cmd, opts) ⇒ Object
def prehook
73 74 |
# File 'lib/bugzilla/plugin.rb', line 73 def posthook(cmd, opts) end |
#prehook(cmd, opts) ⇒ Object
def parserhook
70 71 |
# File 'lib/bugzilla/plugin.rb', line 70 def prehook(cmd, opts) end |
#run(hook, host, *args) ⇒ Object
def inherited
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/bugzilla/plugin.rb', line 50 def run(hook, host, *args) @@plugins.each do |k| i = k.new if i.hostname == host || host.nil? then case hook when :parser i.parserhook(*args) when :pre i.prehook(*args) when :post i.posthook(*args) else end end end end |