lib/shelly/cli/main.rb in shelly-0.1.25 vs lib/shelly/cli/main.rb in shelly-0.1.26
- old
+ new
@@ -17,10 +17,11 @@
register(Config, "config", "config <command>", "Manage application configuration files")
register(Files, "files", "files <command>", "Upload and download files to and from persistent storage")
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, :logs, :delete, :info, :ip, :logout, :execute, :rake, :setup, :console, :dbconsole]
before_hook :inside_git_repository?, :only => [:add, :setup, :check]
map %w(-v --version) => :version
desc "version", "Display shelly version"
@@ -131,11 +132,11 @@
msg = if state == "deploy_failed" || state == "configuration_failed"
" (deployment log: `shelly deploys show last -c #{app["code_name"]}`)"
end
[app["code_name"], "| #{state.humanize}#{msg}"]
end
- print_table(apps_table, :indent => 2)
+ print_table(apps_table, :ident => 2)
else
say "You have no clouds yet", :green
end
end
@@ -146,25 +147,25 @@
app = multiple_clouds(options[:cloud], "info")
msg = if app.state == "deploy_failed" || app.state == "configuration_failed"
" (deployment log: `shelly deploys show last -c #{app}`)"
end
say "Cloud #{app}:", msg.present? ? :red : :green
- print_wrapped "State: #{app.state}#{msg}", :indent => 2
+ print_wrapped "State: #{app.state}#{msg}", :ident => 2
say_new_line
- print_wrapped "Deployed commit sha: #{app.git_info["deployed_commit_sha"]}", :indent => 2
- print_wrapped "Deployed commit message: #{app.git_info["deployed_commit_message"]}", :indent => 2
- print_wrapped "Deployed by: #{app.git_info["deployed_push_author"]}", :indent => 2
+ print_wrapped "Deployed commit sha: #{app.git_info["deployed_commit_sha"]}", :ident => 2
+ print_wrapped "Deployed commit message: #{app.git_info["deployed_commit_message"]}", :ident => 2
+ print_wrapped "Deployed by: #{app.git_info["deployed_push_author"]}", :ident => 2
say_new_line
- print_wrapped "Repository URL: #{app.git_info["repository_url"]}", :indent => 2
- print_wrapped "Web server IP: #{app.web_server_ip}", :indent => 2
+ 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
if app.statistics.present?
- print_wrapped "Statistics:", :indent => 2
+ print_wrapped "Statistics:", :ident => 2
app.statistics.each do |stat|
- print_wrapped "#{stat['name']}:", :indent => 4
- print_wrapped "Load average: 1m: #{stat['load']['avg01']}, 5m: #{stat['load']['avg05']}, 15m: #{stat['load']['avg15']}", :indent => 6
- print_wrapped "CPU: #{stat['cpu']['wait']}%, MEM: #{stat['memory']['percent']}%, SWAP: #{stat['swap']['percent']}%", :indent => 6
+ print_wrapped "#{stat['name']}:", :ident => 4
+ print_wrapped "Load average: 1m: #{stat['load']['avg01']}, 5m: #{stat['load']['avg05']}, 15m: #{stat['load']['avg15']}", :ident => 6
+ print_wrapped "CPU: #{stat['cpu']['wait']}%, MEM: #{stat['memory']['percent']}%, SWAP: #{stat['swap']['percent']}%", :ident => 6
end
end
rescue Client::GatewayTimeoutException
say_error "Server statistics temporarily unavailable"
end
@@ -426,13 +427,9 @@
"Gem 'whenever' is missing in the Gemfile for '#{cloud}' cloud",
:show_fulfilled => verbose)
end
end
end
-
- print_check(!structure.gem?("mysql") && !structure.gem?("mysql2"),"",
- "mysql driver present in the Gemfile (not supported on Shelly Cloud)",
- :show_fulfilled => false)
if structure.valid?
if verbose
say "\nGreat! Your application is ready to run on Shelly Cloud"
end