Class: Helpers::NewSystemd
Overview
Class NewSystemd Used to create a systemd service
Example:
require Helpers string = <<EOF
- Description
- Service
-
Type=simple
- Installation
-
WantedBy = EOF new_systemd = Helpers::NewSystemd.new(string, “tor.service”) new_systemd.add
Instance Method Summary collapse
-
#add ⇒ Object
Method #add Create a temporary file and move the service @name to the systemd directory.
-
#initialize(string, name) ⇒ NewSystemd
constructor
Method #new === Parameters: * string = the string of for whole content file * name = the name of the service (e.g: tor.service).
Methods inherited from NewFile
Constructor Details
#initialize(string, name) ⇒ NewSystemd
Method #new
Parameters:
-
string = the string of for whole content file
-
name = the name of the service (e.g: tor.service)
114 115 116 117 118 |
# File 'lib/spior/helpers.rb', line 114 def initialize(string, name) super @systemd_dir = search_systemd_dir @dest = "#{@systemd_dir}/#{@name}" end |