hiptest/hiptest-publisher

View on GitHub
bin/hiptest-publisher

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby

# Don't try to run this binary directly. Instead:
#
#   * `hiptest-publisher` if installed through rubygems, relying on the rubygem
#     wrapper
#
#   * `bundle exec ruby -I lib bin/hiptest-publisher` if doing hiptest-publisher
#     development. You can define an alias for this command and run it as if
#     you were running the gem natively.
#
#         alias hiptest-publisher='bundle exec ruby -I lib bin/hiptest-publisher'
#

require 'ruby_version'
require 'hiptest-publisher/i18n'
require 'hiptest-publisher/utils'

# Ensure ruby version >= 2.7
if RubyVersion < '2.7.0'
  STDERR.puts(I18n.t('ruby_version.required_version', version: '2.7.0'))
  STDERR.puts(I18n.t('ruby_version.current_version', engine: RUBY_ENGINE, version: RUBY_VERSION))
  STDERR.puts(I18n.t('ruby_version.use_more_recent'))

  if RubyVersion.is? 2.6
    STDERR.puts(I18n.('ruby_version.support_ended', version: '2.6.0', year: '2022', month: '03', day: '31'))
  elsif RubyVersion.is? 2.5
    STDERR.puts(I18n.('ruby_version.support_ended', version: '2.5.0', year: '2021', month: '03', day: '31'))
  elsif RubyVersion.is? 2.4
    STDERR.puts(I18n.('ruby_version.support_ended', version: '2.4.0', year: '2020', month: '03', day: '31'))
  end
  exit 1
end

if RubyVersion < '3.0'
  STDERR.puts(I18n.t('ruby_version.current_version', engine: RUBY_ENGINE, version: RUBY_VERSION))
  STDERR.puts(I18n.t('ruby_version.deprecation_warning', version: '2.7'))
  STDERR.puts(I18n.t('ruby_version.support_ended', version: '2.7', year: '2023', month: '03', day: '31'))
end

require 'hiptest-publisher'
begin
  require 'pry' # only available in development
rescue StandardError, LoadError
end

Hiptest::Publisher.new(ARGV).run