Skip to content

Instantly share code, notes, and snippets.

@albanpeignier
Created December 4, 2012 08:37
Show Gist options
  • Save albanpeignier/4201870 to your computer and use it in GitHub Desktop.
Save albanpeignier/4201870 to your computer and use it in GitHub Desktop.
Pige Scheduler
Pige::ChunkScheduler.define do |scheduling|
scheduling.day = Date.today.prev_day
scheduling.on(:monday) do
create :title => "Emission Cinema lundi %d_%m_%Y", :begin => "17:00", :duration => 1.hour
create :title => "Chronique 'A Table'", :begin => "13:00", :duration => 5.minutes, :margin => 5.minutes
end
scheduling.on(:tuesday) do
# ...
end
# ...
end
# will :
# Schedule monday
# Create Chunk with {:format=>"wav", :title=>"Emission Cinema lundi 03_12_2012", :begin=>2012-12-03 17:00:00 +0100, :end=>2012-12-03 18:00:00 +0100}
# Create Chunk with {:format=>"wav", :title=>"Chronique 'A Table'", :begin=>2012-12-03 12:55:00 +0100, :end=>2012-12-03 13:10:00 +0100}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment