Class: Bananajour::Eater
- Inherits:
-
Object
- Object
- Bananajour::Eater
- Defined in:
- lib/bigbananajour/eater.rb
Instance Method Summary collapse
- #go! ⇒ Object
-
#initialize ⇒ Eater
constructor
A new instance of Eater.
Constructor Details
#initialize ⇒ Eater
Returns a new instance of Eater.
2 3 4 |
# File 'lib/bigbananajour/eater.rb', line 2 def initialize @browser = Bananajour::Bonjour::RepositoryBrowser.new end |
Instance Method Details
#go! ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/bigbananajour/eater.rb', line 5 def go! $stderr.puts "Starting the EATER!!!" while true do @browser.repositories.each do |remote_repo| $stderr.puts "Eater has seen remote repo '#{remote_repo}'" local_repo = Bananajour::Repository.for_name(make_local_repo_name(remote_repo)) if local_repo.exists? $stderr.puts "Eater, fetching changes from remote repo #{remote_repo.name}" fetch_latest(local_repo) capture_personal_details(local_repo, remote_repo) else $stderr.puts "Eater, cloning remote repo #{remote_repo.name}" clone_repo(remote_repo) fetch_latest(local_repo) capture_personal_details(local_repo, remote_repo) end end $stderr.puts "Eater thread SLEEPING" sleep 30 end $stderr.puts "Eater thread exiting." end |