Sha256: 0428941b5f841d80fa281890333e4f24cb34d74c28417595d5440d9062f50883

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

require 'rake/clean'

WARNING = <<-EOS 
   WARNING: you may not have wget installed, you could just download
   the correct version of jruby-complete to the vendors folder, and 
   re-run k9 setup install instead of installing wget. Some systems
   may also require 'sudo' access to install, NB: this is untested....
      
EOS

JRUBY_VERSION      = "1.7.13"

CLOBBER.include("jruby-complete-#{JRUBY_VERSION}.jar")

desc "download, and copy to ruby-processing"
task :default => [:download, :copy_ruby]

desc "download JRuby upstream sources"
task :download => ["jruby-complete-#{JRUBY_VERSION}.jar"]

file "jruby-complete-#{JRUBY_VERSION}.jar" do
  begin
    sh "wget http://jruby.org.s3.amazonaws.com/downloads/#{JRUBY_VERSION}/jruby-complete-#{JRUBY_VERSION}.jar"
    check_sha1("jruby-complete-#{JRUBY_VERSION}.jar", "0dfca68810a5eed7f12ae2007dc2cc47554b4cc6")
  rescue
    warn(WARNING)
  end
end

directory "../lib/ruby"

desc "copy jruby-complete"
task :copy_ruby => ["../lib/ruby"] do
  sh "cp -v jruby-complete-#{JRUBY_VERSION}.jar ../lib/ruby/jruby-complete.jar"
end

def check_sha1(filename, expected_hash)
  require "digest/sha1"
  sha1 = Digest::SHA1.new
  File.open(filename, "r") do |f|
    while buf = f.read(4096)
      sha1.update(buf)
    end
  end
  if sha1.hexdigest != expected_hash
    raise "bad sha1 checksum for #{filename} (expected #{expected_hash} got #{sha1.hexdigest})"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-processing-2.6.0 vendors/Rakefile
ruby-processing-2.5.1 vendors/Rakefile
ruby-processing-2.5.0 vendors/Rakefile