Renamed Capistrano::Systemd::MultiService class to Capistrano::Systemd::MultiSerivice::SystemSerivce
Introduced Capistrano::Systemd::MultiService module as namespace, and defined singleton method new_service which returns Capistrano::Systemd::MultiSerivice::SystemSerivce instance.
Renamed lib/capistrano/tasks/systemd/multiservice.rake to lib/capistrano/tasks/systemd/multiservice/system_service.rake
Migration guide for users
This is a breaking change for users (who maintain Capfile).
module Capistrano
module Systemd
module MultiSerivce
def self.new_service(app, custom_service: false)
if custom_service
CustomService.new(app)
else
SystemService.new(app)
end
end
end
end
end
* lib/capistrano/systemd/multiservice/custom_service.rb:
```ruby
require "capistrano/systemd/multiservice/system_service" # or "capistrano/plugin"
module Capistrano
module Systemd
module MultiService
class CustomService < SystemService # or ::Capistrano::Plugin
#
# your custom code
#
Background
https://github.com/groovenauts/capistrano-systemd-multiservice/pull/9#issuecomment-397934997
Changes
Capistrano::Systemd::MultiService
class toCapistrano::Systemd::MultiSerivice::SystemSerivce
Capistrano::Systemd::MultiService
module as namespace, and defined singleton methodnew_service
which returnsCapistrano::Systemd::MultiSerivice::SystemSerivce
instance.Migration guide for users
This is a breaking change for users (who maintain Capfile).
Capfile should be migrated from
to
For developers
Now you can define your own class like this:
module Capistrano module Systemd module MultiSerivce def self.new_service(app, custom_service: false) if custom_service CustomService.new(app) else SystemService.new(app) end end end end end