Sha256: 592a0ae8b97ec896cb99b3918d3f03a0337409a517f0b340bcae35b42eb08f04
Contents?: true
Size: 1013 Bytes
Versions: 6
Compression:
Stored size: 1013 Bytes
Contents
# frozen_string_literal: true require 'uffizzi/helpers/config_helper' module Uffizzi module LoginHelper class << self def prepare_request_params(username, password) { user: { email: username, password: password, }, } end def set_server(options) config_server = ConfigFile.exists? ? Uffizzi::ConfigHelper.read_option_from_config(:server) : nil server_address = (options[:server] || config_server || Uffizzi.ui.ask('Server:')).sub(/\/+$/, '') server_address.start_with?('http:', 'https:') ? server_address : "https://#{server_address}" end def set_username(options) config_username = ConfigFile.exists? ? Uffizzi::ConfigHelper.read_option_from_config(:username) : nil options[:username] || config_username || Uffizzi.ui.ask('Username:') end def set_password ENV['UFFIZZI_PASSWORD'] || Uffizzi.ui.ask('Password:', echo: false) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems