Sha256: a8f444fb6ba9912090b165e4b14463c931f462df93dbce069c00fc053b20b05e

Contents?: true

Size: 1.32 KB

Versions: 1

Compression:

Stored size: 1.32 KB

Contents

# encoding: utf-8
# frozen_string_literal: false
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
EOS

JRUBYC_VERSION = '9.1.0.0'.freeze

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

desc 'download, and copy to propane'
task default: [:download, :copy_ruby]

desc 'download JRuby upstream sources'
task download: ["jruby-complete-#{JRUBYC_VERSION}.jar"]

file "jruby-complete-#{JRUBYC_VERSION}.jar" do
  begin
    sh "wget https://s3.amazonaws.com/jruby.org/downloads/#{JRUBYC_VERSION}/jruby-complete-#{JRUBYC_VERSION}.jar"
  rescue
    warn(WARNING)
  end
  check_sha256("jruby-complete-#{JRUBYC_VERSION}.jar", "8a4b5f4cbdcfd43272002a543a59abfbf419577ef679273d4893a4f09594267e")
end

directory '../lib/ruby'

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
propane-0.6.0-java vendors/Rakefile