Sha256: 7f59e70fd21a33fc6d8e6ed70018bce0872e35d2323457757bccf7abe889f883

Contents?: true

Size: 1.74 KB

Versions: 4

Compression:

Stored size: 1.74 KB

Contents

# -*- ruby -*-
#
# Copyright (C) 2008-2024  Sutou Kouhei <kou@clear-code.com>

Encoding.default_internal = "UTF-8" if defined?(Encoding.default_internal)

# TODO: Remove me when we drop Ruby 1.9 support.
unless "".respond_to?(:b)
  class String
    def b
      dup.force_encoding("ASCII-8BIT")
    end
  end
end

require "erb"
require "yaml"
require "rubygems"
require "rake/clean"
require "yard"
require "bundler/gem_helper"
require "packnga"

task :default => :test

base_dir = File.dirname(__FILE__)

helper = Bundler::GemHelper.new(base_dir)
def helper.version_tag
  version
end

helper.install
spec = helper.gemspec

document_task = Packnga::DocumentTask.new(spec) do |task|
  task.original_language = "en"
  task.translate_languages = ["ja"]
end

Packnga::ReleaseTask.new(spec) do |task|
  test_unit_github_io_dir_candidates = [
    "../../www/test-unit.github.io",
  ]
  test_unit_github_io_dir = test_unit_github_io_dir_candidates.find do |dir|
    File.directory?(dir)
  end
  task.index_html_dir = test_unit_github_io_dir
end

task :test do
  ruby("test/run-test.rb")
end

namespace :doc do
  task :add_permalink do
    news_md = File.read("doc/text/news.md")
    applied_permalink = news_md.gsub(/(?<pre>\[GitHub#(?<ref>\d+)\])(?!\()/) do
      "#{Regexp.last_match[:pre]}(https://github.com/test-unit/test-unit/issues/#{Regexp.last_match[:ref]})"
    end

    File.write("doc/text/news.md", applied_permalink)
  end
end

release_task = Rake.application["release"]
# We use Trusted Publishing.
release_task.prerequisites.delete("build")
release_task.prerequisites.delete("release:rubygem_push")
release_task_comment = release_task.comment
if release_task_comment
  release_task.clear_comments
  release_task.comment = release_task_comment.gsub(/ and build.*$/, "")
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
es_cli-0.1.0 vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/Rakefile
test-unit-3.6.7 Rakefile
test-unit-3.6.6 Rakefile
test-unit-3.6.5 Rakefile