lib/shelly/cli/main/check.rb in shelly-0.4.18 vs lib/shelly/cli/main/check.rb in shelly-0.4.19
- old
+ new
@@ -25,10 +25,41 @@
print_check(structure.gemfile_lock?, "Gemfile.lock is present",
"Gemfile.lock is missing in git repository",
:show_fulfilled => verbose)
+ if structure.gemfile_ruby_version?
+ if structure.gemfile_engine == 'ruby'
+ print_check(!['1.8.7', '2.1.0'].include?(structure.gemfile_ruby_version),
+ "#{structure.gemfile_engine} #{structure.gemfile_ruby_version} is supported",
+ "#{structure.gemfile_engine} #{structure.gemfile_ruby_version} is currently unsupported\n See more at https://shellycloud.com/documentation/requirements#ruby_versions",
+ :show_fulfilled => verbose)
+ end
+
+ if structure.gemfile_ruby_patchlevel
+ print_check(false, "",
+ "Remove Ruby patchlevel from Gemfile\n Shelly Cloud takes care of upgrading Rubies whenever they are released\n See more at https://shellycloud.com/documentation/requirements#ruby_versions",
+ :show_fulfilled => verbose)
+ end
+
+ supported_jruby = '1.7.8'
+ if structure.gemfile_engine == 'jruby'
+ print_check(!(structure.gemfile_ruby_version == '1.8.7' ||
+ structure.gemfile_engine_version != supported_jruby),
+ "jruby #{supported_jruby} (1.9 mode) is supported",
+ "Only jruby #{supported_jruby} (1.9 mode) is currently supported\n See more at https://shellycloud.com/documentation/requirements#ruby_versions",
+ :show_fulfilled => verbose)
+ end
+
+ # other platforms: rbx, mingw, mswin show instant error
+ unless ['jruby', 'ruby'].include?(structure.gemfile_engine)
+ print_check(false, "",
+ "Your ruby engine: #{structure.gemfile_engine} is currently unsupported\n See more at https://shellycloud.com/documentation/requirements#ruby_versions",
+ :show_fulfilled => verbose)
+ end
+ end
+
print_check(structure.config_ru?, "config.ru is present",
"config.ru is missing",
:show_fulfilled => verbose)
print_check(structure.rakefile?, "Rakefile is present",
@@ -47,11 +78,11 @@
:show_fulfilled => verbose || structure.warnings?, :failure_level => :warning)
print_check(structure.gem?("thin") || structure.gem?("puma"),
"Web server gem is present",
"Missing web server gem in Gemfile. Currently supported: 'thin' and 'puma'",
- :show_fulfilled => verbose, :failure_level => :warning)
+ :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.task?("db:migrate"), "Task 'db:migrate' is present",
@@ -91,18 +122,18 @@
:show_fulfilled => verbose)
end
if app.thin?
print_check(structure.gem?("thin"),
- "Web server gem 'thin' is present",
+ "Web server gem 'thin' is present for '#{app}' cloud",
"Gem 'thin' is missing in the Gemfile for '#{app}' cloud",
:show_fulfilled => verbose)
end
if app.puma?
print_check(structure.gem?("puma"),
- "Web server gem 'puma' is present",
+ "Web server gem 'puma' is present for '#{app}' cloud",
"Gem 'puma' is missing in the Gemfile for '#{app}' cloud",
:show_fulfilled => verbose)
end
end
end
@@ -113,9 +144,10 @@
end
else
say "\nFix points marked with #{red("✗")} to run your application on the Shelly Cloud"
say "See more about requirements on https://shellycloud.com/documentation/requirements"
end
+ say_new_line
structure.valid?
rescue Bundler::BundlerError => e
say_new_line
say_error e.message, :with_exit => false