Module: Chicanery
- Includes:
- Persistence, Repos, Servers, Sites
- Defined in:
- lib/chicanery.rb,
lib/chicanery/git.rb,
lib/chicanery/site.rb,
lib/chicanery/repos.rb,
lib/chicanery/sites.rb,
lib/chicanery/cctray.rb,
lib/chicanery/servers.rb,
lib/chicanery/summary.rb,
lib/chicanery/handlers.rb,
lib/chicanery/collections.rb,
lib/chicanery/persistence.rb
Defined Under Namespace
Modules: Cctray, Collections, Git, Handlers, Persistence, Repos, Servers, Sites, Summary Classes: Site
Constant Summary collapse
- VERSION =
"0.1.5"
Instance Method Summary collapse
- #execute(args) ⇒ Object
- #poll_period(seconds = nil) ⇒ Object
- #run ⇒ Object
- #run_every(poll_period) ⇒ Object
Methods included from Sites
Methods included from Repos
#check_repos, #compare_repo_state
Methods included from Servers
#check_servers, #compare_job, #compare_jobs
Methods included from Persistence
#persist, #persist_state_to, #restore
Instance Method Details
#execute(args) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/chicanery.rb', line 26 def execute args begin load args.shift run_every poll_period rescue Interrupt end end |
#poll_period(seconds = nil) ⇒ Object
21 22 23 24 |
# File 'lib/chicanery.rb', line 21 def poll_period seconds=nil @poll_period = seconds if seconds @poll_period end |
#run ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/chicanery.rb', line 42 def run previous_state = restore current_state = {} check_servers current_state, previous_state check_repos current_state, previous_state check_sites current_state, previous_state current_state.extend Chicanery::Summary run_handlers.each {|handler| handler.call current_state, previous_state } persist current_state end |
#run_every(poll_period) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/chicanery.rb', line 34 def run_every poll_period loop do run break unless poll_period sleep poll_period end end |