title: Apollo - Delphi Ruby interface
header:
%c:Last-Modified: % %e:Time.now.strftime('%%Y/%%m/%%d')%
end
%html:<center>%
%html:<img src="pa0.gif" alt="Project Apollo">%
%i:rubyring.htm% %href:http://www.ruby-lang.org/ja/ Ruby.home% %href:ftp://ftp.netlab.co.jp/pub/lang/ruby/ Ruby.get%
%html:</center>%
[ %href:index.html Japanese% ] / [ %href:index-en.html English% ] Hello, another way.

Dream duet of %href:http://www.inprise.com/delphi/ Delphi% and %href:http://www.ruby-lang.org/en/ Ruby% .

: Apollo = Delphi + Ruby
  Let's try.

1.1. Platform

Apollo runs on the environment on which Delphi6 can run. At present, it runs on MS-Windows 95/98/NT4.0 or later.

I expect that Apollo will run on Unix, when Borland would release Kylix. The current version's Apollo for Kylix had many problems and it was not usable.

1.1. Download

: Apollo binaries + Delphi6 runtime packages

  : %href:http://www.moriq.com/apollo/archive/ap-636_bde60.msi .%
    bin, lib, doc, sample, VCL60, BDE

: BDE module configuration file

  : %href:http://www.moriq.com/apollo/archive/bdemerge.ini .%
    with %c:.msi%

: Apollo binaries + Apollo sources

  : %href:http://www.moriq.com/apollo/archive/ap-636_vcl60.zip .%
    bin, lib, doc, sample, src for Delphi6

1.1. Install

Expand distributed files. That is all.

Executable files which were contained in Apollo Distribution.

Apollo has some files with .exe extension.

: Apollo.exe
  A development environment with simple editor.
: ruby_ap.exe
  A executable environment on DOS console.

1.1. Usage

If you could not run Apollo, your computer may not have VCL60, and please install MSI release or other proper VCL library.

--text
  Apollo Main Window
  +-----------------------------------------------------------+
  | ..Apollo                                            _ o x |
  +-----------------------------------------------------------+
  | +---------------------------+ +-----------+ +-----------+ |
  | | foo.rb   (Command Line)   | | Browse..  | | Execute   | |
  | +---------------------------+ +-----------+ +-----------+ |
  | +-----------------------------------------------------+-+ |
  | | require 'Phi'                                       | | |
  | |                                                     | | |
  | | form = Form.new        (Memo Window)                | | |
  | |                                                     | | |
  | | .......                                             | | |
  | |                                                     | | |
  | |                                                     | | |
  | +-----------------------------------------------------+-+ |
  | Ready                    (Status Line)                    |
  +-----------------------------------------------------------+
--
At start time, "Command Line" is "foo.rb", and Apollo trys to read foo.rb on the current directory. And Apollo shows foo.rb in the Memo Window if it exist. Otherwise, the Memo is empty.

You can input Ruby script file and its option on the Command Line.
--text
foo.rb foo.txt
--
You can click "Execute" button and run the script which was written on the Command Line.

When you click "Browse" button, you will see a "Open File" dialog.

"Execute" button will be replaced by "Terminate" button, when the script was running. And you can terminate the execution of the script by pushing "Terminate" button.

"Execute" button or "Terminate" button is replaced by "Save" button, when you changed the script in the Memo Window. And you can save your change to the file which was described in Command Line window.

1.1. What is Apollo?

I call Apollo as a whole system which connect Ruby and Delphi.

Apollo is under experiment and not fixed. Design may be changed.

1.1. What is Phi?

Phi is Ruby extension library to use Delphi's Visual Component Library(VCL). Usage is as same as other Ruby extension library. That is;
--ruby
require 'phi'
--
Then you can use a module of VCL. At first, try to make a form.
--ruby
form = Phi::Form.new
form.show
--
And, make a button and its handler for clicks.
--ruby
btn = Phi::Button.new(form, :btn)
def btn.on_click
  print "click!\n"
end
--
Finally, run a event loop.
--ruby
Phi.mainloop
--
I hope you will enjoy powerfull Delphi's VCL with simple Ruby script.

1.1. Mailing list

: Project Apollo ML
  %href:mailto:ap-list@freeml.com%

author: YOSHIDA Kazuhiro
footer:
  Translated by Kumagai Hidetake(take_tk).
  I hope you will correct my rude English, please.
end