Sha256: ff3e5ff9bc0269b21319c10c983211b13527ffe3f1186b3d74041eac7a8cce34

Contents?: true

Size: 734 Bytes

Versions: 47

Compression:

Stored size: 734 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)
  File.binwrite(file.name, URI.parse(url).read)
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
mn2pdf-1.49 Rakefile
mn2pdf-1.48 Rakefile
mn2pdf-1.47 Rakefile
mn2pdf-1.46 Rakefile
mn2pdf-1.45 Rakefile
mn2pdf-1.44 Rakefile
mn2pdf-1.42 Rakefile