Class: KRL_CMD::Info

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

Class Method Summary collapse

Class Method Details

.go(options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/info.rb', line 3

def self.go(options)
  user = User.new
  app_id = nil
  if(options["app"] && options["app"].length > 0)
    app_id = options["app"]
  else
    app_id = KRL_COMMON::get_app().application_id rescue nil
  end
  raise "Unable to determine the application id. Use 'krl help info' for more information." unless app_id
  
  app_info = user.api.get_app_info(app_id)
  app_details = user.api.get_app_details(app_id)

  puts "Application Users"
  KRL_COMMON::pretty_table(app_details["users"], [
    {:field => "Login", :value => lambda { |r| r["username"] }},
    {:field => "Last Name", :value => lambda { |r| r["lastname"] }},
    {:field => "First Name", :value => lambda { |r| r["firstname"].to_s }},
    {:field => "Role", :value => lambda { |r| r["role"] }}
  ])
  puts ""
  puts ""

  puts "Production Version"
  if(app_info["production"])
    puts "Current production version is #{app_info["production"]["version"]} IE Guid : #{app_details["guid"]}"
  else
    puts "No production version."
  end
  puts ""
  puts ""

  puts "Development Version"
  if(app_info["development"])
    puts "Current development version is #{app_info["development"]["version"]} IE Guid : #{app_details["guid"]}"
  else
    puts "No development version."
  end
end