Last active
August 29, 2015 13:56
-
-
Save ftiasch/9105635 to your computer and use it in GitHub Desktop.
A auto-updated scripts for topcoder arena
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rexml/document' | |
require 'open-uri' | |
task :default => :run | |
task :run do | |
sh '(java -classpath "lib/*" com.topcoder.client.contestApplet.runner.generic www.topcoder.com 5001 >/dev/null 2>&1 &)' | |
end | |
task :update do | |
document = REXML::Document.new(open('http://www.topcoder.com/contest/arena/ContestAppletProd.jnlp')) | |
dependencies = [] | |
document.each_element('jnlp/resources/jar') do |jar| | |
dependencies << jar.attribute('href') | |
end | |
rm_rf 'lib' | |
mkdir 'lib' | |
chdir 'lib' | |
dependencies.each do |dependency| | |
sh "wget -c \"#{dependency}\"" | |
end | |
chdir '..' | |
end | |
task :make => :update do | |
sh "tar czvf topcoder.tar.gz run.bat run.sh lib/" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment