Forum: Ruby HookR version 1.0.0 released

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4dea430d31b993abaf41cd9b54f8128d?d=identicon&s=25 Avdi Grimm (avdi)
on 2008-12-03 19:05
(Received via mailing list)
HookR version 1.0.0
    by Avdi Grimm
    http://hookr.rubyforge.org

== DESCRIPTION

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

  zw.start_game
  # >> Main screen turn on!
  # >> Cats: How are you gentlemen?
  # >> somebody set us up the bomb!
  # >> Take off every zig!


--
Avdi

Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2008-12-03 21:01
(Received via mailing list)
On Dec 3, 2008, at 11:59 AM, Avdi Grimm wrote:

> == DESCRIPTION
>
> 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.

James Edward Gray II
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 Gregory Brown (Guest)
on 2008-12-03 21:07
(Received via mailing list)
On Wed, Dec 3, 2008 at 12:59 PM, Avdi Grimm <avdi@avdi.org> wrote:
> HookR version 1.0.0
>    by Avdi Grimm
>    http://hookr.rubyforge.org
>
> == DESCRIPTION
>
> 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.

Thanks for this project, it's neat stuff!

-greg
4dea430d31b993abaf41cd9b54f8128d?d=identicon&s=25 Avdi Grimm (avdi)
on 2008-12-03 21:18
(Received via mailing list)
On Wed, Dec 3, 2008 at 3:01 PM, Gregory Brown
<gregory.t.brown@gmail.com> wrote:
> 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.

--
Avdi

Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com
This topic is locked and can not be replied to.