-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfireruby
More file actions
executable file
·41 lines (33 loc) · 777 Bytes
/
fireruby
File metadata and controls
executable file
·41 lines (33 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
if [ `uname` = 'Darwin' ]; then
firefox=/Applications/Firefox.app/Contents/MacOS/firefox-bin
ext='.dylib'
else
firefox=/opt/firefox/firefox-bin
ext='.so'
fi
if [ ! -e $firefox ]; then
echo no firefox-bin
exit 1
fi
rubylib=`ruby -e 'puts $:[0].gsub(/\/ruby.+\Z/,"")'`/libruby$ext
if [ ! -e $rubylib ]; then
echo no rubylib
exit 1
fi
apppath=`ruby -e "puts File.dirname(File.expand_path('$0'))"`
DEBUG=
while getopts d OPT
do
case $OPT in
"d" ) DEBUG=" -jsconsole" ;;
esac
done
shift `expr $OPTIND - 1`
if [ $1 ];then
script=`ruby -e "puts File.expand_path('$1')"`
arg="-script $script"
else
arg=
fi
$firefox -app $apppath/application.ini -rubylib $rubylib -main $apppath"/chrome/content/main.rb" $arg $DEBUG -foreground