lib/shelly/cli/main.rb in shelly-0.1.24.pre2 vs lib/shelly/cli/main.rb in shelly-0.1.24

- old
+ new

@@ -17,11 +17,10 @@ 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" @@ -132,11 +131,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, :ident => 2) + print_table(apps_table, :indent => 2) else say "You have no clouds yet", :green end end @@ -147,25 +146,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}", :ident => 2 + print_wrapped "State: #{app.state}#{msg}", :indent => 2 say_new_line - 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 + 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 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 + print_wrapped "Repository URL: #{app.git_info["repository_url"]}", :indent => 2 + print_wrapped "Web server IP: #{app.web_server_ip}", :indent => 2 say_new_line if app.statistics.present? - print_wrapped "Statistics:", :ident => 2 + print_wrapped "Statistics:", :indent => 2 app.statistics.each do |stat| - 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 + 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 end end rescue Client::GatewayTimeoutException say_error "Server statistics temporarily unavailable" end @@ -383,14 +382,10 @@ print_check(structure.gemfile_lock?, "Gemfile.lock is present", "Gemfile.lock is missing in git repository", :show_fulfilled => verbose) - print_check(structure.config_ru?, "File config.ru is present", - "File config.ru is missing", - :show_fulfilled => verbose) - print_check(structure.gem?("shelly-dependencies"), "Gem 'shelly-dependencies' is present", "Gem 'shelly-dependencies' is missing, we recommend to install it\n See more at https://shellycloud.com/documentation/requirements#shelly-dependencies", :show_fulfilled => verbose || structure.warnings?, :failure_level => :warning) @@ -398,38 +393,12 @@ "Gem 'thin' is missing in the Gemfile", :show_fulfilled => verbose) print_check(structure.gem?("rake"), "Gem 'rake' is present", "Gem 'rake' is missing in the Gemfile", :show_fulfilled => verbose) - - print_check(structure.gem?("rake"), "Gem 'rake' is present", - "Gem 'rake' is missing in the Gemfile", :show_fulfilled => verbose) - - cloudfile = Cloudfile.new - if cloudfile.present? - cloudfile.clouds.each do |cloud| - if cloud.databases.include?('postgresql') - print_check(structure.gem?("pg") || structure.gem?("postgres"), - "Postgresql driver is present for '#{cloud}' cloud", - "Postgresql driver is missing in the Gemfile for '#{cloud}' cloud,\n we recommend adding 'pg' gem to Gemfile", - :show_fulfilled => verbose) - end - - if cloud.delayed_job? - print_check(structure.gem?("delayed_job"), - "Gem 'delayed_job' is present for '#{cloud}' cloud", - "Gem 'delayed_job' is missing in the Gemfile for '#{cloud}' cloud", - :show_fulfilled => verbose) - end - - if cloud.whenever? - print_check(structure.gem?("whenever"), - "Gem 'whenever' is present for '#{cloud}' cloud", - "Gem 'whenever' is missing in the Gemfile for '#{cloud}' cloud", - :show_fulfilled => verbose) - end - end - end + print_check(structure.config_ru?, "File config.ru is present", + "File config.ru is missing", + :show_fulfilled => verbose) print_check(!structure.gem?("mysql") && !structure.gem?("mysql2"),"", "mysql driver present in the Gemfile (not supported on Shelly Cloud)", :show_fulfilled => false)