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

Version Path
mn2pdf-2.10 Rakefile
mn2pdf-2.09 Rakefile
mn2pdf-2.08 Rakefile
mn2pdf-2.07 Rakefile
mn2pdf-2.06 Rakefile
mn2pdf-2.05 Rakefile
mn2pdf-2.04 Rakefile
mn2pdf-2.03 Rakefile
mn2pdf-2.02 Rakefile
mn2pdf-2.01 Rakefile
mn2pdf-2.00 Rakefile
mn2pdf-1.99 Rakefile
mn2pdf-1.98 Rakefile
mn2pdf-1.97 Rakefile
mn2pdf-1.96 Rakefile
mn2pdf-1.95 Rakefile
mn2pdf-1.94 Rakefile
mn2pdf-1.93 Rakefile
mn2pdf-1.92 Rakefile
mn2pdf-1.91 Rakefile