Skip to content

Instantly share code, notes, and snippets.

View danielsdeleo's full-sized avatar

Dan DeLeo danielsdeleo

View GitHub Profile
# This is how Queue#subscribe will work in the next version of Bunny (v0.5.4).
# It's in the 'experimental' branch now.
#
# In order for subscription to work smoothly you need to use a combination of
# Queue#subscribe, Queue#unsubscribe, Queue#ack and Client#qos prefetch. The
# prefetch will allow a controlled number of messages to be released to a
# consumer, which means that Queue#unsubscribe and other methods can be run
# without errors due to out of sequence messages.
#
@danielsdeleo
danielsdeleo / add_env
Created November 12, 2009 21:49 — forked from albertsj1/add_env
this is the error I get.
/srv/chef/cookbooks/system/libraries/add_env_var.rb:1:in `system': wrong number of arguments (ArgumentError)
Module system
def add_env_var(variable, path)
envfile = "/etc/profile.d/99generic.sh"
foundvar = false
arr = IO.readlines( envfile ) if File::exists?( envfile )
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
# Please see the readme for overview documentation.
#
index 95b48a0..7dd897c 100644
--- a/chef/lib/chef/provider/subversion.rb
+++ b/chef/lib/chef/provider/subversion.rb
@@ -122,7 +122,7 @@ class Chef
# YAML doesn't appreciate input like "svn: '/tmp/deploydir' is not a working copy\n"
return nil
end
- raise "tried to run `#{command}' and got unexpected result #{result.inspect}" unless repo_attrs.kind_of?(Hash)
+ raise "Attempted to parse SVN info but could not. SVN info was:\n#{svn_info}" unless repo_attrs.kind_of?(Hash)
rev = (repo_attrs['Last Changed Rev'] || repo_attrs['Revision']).to_s