Class: EasyCaddy::Commands::Ensure

Inherits:
Object
  • Object
show all
Includes:
RegisterHelpers
Defined in:
lib/easy_caddy/commands/ensure.rb

Overview

One-shot: copies the project Caddyfile into global sites/, reloads Caddy, then exits. Site stays registered until ‘ecaddy down NAME` or `ecaddy remove NAME`.

Instance Method Summary collapse

Constructor Details

#initialize(config_path:, site:) ⇒ Ensure

Returns a new instance of Ensure.



12
13
14
15
# File 'lib/easy_caddy/commands/ensure.rb', line 12

def initialize(config_path:, site:)
  @config_path = config_path
  @site        = site
end

Instance Method Details

#callObject



17
18
19
# File 'lib/easy_caddy/commands/ensure.rb', line 17

def call
  register(@config_path, @site)
end