Sha256: caa97125866492a3453bc5078921c4fefe9422440883e4a9878991c27d2a9788
Contents?: true
Size: 766 Bytes
Versions: 20
Compression:
Stored size: 766 Bytes
Contents
require "bundler/gem_tasks" require "rspec/core/rake_task" require "open-uri" require_relative "lib/mn2pdf/version" RSpec::Core::RakeTask.new(:spec) task default: ["bin/mn2pdf.jar", :spec] def jar_url(ver) "https://github.com/metanorma/mn2pdf/releases/download/v#{ver}/mn2pdf-#{ver}.jar" end file "bin/mn2pdf.jar" do |file| if Mn2pdf::VERSION != Mn2pdf::MN2PDF_JAR_VERSION begin URI.parse(jar_url(Mn2pdf::VERSION)).open abort(%(MN2PDF_JAR_VERSION in lib/mn2pdf/version.rb is outdated! Assign VERSION to MN2PDF_JAR_VERSION)) rescue OpenURI::HTTPError, Errno::ENOENT # expected end end url = jar_url(Mn2pdf::MN2PDF_JAR_VERSION) print "Downloading #{url}..." File.binwrite(file.name, URI.parse(url).read) end
Version data entries
20 entries across 20 versions & 1 rubygems