ALTerator README
================

  Alterator - a set of ruby modules for writing backends for
  ALT Linux alterator framework.


Requirements
------------

  * Ruby 1.8


Install
-------

  De-compress archive and enter its top directory.
  Then type:

   ($ su)
    # ruby setup.rb

  These simple step installs this program under the default
  location of Ruby libraries.  You can also install files into
  your favorite directory by supplying setup.rb some options.
  Try "ruby setup.rb --help".


Usage
-----

  require 'alterator'

  back = Alterator::Backend3.new

  back.message_loop do |msg|
    case msg[:action]
    when "constraints"
      back.write :ntp_pool, :label => "ntp server", :hostname => true
      back.write :date, :label => "date", :match => ["re", "text"]
    when "list"
      case msg[:_objects]
      when "avail_protocols"
        back.write(:pop3 => "POP3")
        back.write(:imap => "IMAP4")
      when "avail_mechanisms"
        back.write(:login => "LOGIN", :plain => "PLAIN")
      end
    when "read"
      back.write(:protocols, "p1 p2 p3")
      back.write(:mechanisms, "m1 m2 m3")
      back.write(:auth_port, rand < 0.5)
    else
      raise Alterator::NoActionError
    end
  end


License
-------

  This module is distributed under the terms of the GNU General
  Public License version 2 or any later version.


Sir Raorn <raorn@altlinux.ru>
