Sha256: 96f50e0a4fcc7f7bf1164680d6ce29af12e7e8746c3c771d79eec496c2a067c9

Contents?: true

Size: 907 Bytes

Versions: 36

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true
require 'blackbox/gem'
require 'config'

module Hu
  API_TOKEN = ENV['HEROKU_API_KEY'] || ENV['HEROKU_API_TOKEN'] || Netrc.read['api.heroku.com']&.password
  CONFIG_FILE = File.join(ENV['HOME'], '.hu.yaml')
end

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

Config.load_and_set_settings Hu::CONFIG_FILE

begin
  unless ENV['SKIP_VERSION_CHECK']
    version_info = BB::Gem.version_info(check_interval: 900)
    if version_info[:gem_update_available]
      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
rescue
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
hu-3.0.1 lib/hu/common.rb
hu-3.0.0 lib/hu/common.rb
hu-2.0.25 lib/hu/common.rb
hu-2.0.24 lib/hu/common.rb
hu-2.0.23 lib/hu/common.rb
hu-2.0.22 lib/hu/common.rb
hu-2.0.21 lib/hu/common.rb
hu-2.0.20 lib/hu/common.rb
hu-2.0.19 lib/hu/common.rb
hu-2.0.18 lib/hu/common.rb
hu-2.0.17 lib/hu/common.rb
hu-2.0.16 lib/hu/common.rb
hu-2.0.15 lib/hu/common.rb
hu-2.0.14 lib/hu/common.rb
hu-2.0.13 lib/hu/common.rb
hu-2.0.12 lib/hu/common.rb
hu-2.0.11 lib/hu/common.rb
hu-2.0.10 lib/hu/common.rb
hu-2.0.9 lib/hu/common.rb
hu-2.0.8 lib/hu/common.rb