rubyphunk / rspactor
- Source
- Commits
- Network (13)
- Issues (1)
- Wiki (1)
- Graphs
-
Tree:
d9b18ab
rspactor / rspactor_bin.rb
| b7eedb5b » | rubyphunk | 2008-06-22 | 1 | #!/usr/bin/env ruby | |
| f8d36aa8 » | rubyphunk | 2008-07-15 | 2 | require 'timeout' | |
| 3 | require 'drb' | ||||
| b7eedb5b » | rubyphunk | 2008-06-22 | 4 | ||
| 5 | # Load application | ||||
| f8d36aa8 » | rubyphunk | 2008-07-15 | 6 | if ARGV[0] == '--dev' | |
| 75bd8137 » | rubyphunk | 2008-11-17 | 7 | system("open /Work/rubyphunk/rspactor_app/build/Release/RSpactor.app") | |
| f8d36aa8 » | rubyphunk | 2008-07-15 | 8 | else | |
| 9 | system('open -b com.dynamicdudes.RSpactor') | ||||
| 10 | end | ||||
| 11 | |||||
| 12 | # Ping and Pong | ||||
| 13 | Timeout::timeout(10) do | ||||
| 14 | @service = DRbObject.new(nil, "druby://127.0.0.1:28127") | ||||
| 15 | while true | ||||
| 16 | begin | ||||
| 17 | if @service.ping | ||||
| 18 | @service.incoming(:relocate_and_run, Dir.pwd) | ||||
| 19 | exit | ||||
| 20 | end | ||||
| 21 | rescue; end | ||||
| 22 | sleep 1 | ||||
| 23 | end | ||||
| 24 | end | ||||

