Sha256: f10aaa6236f68994ba6df78590b78add547a33358bd392d7256b0c41bd62e920
Contents?: true
Size: 1.21 KB
Versions: 5
Compression:
Stored size: 1.21 KB
Contents
############################################################################## # File:: client_access.rb # Purpose:: Module providing client access helper methods for CLI classes. # # Author:: Jeff McAffee 07/17/2014 # ############################################################################## module AdminModule module Command module ClientAccess private def credentials config = AdminModule.configuration user, pass = config.user_credentials if user.nil? || pass.nil? user = ask "username for #{config.current_env} environment:" pass = ask "password:", echo: false # Force a new line - hiding the echo on the password eats the new line. say "\n" end [user, pass] end def client return @client unless @client.nil? @client = AdminModule.client @client.env = options[:environment] unless options[:environment].nil? user, pass = credentials if user.empty? || pass.empty? say "aborting deploy", :red return end @client.user = user @client.password = pass @client end end # ClientAccess end end # AdminModule
Version data entries
5 entries across 5 versions & 1 rubygems