unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Apollo;

type
  TForm1 = class(TForm)
    Apollo1: TApollo;
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
    procedure Apollo1BeforeExec(Sender: TObject);
    procedure Apollo1AfterExec(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

uses Rubies, Pythia;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  rb_ary_push(ap_load_path, rb_str_new2('C:/home/moriq/lib'));
  rb_ary_unshift(ap_load_path, rb_str_new2('D:/lib'));
  Apollo1.Execute(Memo1.Lines);
end;

procedure TForm1.Apollo1BeforeExec(Sender: TObject);
begin
//  rb_p(rb_str_new2('BeforeExec'));
  ShowMessage('BeforeExec');
end;

procedure TForm1.Apollo1AfterExec(Sender: TObject);
begin
//  rb_p(rb_str_new2('AfterExec'));
  ShowMessage('AfterExec');
end;

end.
