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.87.1 Rakefile
mn2pdf-1.87 Rakefile
mn2pdf-1.86 Rakefile
mn2pdf-1.85 Rakefile
mn2pdf-1.84 Rakefile
mn2pdf-1.83 Rakefile
mn2pdf-1.82 Rakefile
mn2pdf-1.81 Rakefile
mn2pdf-1.80 Rakefile
mn2pdf-1.79 Rakefile
mn2pdf-1.78 Rakefile
mn2pdf-1.77 Rakefile
mn2pdf-1.76 Rakefile
mn2pdf-1.75 Rakefile
mn2pdf-1.74 Rakefile
mn2pdf-1.73 Rakefile
mn2pdf-1.72 Rakefile
mn2pdf-1.71 Rakefile
mn2pdf-1.70 Rakefile
mn2pdf-1.69 Rakefile