lib/shelly/cli/main.rb in shelly-0.4.34 vs lib/shelly/cli/main.rb in shelly-0.4.35
- old
+ new
@@ -6,10 +6,11 @@
require "shelly/cli/config"
require "shelly/cli/file"
require "shelly/cli/organization"
require "shelly/cli/logs"
require "shelly/cli/cert"
+require "shelly/cli/maintenance"
require "shelly/cli/main/add"
require "shelly/cli/main/check"
require "io/console"
@@ -24,10 +25,11 @@
register_subcommand(Config, "config", "config <command>", "Manage application configuration files")
register_subcommand(File, "file", "file <command>", "Upload and download files to and from persistent storage")
register_subcommand(Organization, "organization", "organization <command>", "View organizations")
register_subcommand(Logs, "log", "logs <command>", "View application logs")
register_subcommand(Cert, "cert", "cert <command>", "Mange application certificates")
+ register_subcommand(Maintenance, "maintenance", "maintenance <command>", "Mange application maintenance events")
check_unknown_options!(:except => :rake)
# FIXME: it should be possible to pass single symbol, instead of one element array
before_hook :logged_in?, :only => [:add, :status, :list, :start, :stop,
@@ -116,21 +118,22 @@
print_wrapped "Deployed by: #{app.git_info["deployed_push_author"]}", :ident => 2
say_new_line
print_wrapped "Repository URL: #{app.git_info["repository_url"]}", :ident => 2
print_wrapped "Web server IP: #{app.web_server_ip}", :ident => 2
say_new_line
+
print_wrapped "Usage:", :ident => 2
- if app.usage.present?
- app.usage.each do |usage|
- print_wrapped "#{usage['kind'].capitalize}:", :ident => 4
- print_wrapped "Current: #{number_to_human_size(usage['current'])}", :ident => 6
- print_wrapped "Average: #{number_to_human_size(usage['avg'])}", :ident => 6
- end
+ app.usage.each do |usage|
+ print_wrapped "#{usage['kind'].capitalize}:", :ident => 4
+ print_wrapped "Current: #{number_to_human_size(usage['current'])}", :ident => 6
+ print_wrapped "Average: #{number_to_human_size(usage['avg'])}", :ident => 6
end
+
print_wrapped "Traffic:", :ident => 4
- print_wrapped "Incoming: #{number_to_human_size(app.traffic['incoming'])}", :ident => 6
- print_wrapped "Outgoing: #{number_to_human_size(app.traffic['outgoing'])}", :ident => 6
- print_wrapped "Total: #{number_to_human_size(app.traffic['total'])}", :ident => 6
+ print_wrapped "Incoming: #{number_to_human_size(app.traffic['incoming'].to_i)}", :ident => 6
+ print_wrapped "Outgoing: #{number_to_human_size(app.traffic['outgoing'].to_i)}", :ident => 6
+ print_wrapped "Total: #{number_to_human_size(app.traffic['total'].to_i)}", :ident => 6
+
say_new_line
if app.statistics.present?
print_wrapped "Statistics:", :ident => 2
app.statistics.each do |stat|
print_wrapped "#{stat['name']}:", :ident => 4