module Luban::Deployment::Applications::Rack::WebServers::Puma

Public Instance Methods

phased_restart_command() click to toggle source
# File lib/luban/deployment/applications/rack/web_servers/puma.rb, line 158
def phased_restart_command
  @phased_restart_command ||= bundle_command("#{puma_command} phased-restart")
end
publish_web_server() click to toggle source
# File lib/luban/deployment/applications/rack/web_servers/puma.rb, line 162
def publish_web_server
  install_puma_plugins if publish_app?
end
restart_command() click to toggle source
# File lib/luban/deployment/applications/rack/web_servers/puma.rb, line 154
def restart_command
  @restart_command ||= bundle_command("#{puma_command} restart")
end

Protected Instance Methods

install_puma_plugins() click to toggle source
# File lib/luban/deployment/applications/rack/web_servers/puma.rb, line 168
def install_puma_plugins
  src_plugin_path = Pathname.new(__FILE__).dirname.join('puma', 'plugin')
  dst_plugin_path = within(release_path) do
                      Pathname.new(capture(bundle_executable, :show, 'puma'))
                    end.join('lib', 'puma', 'plugin')
  Pathname.glob(src_plugin_path.join('*.rb')).each do |src_plugin|
    dst_plugin = dst_plugin_path.join(src_plugin.basename)
    upload_by_template(file_to_upload: dst_plugin, template_file: src_plugin,
                       auto_revision: true)
  end
end