Class: Bugzilla::Plugin::Template
- Inherits:
-
Object
- Object
- Bugzilla::Plugin::Template
- Defined in:
- lib/bugzilla.rb
Overview
Bugzilla::Plugin::Template
Direct Known Subclasses
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.
52 53 54 |
# File 'lib/bugzilla.rb', line 52 def initialize @hostname = nil end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
def initialize
56 57 58 |
# File 'lib/bugzilla.rb', line 56 def hostname @hostname end |
Class Method Details
.inherited(subclass) ⇒ Object
58 59 60 |
# File 'lib/bugzilla.rb', line 58 def Template.inherited(subclass) @@plugins << subclass end |
Instance Method Details
#parserhook(parser, argv, opts) ⇒ Object
def run
79 80 |
# File 'lib/bugzilla.rb', line 79 def parserhook(parser, argv, opts) end |
#posthook(cmd, opts) ⇒ Object
def prehook
85 86 |
# File 'lib/bugzilla.rb', line 85 def posthook(cmd, opts) end |
#prehook(cmd, opts) ⇒ Object
def parserhook
82 83 |
# File 'lib/bugzilla.rb', line 82 def prehook(cmd, opts) end |
#run(hook, host, *args) ⇒ Object
def inherited
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/bugzilla.rb', line 62 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 |