https://github.com/rubyworks/no_backsies
Enhanced Ruby Callback System
https://github.com/rubyworks/no_backsies
Last synced: 8 months ago
JSON representation
Enhanced Ruby Callback System
- Host: GitHub
- URL: https://github.com/rubyworks/no_backsies
- Owner: rubyworks
- License: other
- Created: 2011-04-29T17:27:40.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2012-05-27T20:15:11.000Z (over 13 years ago)
- Last Synced: 2025-06-06T07:41:30.488Z (9 months ago)
- Language: Ruby
- Homepage: http://rubyworks.github.com/no_backsies
- Size: 541 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rdoc
- Changelog: HISTORY.rdoc
- License: COPYING.rdoc
Awesome Lists containing this project
README
= No Backsies
{Homepage}[http://rubyworks.github.com/no_backsies] |
{Development}[http://github.com/rubyworks/no_backsies] |
{Mailing List}[http://groups.google.com/group/rubyworks-mailinglist] |
{API Reference}[http://rubydoc.info/gems/no_backsies/frames] |
{Demonstrandum}[http://rubyworks.github.com/no_backsies/qed.html]
== 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[http://rubyworks.github.com/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[http://github.com/rubyworks/qed].
If you'd like to submit a patch please fork the repository and
submit a pull request (ideally in a topic branch).
=== Testing
QED[http://rubyworks.github.com/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}[http://rubyworks.github.com].
Thanks.
== LEGAL
(BSD 2 License)
Copyright (c) 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.