facebook / chef-utils

Utilities related to Chef
Apache License 2.0
290 stars 79 forks source link

Grocery-delivery - Missing methods? #29

Closed defunctknightsurfer closed 10 years ago

defunctknightsurfer commented 10 years ago

I am not a ruby dev by any means.

Working on setting up grocery-delivery via ruby version to work with our git repo, it seems to be missing a few methods.

$ ./grocery-delivery.rb 
Attempting to acquire lock
Lock acquired
Updating repo
./grocery-delivery.rb:199:in `<main>': undefined method `update' for #<BetweenMeals::Repo::Git:0x000000014794a0> (NoMethodError)

So I went in an added an update method

index 9ccf4d8..76d586a 100755
--- a/between-meals/repo/git.rb
+++ b/between-meals/repo/git.rb
@@ -46,6 +46,11 @@ module BetweenMeals
         s = Mixlib::ShellOut.new("#{@bin} clone #{url} #{@repo}").run_command
         s.error!
       end
+ 
+      def update
+        s = Mixlib::ShellOut.new("#{@bin} pull").run_command
+        s.error!
+      end

       # libgit turns out to be *very* slow at this. Using /usr/bin/git
       # for now, we'll circle back to this.

And then ran into this error.

$ ./grocery-delivery.rb 
Attempting to acquire lock
Lock acquired
Updating repo
DEBUG: Reading 
/grocery-delivery/gd_revision
./grocery-delivery.rb:223:in `<main>': undefined method `head' for #<BetweenMeals::Repo::Git:0x0000000219a440> (NoMethodError)

Are these methods really missing? Or am I just missing something obvious?

jaymzh commented 10 years ago

Hmmm. This is probably a function of a restructuring of the BM::Git module for TasteTester, and GD didn't keep up because we use it with SVN internally. I'll dig into this and get a patch out, hopefully today. Thanks for the report.

jaymzh commented 10 years ago

All fixed up. Sorry about that. Let me know if you have any more issues.

defunctknightsurfer commented 10 years ago

Thanks, the last post was a problem on my end, hence why I deleted it. Thanks, your patched work! Thanks again for such a quick response.