[トップ] [更新履歴] [著書] [コンピュータ] [ゲーム] [CGI配布]


Index


Title: belld - Bell Board System

-> Japanese

It's a simple server/client-base event notification system. The server's console is `blackboard'. Wherever the client program is invoked, log is written on blackboard. Log is written a logfile too, so you can view past log(~/.belld/yymmdd). Not only from commandline but also from Ruby library bell.rb is invoked, then it is very powerful when you debug a CGI script. Suppose it's like `tail -f logfile'.

1 Requirements

2 Recommended Environment

3 Download

[RAA:belld]

4 Install

  1. Copy belld.rb, bell.rb, belld-uri.rb, and drbacl.rb somewhere.
  2. Change belld-uri.rb and drbacl.rb if you need. Appropriate setting enables belld notify from remote host. Needless to say, be careful of security.

5 Invoke the Server

As belld is based on dRuby, you must invoke the server program first. In this console, the event log is writteen from client program.

$ belld.rb

6 Invoke the Client

The client program can be used not only from commandline but also from ruby library.

6.1 From Commandline

The client writes evant log with bell. It writes STDIN to the blackboard with no option. With `-s' option, it writes content of an argument.

$ echo log | bell.rb
$ bell.rb -s log

With `-q' option, it is quiet.

$ bell.rb -q -s silent

6.2 From Ruby Library

The client program is a Ruby library too.

require 'bell'
bell_message( str = "" )

Write str with bell.

message( str = "" )

Write str without bell.

6.3 From Ruby Library (IO compatible)

The global variable `$bell' contains a BellIO object. It has `>>', `print', `puts', `printf' methods.

require 'stringio'
$nullout = StringIO.new

def f(debugout=$nullout)
  debugout.puts "debug!"
  # do something
end

f       # Nothing is printed.
f $>    # print at stdout.
f $bell # print at the blackboard.

6.4 Examples

7 License

GPL.

8 History

[2005/03/25]

BellIO class.

[2003/06/07]

First release.


戻る ホームページへ戻る

Valid XHTML 1.0!
rubikitch(rubikitch@ruby-lang.org)

投書箱:コメントや伝えたい情報などがあればお気軽にどうぞ
名前 メール [説明]
URL
本文