Sha256: 34804c6e79b0745888cde8d1cadf2f88eef11e2ba32eae4e04030d0458d0f76e

Contents?: true

Size: 765 Bytes

Versions: 4

Compression:

Stored size: 765 Bytes

Contents

# frozen_string_literal: true
require 'blackbox/gem'

module Hu
  API_TOKEN = ENV['HEROKU_API_KEY'] || ENV['HEROKU_API_TOKEN'] || Netrc.read['api.heroku.com']&.password
end

class String
  def strip_heredoc
    indent = scan(/^[ \t]*(?=\S)/).min&.size || 0
    gsub(/^[ \t]{#{indent}}/, '')
  end
end

unless ENV['SKIP_VERSION_CHECK']
  version_info = BB::Gem.version_info(check_interval: 900)
  unless version_info[:installed_is_latest] == true
    puts
    puts "\e[33;1mWoops! \e[0mA newer version of #{version_info[:gem_name]} is available."
    puts "       Please type '\e[1mgem install #{version_info[:gem_name]}\e[0m' to upgrade (v#{version_info[:gem_installed_version]} -> v#{version_info[:gem_latest_version]})."
    sleep 1
    puts
    exit 1
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hu-1.3.16 lib/hu/common.rb
hu-1.3.15 lib/hu/common.rb
hu-1.3.14 lib/hu/common.rb
hu-1.3.13 lib/hu/common.rb