Class: CronEdit::DummyCrontab

Inherits:
Crontab
  • Object
show all
Defined in:
lib/cronedit.rb

Overview

DummyCrontab allows you to create crontab definitions from scratch and dump them out as string. (Or combine them with other Crontab definitions)

Example:

fc = DummyCrontab.new
fc.add 'agent1', '59 * * * * echo "agent1"'
fc.add 'agent2', {:hour=>'2',:command=>'echo "huh"'}
fc.commit
puts fc

Instance Method Summary collapse

Methods inherited from Crontab

Add, List, Merge, Remove, Subtract, #add, #clear!, #commit, #list, #listFull, #listRaw, #merge, #remove, #review, #rollback, #setIO, #subtract

Constructor Details

#initializeDummyCrontab

Returns a new instance of DummyCrontab.



358
359
360
361
# File 'lib/cronedit.rb', line 358

def initialize
    super nil
    @buffer = StringIO.new
end

Instance Method Details

#to_sObject



363
364
365
# File 'lib/cronedit.rb', line 363

def to_s
    @buffer.string
end