Class: Xronor::Generator::Crontab

Inherits:
Object
  • Object
show all
Defined in:
lib/xronor/generator/crontab.rb

Class Method Summary collapse

Class Method Details

.generate(filename, options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/xronor/generator/crontab.rb', line 5

def generate(filename, options)
  jobs = Xronor::Parser.parse(filename)

  jobs.map do |job|
    <<-EOS
# #{job.name} - #{job.description}
#{[job.schedule, job.command].join(" ")}
EOS
  end.join("\n")
end