Module: WheneverSystemd

Defined in:
lib/whenever_systemd.rb,
lib/whenever_systemd/os.rb,
lib/whenever_systemd/job.rb,
lib/whenever_systemd/version.rb,
lib/whenever_systemd/job_list.rb,
lib/whenever_systemd/formatters.rb,
lib/whenever_systemd/command_line.rb,
lib/whenever_systemd/output_redirection.rb

Defined Under Namespace

Modules: Formatters, OS, Output Classes: CommandLine, Job, JobList

Constant Summary collapse

DEFAULT_INSTALL_PATH =
"/etc/systemd/system"
VERSION =
'0.0.2'

Class Method Summary collapse

Class Method Details

.bin_rails?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/whenever_systemd.rb', line 20

def self.bin_rails?
  File.exist?(File.join(path, 'bin', 'rails'))
end

.bundler?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/whenever_systemd.rb', line 28

def self.bundler?
  File.exist?(File.join(path, 'Gemfile'))
end

.cron(options) ⇒ Object



12
13
14
# File 'lib/whenever_systemd.rb', line 12

def self.cron(options)
  JobList.new(options).dry_units(options[:install_path])
end

.pathObject



16
17
18
# File 'lib/whenever_systemd.rb', line 16

def self.path
  Dir.pwd
end

.script_rails?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/whenever_systemd.rb', line 24

def self.script_rails?
  File.exist?(File.join(path, 'script', 'rails'))
end