krl 0.1.52 → 0.1.54

Sign up to get free protection for your applications and to get access to all the features.
data/bin/krl CHANGED
@@ -17,7 +17,7 @@ COMMANDS = {
17
17
  "check" => lambda { |args| require LIB_DIR + 'check'; KRL_CMD::Check.go },
18
18
  "generate" => lambda { |args| require LIB_DIR + 'generate'; KRL_CMD::Generate.go(args) },
19
19
  "test" => lambda { |args| require LIB_DIR + 'test'; KRL_CMD::Test.go(args) },
20
- "app_info" => lambda { |args| require LIB_DIR + 'app_info'; KRL_CMD::AppInfo.go(args) }
20
+ "info" => lambda { |args| require LIB_DIR + 'info'; KRL_CMD::Info.go(args) }
21
21
  }
22
22
 
23
23
  banner = "Usage: krl <command> <args>\nUse 'krl help' for more information."
@@ -27,7 +27,7 @@ if COMMANDS.keys.include? cmd
27
27
  begin
28
28
  COMMANDS[cmd].call(ARGV)
29
29
  rescue Exception => e
30
- puts "Error: #{e.message}\n#{e.backtrace.join("\n")}"
30
+ puts "Error: #{e.message}"
31
31
  end
32
32
  else
33
33
  puts banner
@@ -22,6 +22,11 @@ module KRL_CMD
22
22
  puts "create".ljust(20) + "Creates a new application. Specify an app name and, optionally, a description."
23
23
  puts " ".ljust(20) + "Example: krl create 'Hello World'"
24
24
  puts " ".ljust(20) + "or: krl create 'Hello World' 'App that displays Hello World'"
25
+ puts "info".ljust(20) + "Displays general information about an application. If run from the "
26
+ puts " ".ljust(20) + "application directoy, no arguments are needed. Otherwise an app id "
27
+ puts " ".ljust(20) + "must be specified. (Note: you must have permission to view the app.)"
28
+ puts " ".ljust(20) + "Example (from app dir): krl info"
29
+ puts " ".ljust(20) + "or (from anywhere): krl info a1x2"
25
30
  puts ""
26
31
  puts "You must be in the root directory of your app to run the following commands:"
27
32
  puts "update".ljust(20) + "Overwrites your current .krl file with the specified version."
@@ -1,14 +1,20 @@
1
1
  module KRL_CMD
2
- class AppInfo
2
+ class Info
3
3
  def self.go(args)
4
4
  require LIB_DIR + 'user'
5
5
  require LIB_DIR + 'common'
6
6
  require 'pp'
7
7
  user = User.new
8
- app_info = user.api.get_app_info(args[0])
9
- app_details = user.api.get_app_details(args[0])
10
- # pp app_details
11
- # pp app_info
8
+ app_id = nil
9
+ if(args.length > 0)
10
+ app_id = args[0]
11
+ else
12
+ app_id = KRL_COMMON::get_app().application_id rescue nil
13
+ end
14
+ raise "Unable to determine the application id. use 'krl help' for more information." unless app_id
15
+
16
+ app_info = user.api.get_app_info(app_id)
17
+ app_details = user.api.get_app_details(app_id)
12
18
 
13
19
  puts "Application Users"
14
20
  KRL_COMMON::pretty_table(app_details["users"], [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 52
9
- version: 0.1.52
8
+ - 54
9
+ version: 0.1.54
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Farmer, Cid Dennis
@@ -78,7 +78,6 @@ extensions: []
78
78
  extra_rdoc_files:
79
79
  - LICENSE
80
80
  files:
81
- - lib/app_info.rb
82
81
  - lib/apps.rb
83
82
  - lib/check.rb
84
83
  - lib/checkout.rb
@@ -88,6 +87,7 @@ files:
88
87
  - lib/deploy.rb
89
88
  - lib/generate.rb
90
89
  - lib/help.rb
90
+ - lib/info.rb
91
91
  - lib/note.rb
92
92
  - lib/show.rb
93
93
  - lib/test.rb