Skip to content

Instantly share code, notes, and snippets.

@Nephos
Created April 30, 2015 12:26
Show Gist options
  • Save Nephos/4b1457ea169c962c54dc to your computer and use it in GitHub Desktop.
Save Nephos/4b1457ea169c962c54dc to your computer and use it in GitHub Desktop.
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