HookR is a publish/subscribe callback hook facility for Ruby.
== CHANGES
1 major enhancement
Birthday!
== SYNOPSIS:
require ‘rubygems’
require ‘hookr’
class ZeroWing
include HookR::Hooks
define_hook :we_get_signal, :message
def start_game
execute_hook(:we_get_signal, "How are you gentlemen?")
end
def bomb(event, message)
puts "somebody set us up the bomb!"
end
we_get_signal do |event, message|
puts "Main screen turn on!"
puts "Cats: #{message}"
end
we_get_signal :bomb
end
zw = ZeroWing.new
zw.we_get_signal do
puts “Take off every zig!”
end
HookR is a publish/subscribe callback hook facility for Ruby.
Great project name. The jokes on the site alone are worth it.
Seriously, it’s a great idea too. I wish we would see things like
ActiveRecord’s finder system move to something like this, instead of
just encouraging all plugins to alias and rewrite. Nice work.
HookR is a publish/subscribe callback hook facility for Ruby.
Just had fun playing with this. However, it seems that HookR doesn’t
specify its gem dependencies which makes it a bit of a pain to install
via RubyGems, and then requires its development dependencies to be
installed (such as cucumber) for it to run.
Just had fun playing with this. However, it seems that HookR doesn’t
specify its gem dependencies which makes it a bit of a pain to install
via RubyGems, and then requires its development dependencies to be
installed (such as cucumber) for it to run.
Oops. I’ll fix this ASAP. Also, Cucumber shouldn’t be needed at all
I think that might be part of the elaborate developer dependency
network introduced by Newgem, which I used to create the FailFast gem.
That’s part of the reason I switched to using Mr. Bones when I made
HookR into a Gem.