Sha256: 634fe8ff777b4ef03ded5b097733822972b718b840b87f0f21f04464dfe1119f

Contents?: true

Size: 777 Bytes

Versions: 12

Compression:

Stored size: 777 Bytes

Contents

desc 'Download and unpack the latest HtmlUnit assembly'
task :snapshot, :file do |t, args|
  if args.file
    sh "cp #{args.file} ./"
    basename = File.basename(args.file)
  else
    url = "http://build.canoo.com/htmlunit/artifacts/htmlunit-2.9-SNAPSHOT-with-dependencies.zip"
    sh "curl -O #{url}"
    basename = File.basename(url)
  end

  shortname = basename[/(.+?)\.zip/, 1].sub("-with-dependencies", '')
  sh "rm -rf lib/celerity/htmlunit/*.jar"
  sh "unzip -tq #{basename}"
  sh %Q{unzip -C #{basename} "#{shortname}/lib/*.jar" -d lib/celerity/htmlunit }

  puts "Fixing paths..."
  sh "cp -R lib/celerity/htmlunit/#{shortname}/lib/*.jar lib/celerity/htmlunit/"

  puts "Cleaning..."
  rm_r "lib/celerity/htmlunit/#{shortname}/"
  rm basename

  puts "...done!"
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
celerity-0.8.9 tasks/snapshot.rake
celerity-0.8.9.pre tasks/snapshot.rake
celerity-0.8.8 tasks/snapshot.rake
celerity-0.8.7 tasks/snapshot.rake
celerity-0.8.6 tasks/snapshot.rake
celerity-0.8.5 tasks/snapshot.rake
celerity-0.8.4 tasks/snapshot.rake
celerity-0.8.2 tasks/snapshot.rake
celerity-0.8.1 tasks/snapshot.rake
oki-celerity-0.8.2 tasks/snapshot.rake
oki-celerity-0.8.1 tasks/snapshot.rake
oki-celerity-0.8.1.dev tasks/snapshot.rake