{{toc}}

How to use "Register Script"

part 1. RubyUnit

This sample reguires RubyUnit is installed. You can get RubyUnit from the URL. http://homepage1.nifty.com/markey/ruby/rubyunit/index_e.html

Name : UnitTest
Key : Alt + 0
Path : c2t.rb
Input ARGV before Run : checked
Target: None
Output: None

part 2. Run GUI Script

This sample requires VisualuRuby is installed. You can get VisualuRuby from the URL. http://www.threeweb.ad.jp/~nyasu/vruby/vrproject-e.html

Register the ruby source file viewer using treeview. http://www.threeweb.ad.jp/~nyasu/vruby/rbdview.lzh

Check the [GUI Script] property on the [Tools]-[Option]-[Other].

Name: RBView
Key: Alt + 1
Path: rbview.rb correct path
Ruby Script: checked
Input ARGV before Run: unchecked
Target: CurrentActiveFile
Output: None
Run Other Program: unchecked

part 3. OpenFolder

Open the folder of the active code window.

Name: OpenFolder
Key: Alt + 2
Path: c:\winnt\explorer.exe /e,/select, 
Ruby Script: unchecked
Input ARGV before Run: unchecked
Target: Current ActiveFile
Output: None
Run Other Program: unchecked

part 4. Change the letters of selection to uppercase.

Name: Upcase
Key: Alt + 5
Path: -pe 'gsub(/./){|s| s.upcase}'
Ruby Script: checked
Input ARGV before Run: unchecked
Targe: Selection
Output: Self
Run Other Program: unchecked

Debug Apollo (other GUI scripts)

When you debug the scripts of Apollo, you have to wait too long(5-10 min.) to start debugging.

This reason is that debugger uses the set_trace_func. Debugger executes step by step in phi.dll, so it takes too long time.

For avoiding the slow start, you add the '-r phi' to the [Ruby Program Path] in the [Tools]-[Options]-[Ruby].

ex.)

D:\Tools\apollo\bin\ruby_ap.exe -r phi

How to use Run By

Numbering to the selected strings. Write code below in the new code window(ex. (blank2)).

i = 20
while gets
  printf "%2d %s", i, $_
  i += 1
end

Select the target and click right button. And select the code window (blank2) in [Run By] menu