Class: Foreman::Export::SystemdUser

Inherits:
Base
  • Object
show all
Defined in:
lib/foreman/export/systemd_user.rb

Constant Summary collapse

TEMPLATE_DIR =
File.expand_path("../../../../data/export/systemd_user", __FILE__)

Instance Method Summary collapse

Constructor Details

#initialize(location, engine, options = {}) ⇒ SystemdUser

Returns a new instance of SystemdUser.



7
8
9
10
11
# File 'lib/foreman/export/systemd_user.rb', line 7

def initialize(location, engine, options = {})
  options = options.dup
  options[:template] ||= TEMPLATE_DIR
  super(location, engine, options)
end

Instance Method Details

#appObject



13
14
15
# File 'lib/foreman/export/systemd_user.rb', line 13

def app
  options[:app] || File.basename(FileUtils.pwd)
end

#exportObject



21
22
23
24
25
26
27
# File 'lib/foreman/export/systemd_user.rb', line 21

def export
  super
  clean_old_units
  write_units
  install_include_dir
  configure_systemd
end

#locationObject



17
18
19
# File 'lib/foreman/export/systemd_user.rb', line 17

def location
  super || "#{ENV["HOME"]}/.config/systemd/user"
end