#-----------------------------------------------------------
# Tool Installing Script of Rumix
#
# Author:   Dice <tetradice+ruby@gmail.com>
# License:  NYSL 0.9982 (http://www.kmonos.net/nysl/)
# URL:      http://ruby.morphball.net/rumix/
#-----------------------------------------------------------

ruby_path = ARGV[0]
script_path = ARGV[1]
log_path = ARGV[2]
tool_name = ARGV[3] || 'tool'


puts "#{tool_name} installing..."
$stdout.flush
suc = nil
open(log_path, 'w'){|f|
	STDOUT.reopen(f)
	STDERR.reopen(f)
	suc = system("#{ruby_path} #{script_path}")
}

if suc then
	exit
else
	exit($?)
end
