cli/lib/rbld_dockerops.rb in rbld-1.3.2 vs cli/lib/rbld_dockerops.rb in rbld-1.3.3
- old
+ new
@@ -1,9 +1,9 @@
require 'docker_registry2'
require_relative 'rbld_log'
require_relative 'rbld_utils'
-require 'fancy_gets'
+require 'highline'
module Rebuild
module Registry
module Docker
extend Rebuild::Utils::Errors
@@ -11,12 +11,10 @@
rebuild_errors \
RegistryOperationError: nil,
RegistryNotAuthenticatedError: nil
class EnvironmentImage
- include FancyGets
-
def initialize(api_module = ::Docker)
@api_module = api_module
end
def publish(img, target_url)
@@ -38,17 +36,21 @@
do_login
yield
end
end
+ def get_password
+ HighLine.new($stdin, $stderr).ask('') { |q| q.echo = '*' }
+ end
+
def get_credential(name, is_secret = false)
print "#{name}: "
predefined = ENV["RBLD_CREDENTIAL_#{name.upcase}"]
unless predefined.to_s.empty?
puts "<environment>"
predefined
else
- is_secret ? gets_password : STDIN.gets.chomp
+ is_secret ? get_password : STDIN.gets.chomp
end
end
def get_secret_credential(name)
get_credential( name, true )