lib/hu/common.rb in hu-1.3.16 vs lib/hu/common.rb in hu-1.3.17
- old
+ new
@@ -1,25 +1,33 @@
# 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
+require 'hu/telemetry'
+
unless ENV['SKIP_VERSION_CHECK']
version_info = BB::Gem.version_info(check_interval: 900)
unless version_info[:installed_is_latest] == true
+ Hu::Tm.t(:gem_outdated, installed_version: version_info[:gem_installed_version], available_version: version_info[:gem_latest_version])
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
+
+Hu::Tm.t(:launch)