lib/capistrano/puma.rb in capistrano3-puma-6.0.0.alpha.2 vs lib/capistrano/puma.rb in capistrano3-puma-6.0.0.alpha.3
- old
+ new
@@ -26,10 +26,19 @@
Array(fetch(:puma_bind)).collect do |bind|
"bind '#{bind}'"
end.join("\n")
end
+ def service_unit_type
+ ## Jruby don't support notify
+ return "simple" if RUBY_ENGINE == "jruby"
+ fetch(:puma_service_unit_type,
+ ## Check if sd_notify is available in the bundle
+ Gem::Specification.find_all_by_name("sd_notify").any? ? "notify" : "simple")
+
+ end
+
def compiled_template_puma(from, role)
@role = role
file = [
"lib/capistrano/templates/#{from}-#{role.hostname}-#{fetch(:stage)}.rb",
"lib/capistrano/templates/#{from}-#{role.hostname}.rb",
@@ -93,22 +102,22 @@
class Puma < Capistrano::Plugin
include PumaCommon
def set_defaults
- set_if_empty :puma_role, :app
+ set_if_empty :puma_role, :web
set_if_empty :puma_env, -> { fetch(:rack_env, fetch(:rails_env, fetch(:stage))) }
+ set_if_empty :puma_access_log, -> { File.join(shared_path, 'log', "puma.log") }
+ set_if_empty :puma_error_log, -> { File.join(shared_path, 'log', "puma.log") }
# Chruby, Rbenv and RVM integration
- append :chruby_map_bins, 'puma', 'pumactl'
- append :rbenv_map_bins, 'puma', 'pumactl'
- append :rvm_map_bins, 'puma', 'pumactl'
+ append :chruby_map_bins, 'puma', 'pumactl' if fetch(:chruby_map_bins)
+ append :rbenv_map_bins, 'puma', 'pumactl' if fetch(:rbenv_map_bins)
+ append :rvm_map_bins, 'puma', 'pumactl' if fetch(:rvm_map_bins)
# Bundler integration
append :bundle_bins, 'puma', 'pumactl'
end
end
end
require 'capistrano/puma/systemd'
-require 'capistrano/puma/monit'
-require 'capistrano/puma/nginx'