0.0
No commit activity in last 3 years
No release in over 3 years
NoBacksies is a callback layer built on top of Ruby's built-in callback methods. It makes it possible to add new callbacks very easily, without having to fuss with more nuanced issues of defining and redefining callback methods.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

No Backsies¶ ↑

Homepage | Development | Mailing List | API Reference | Demonstrandum

DESCRIPTION¶ ↑

NoBacksies is a callback layer built on top of Ruby’s built-in callback methods. It makes it possible to add new callbacks very easily, without having to fuss with more nuanced issues of defining and redefining callback methods.

Compatability¶ ↑

NoBacksies does not currently work with Rubinius. Anyone know why?

EXAMPLES¶ ↑

Here is a very simple example of how NoBacksies works.

class Y
  include NoBacksies::Callbacks

  def self.list
    @list ||= []
  end

  callback :method_added do |method|
    list << method
  end

  def foo; end
  def bar; end
end

Y.list #=> [:foo, :bar]

Here is another example taken from the Anise project.

class Y
  include Anise
  include NoBacksies

  def self.doc(string)
    callback :method_added, :once=>true do |method|
      self.ann(method, :doc=>string)
    end
  end

  doc "foo is cool"
  def foo
    # ...
  end
end

Y.ann(:foo, :doc) #=> "foo is cool"

See the QED documentation for more examples.

INSTALLATION¶ ↑

Install the RubyGems package in the usual fashion.

$ gem install no_backsies

CONTRIBUTE¶ ↑

Development¶ ↑

Source code is hosted on GitHub. If you’d like to submit a patch please fork the repository and submit a pull request (ideally in a topic branch).

Testing¶ ↑

QED is used to testing.

$ gem install qed

To run the tests:

$ qed [path/to/test]

Donations¶ ↑

Software development is very time consuming. Rubyworks does a lot of FOSS development for el $0. We do it for the love of programming and for Ruby. Any dollars that do come our way help us continue the effort. So anything you may offer will help these projects such as this continue to flourish.

See the Rubyworks Homepage.

Thanks.

(BSD 2 License)

Copyright © 2011 Thomas Sawyer

Unless otherwise negotiated with the original author, NoBacksies is distributable under the terms of the BSD 2-clause license.

See the LICENSE.rdoc file for details.