lib/app42/command/info.rb in app42-0.5.3 vs lib/app42/command/info.rb in app42-0.5.4
- old
+ new
@@ -3,11 +3,18 @@
module App42
module Command
class Info < Base
+ #
+ # return user activites
+ #
+ def get_activities
+ build_get_request params, 'info', 'activities'
+ end
+
#
# show detailed app information
#
#Examples:
#
@@ -65,9 +72,25 @@
rows << Array(log)
end
message "#{Message::LOG_MESSAGE}", true, 'green'
table = Terminal::Table.new :title => rows_header, :rows => rows
puts table
+ end
+
+ # will return details of user activities like operation, status, date etc.
+ def activities
+ rows, rows_header_final, rows_header = [], [], nil
+ user_activities = get_activities
+ if user_activities['success'] && user_activities['activities']
+ user_activities['activities'].each do |each_activity|
+ rows_header = each_activity.keys
+ rows << each_activity.values
+ end
+ rows_header.map { |e| rows_header_final << camel_case_to_whitespace(e) }
+
+ table = Terminal::Table.new :title => Paint["=== User Activities ===", :green], :headings => rows_header_final, :rows => rows
+ puts table
+ end
end
#
# list releases
#
\ No newline at end of file