Sha256: 18b84c5130abd9ecc3672feae7f896f23e3f33fefe75982764eb9579a21bcb0e

Contents?: true

Size: 931 Bytes

Versions: 1

Compression:

Stored size: 931 Bytes

Contents

# frozen_string_literal: true

class RakeHelper
  GITHUB_PACKAGES_PUSH_COMMAND =
    "gem push --key github --host https://rubygems.pkg.github.com/milkeclair " \
    "pkg/jp-translator-from-gpt-#{JpTranslatorFromGpt::VERSION}.gem".freeze

  RUBYGEMS_PUSH_COMMAND =
    "gem push --host https://rubygems.org " \
    "pkg/jp-translator-from-gpt-#{JpTranslatorFromGpt::VERSION}.gem".freeze

  def self.init_rake_tasks
    RSpec::Core::RakeTask.new(:spec) { |task| task.verbose = false }
    RuboCop::RakeTask.new
    YARD::Rake::YardocTask.new
  end

  def self.build_gem
    abort("gemのビルドに失敗しました") unless system("rake build")
  end

  def self.push_to_github_packages
    abort("githubへのgemのpushに失敗しました") unless system(GITHUB_PACKAGES_PUSH_COMMAND)
  end

  def self.push_to_rubygems
    abort("rubygemsへのgemのpushに失敗しました") unless system(RUBYGEMS_PUSH_COMMAND)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jp-translator-from-gpt-1.0.2 rake_helper.rb