Class: Info

Inherits:
Object
  • Object
show all
Defined in:
lib/sty/info.rb

Instance Method Summary collapse

Instance Method Details

#account_info(partial) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/sty/info.rb', line 26

def (partial)

  config = yaml('auth')

  puts "Searching config for '#{partial}':"
  result = deep_find(config, partial)

  if result.any?
    result.each do |k, v|
      puts "#{k}: #{v}"
    end
  else
    puts 'Nothing found'
  end
end

#session_infoObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/sty/info.rb', line 5

def session_info
  if ENV['AWS_ACTIVE_ACCOUNT']
    puts "Active account: #{white(ENV['AWS_ACTIVE_ACCOUNT'])}"
  else
    puts red("You are not authenticated with sty")
  end

  if ENV['AWS_ACTIVE_IDENTITY']
    puts "Active identity: #{white(ENV['AWS_ACTIVE_IDENTITY'])}"
  end

  if ENV['AWS_SESSION_EXPIRY']
    if remained_minutes > 0
      puts "Session active, expires in #{white(remained_minutes)} min."
    else
      puts red("Session expired")
    end
  end

end