From 7e67e4aec5238c8bed19e0efe9aadd8c98151686 Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 21 Sep 2010 15:57:27 -0700 Subject: [PATCH] fix adding collection helpers to bins --- lib/fog/bin.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/fog/bin.rb b/lib/fog/bin.rb index 4c3e096f1..ec4479e70 100644 --- a/lib/fog/bin.rb +++ b/lib/fog/bin.rb @@ -42,11 +42,13 @@ module Fog if availability for service in services for collection in self[service].collections - self.class_eval <<-EOS, __FILE__, __LINE__ - def #{collection} - self[:#{service}].#{collection} - end - EOS + unless self.respond_to?(collection) + self.class_eval <<-EOS, __FILE__, __LINE__ + def self.#{collection} + self[:#{service}].#{collection} + end + EOS + end end end end