Class: Acs2aws::Cli::ConfigCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/acs2aws/cli/config.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/acs2aws/cli/config.rb', line 15

def execute
  puts 'SAML SP Start Page URL:'.colorize(:red)
  sp_url = STDIN.gets.chomp
  until URI.parse(sp_url).is_a?(URI::HTTP)
    puts 'Error: '.colorize(:red) + 'URL must be a valid uri with a scheme matching the http https pattern. Please enter again.'
    sp_url = STDIN.gets.chomp
  end
  File.open(Acs2aws::CONFIG_PATH, 'w') { |f| f.write sp_url }
  puts 'Successfully configure.'.colorize(:green)
end