Class: Xronor::Parser
- Inherits:
-
Object
- Object
- Xronor::Parser
- Defined in:
- lib/xronor/parser.rb
Class Method Summary collapse
Class Method Details
.parse(filename) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/xronor/parser.rb', line 3 def self.parse(filename) body = open(filename).read result = Xronor::DSL.eval(body).result result.jobs.values.map do |job| job.description ||= job.name Xronor::Job.new(job.name, job.description, job.schedule, job.command) end end |