Created
April 30, 2015 12:26
-
-
Save Nephos/4b1457ea169c962c54dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
# load the configuration | |
# yaml = YAML.load_file("day.yaml") | |
yaml = YAML.load( | |
<<YAML_TEXT | |
TestA: | |
:day: 1 | |
:at: 10:00 pm | |
Bonjour: | |
:day: 2 | |
:at: 7:00 pm | |
YAML_TEXT | |
) | |
# representation of the scraps | |
module Scraps | |
module TestA | |
end | |
module Bonjour | |
end | |
end | |
# for each scrap | |
yaml.each do |scrap, date| | |
# execute the scheduller with every date[:date], at: date[:at] do | |
date[:day].times do | |
# send the scrap task | |
puts Scraps.const_get(scrap).to_s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment