deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [1/7] git commit: Client: Replaced ambiguous 'require' with require_relative
Date Fri, 10 Aug 2012 07:37:45 GMT
Updated Branches:
  refs/heads/master 5b1548373 -> b87c6f7e2


Client: Replaced ambiguous 'require' with require_relative

* The 'require' was used in weird way that broke MRI 1.9
  compatibility.


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/c210febe
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/c210febe
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/c210febe

Branch: refs/heads/master
Commit: c210febe6e6aafd48b32de75453da05301be21fc
Parents: 66d58b9
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Wed Aug 8 14:49:43 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Fri Aug 10 09:38:21 2012 +0200

----------------------------------------------------------------------
 client/lib/base_object.rb |    2 +-
 client/lib/deltacloud.rb  |   15 ++++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c210febe/client/lib/base_object.rb
----------------------------------------------------------------------
diff --git a/client/lib/base_object.rb b/client/lib/base_object.rb
index 5f63b5d..5035266 100644
--- a/client/lib/base_object.rb
+++ b/client/lib/base_object.rb
@@ -13,7 +13,7 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
-require 'string'
+require_relative './string.rb'
 
 module DeltaCloud
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c210febe/client/lib/deltacloud.rb
----------------------------------------------------------------------
diff --git a/client/lib/deltacloud.rb b/client/lib/deltacloud.rb
index 35fe86d..7caae95 100644
--- a/client/lib/deltacloud.rb
+++ b/client/lib/deltacloud.rb
@@ -17,12 +17,13 @@ require 'nokogiri'
 require 'rest_client'
 require 'base64'
 require 'logger'
-require 'hwp_properties'
-require 'instance_state'
-require 'documentation'
-require 'base_object'
-require 'errors'
-require 'client_bucket_methods'
+require 'require_relative' if RUBY_VERSION =~ /^1\.8/
+require_relative './hwp_properties.rb'
+require_relative './instance_state.rb'
+require_relative './documentation.rb'
+require_relative './base_object.rb'
+require_relative './errors.rb'
+require_relative './client_bucket_methods.rb'
 
 module DeltaCloud
 
@@ -146,7 +147,7 @@ module DeltaCloud
           end
 
           define_method :"fetch_#{model.to_s.singularize}" do |url|
-            id = url.grep(/\/#{model}\/(.*)$/)
+            url =~ /\/#{model}\/(.*)$/
             self.send(model.to_s.singularize.to_sym, $1)
           end
 


Mime
View raw message