Anise

INTRODUCTION

Anise is an Annotation System for the Ruby programming language. Unlike most other annotations systems it is not a comment-based or macro-based system that sits over-and-above the rest of the code. Rather, Anise is a dynamic annotations system operating at runtime.

RELEASE NOTES

Please see the RELEASE file.

RESOURCES

INSTALLATION

To install with RubyGems simply open a console and type:

gem install anise

To manually install you will need Setup.rb (see setup.rubyforge.org). Then download the tarball package and do:

$ tar -xvzf anise-0.2.0.tgz
$ cd anise-0.2.0
$ sudo setup.rb all

USAGE

The following example briefly demonstrates all three major features.

require 'anise'

class X

  include Anise

  # Annotations

  ann :grape, :class=>String

  # Annotated Attributes

  attr :baz, Integer, :max => 10

  # Annotators

  annotator :doc

  doc "This is an entry."

  def bar
    # ...
  end

end

Looking at the resulting annotations:

X.ann(:foo)  #=> {:class=>String}
X.ann(:bar)  #=> {:doc=>"This is an entry."}
X.ann(:baz)  #=> {:class=>Integer, :max=>10}

The Anise library can be used as a whole, per the example above, or these features can be used separately. For more details see the RDoc API documentation.

TESTING

Turn is the recommended way to run Anise’s test suite (codeforpeople.rubyforge.org/turn/).

$ turn test/test_*

But a script test/suite.rb script is include so you can easily run the unit tests with the testrb command:

$ testrb -Ilib test/suite.rb

or with Ruby alone:

$ ruby -Ilib -rtest/unit test/suite.rb

Anise also includes QED tests. These can be run via:

$ qed -Ilib qed/

See the QED homepage for more informaiton about QED.

LICENSE

Copyright © 2008 Thomas Sawyer

This program is distributed under the terms of the Apache 2.0 license.

Please see COPYING.rdoc file for details.