[トップ] [更新履歴] [著書] [コンピュータ] [ゲーム] [CGI配布]
-> 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'.
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
The client program can be used not only from commandline but also from ruby library.
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
The client program is a Ruby library too.
require 'bell'
bell_message( str = "" )Write str with bell.
message( str = "" )Write str without bell.
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.
At the bottom of a time-consuming shell script, write the following when you want belld to notify you the end of script.
bell.rb -s 'foo finished'
When you want to know the value of a variable `x' in CGI script, write the following.
require 'bell'; message x
GPL.
BellIO class.
First release.