Class: EventWatcherForGem
Instance Method Summary collapse
- #enhance ⇒ Object
-
#initialize(_event, _details) ⇒ EventWatcherForGem
constructor
A new instance of EventWatcherForGem.
Methods included from EventBus
#attach_listener, #broadcast_event, #detach_listener, #process_event
Constructor Details
#initialize(_event, _details) ⇒ EventWatcherForGem
Returns a new instance of EventWatcherForGem.
2319 2320 2321 2322 2323 2324 |
# File 'lib/a-core.rb', line 2319 def initialize(_event, _details) @event=_event @details=_details enhance Arcadia.attach_listener(self, _event) end |
Instance Method Details
#enhance ⇒ Object
2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 |
# File 'lib/a-core.rb', line 2325 def enhance implementation=%Q{ class << self def #{_method_name(@event, 'before')}(_event) _event.break new_event = Arcadia.process_event(NeedRubyGemWizardEvent.new(self, @details)) if new_event && new_event.results ok=new_event.results[0].installed _event.break if !ok end end end } eval(implementation) end |