= safer

http://safer.rubyforge.org

== DESCRIPTION:

Safer is an umbrella library, with components designed to make it simple to
verify and improve the safety of your ruby code. There are at present two
modules under the safer umbrella:

[<tt>Safer::IVar</tt>] generates specially-named accessor functions
for class instance variables.
[<tt>Safer::Protocol</tt>] is used to provide a ruby analogue to
Objective-C Protocols (which are similar to
Java interfaces, but do not require
inheritance).

== FEATURES/PROBLEMS:

* Name instance variables after the class in which they are defined. Generate
accessor functions for these instance variables.
* Define a "Protocol" class, and derive a signature from it. Verify that
another class (or an instance of that class) implements the protocol
signature.

== SYNOPSIS:

require 'safer/ivar'
require 'safer/protocol'

module MyModule
class MyProtocolClass
def self.class_method_foo(arg1, arg2)
end
def instance_method(arg3)
end
end
PROTOCOL = Safer::Protocol.create_from_class(MyProtocolClass)
class MyClass
Safer::IVar.instance_variable(self, :var1, :var2)
def initialize(var1, var2)
PROTOCOL.check_instance_conforms(var1)
PROTOCOL.check_instance_conforms(var2)
self.mymodule_myclass__var1 = var1
self.mymodule_myclass__var2 = var2
end
end
end

== REQUIREMENTS:

* None

== INSTALL:

* sudo gem install safer

== DEVELOPERS:

After checking out the source, run:

$ rake newb

This task will install any missing dependencies, run the tests/specs,
and generate the RDoc.

== LICENSE:

This software is placed into the public domain.