From 298c35d1f4b50d19685f5a623c822301e611aff2 Mon Sep 17 00:00:00 2001 From: ronen barzel Date: Wed, 5 Dec 2012 12:18:28 +0000 Subject: [PATCH 1/2] Bug fix: Ensure Fog::VERSION gets defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In an application where the constant VERSION is defined at global scope, Fog::VERSION would not get defined; causing a failure in core/connection.rbĀ  So specify false for the second argument to const_defined? to restrict it to local scope. --- lib/fog/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/version.rb b/lib/fog/version.rb index 9fd037e30..bb2cb38e2 100644 --- a/lib/fog/version.rb +++ b/lib/fog/version.rb @@ -1,5 +1,5 @@ module Fog - unless const_defined?(:VERSION) + unless const_defined?(:VERSION, false) VERSION = '1.8.0' end end From b6aa27874e0ab36ebd60e19c74fb544f951a4cf4 Mon Sep 17 00:00:00 2001 From: ronen barzel Date: Thu, 6 Dec 2012 11:34:28 +0000 Subject: [PATCH 2/2] remove const_defined? guard The guard isn't really necessary in practice, and as per the previous checkin it was incorrect if ::VERSION was defined; but the fix in the previous checkin didn't work on ruby 1.8.7 --- lib/fog/version.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/fog/version.rb b/lib/fog/version.rb index bb2cb38e2..db1a5def9 100644 --- a/lib/fog/version.rb +++ b/lib/fog/version.rb @@ -1,5 +1,3 @@ module Fog - unless const_defined?(:VERSION, false) - VERSION = '1.8.0' - end + VERSION = '1.8.0' end