pvalena / rpms / ruby

Forked from rpms/ruby 6 years ago
Clone
a03b2d2
From 02f94e96ea6a9e0fe37341eccd83ffb63549ead5 Mon Sep 17 00:00:00 2001
a03b2d2
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
a03b2d2
Date: Thu, 3 Oct 2013 14:15:59 +0200
a03b2d2
Subject: [PATCH] DRY: Use full_require_paths on yet another place.
a03b2d2
a03b2d2
---
a03b2d2
 lib/rubygems/basic_specification.rb | 16 +++++++++++++---
a03b2d2
 lib/rubygems/specification.rb       | 11 -----------
a03b2d2
 2 files changed, 13 insertions(+), 14 deletions(-)
a03b2d2
a03b2d2
diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb
a03b2d2
index 24bb4bc..a10eab3 100644
a03b2d2
--- a/lib/rubygems/basic_specification.rb
a03b2d2
+++ b/lib/rubygems/basic_specification.rb
a03b2d2
@@ -38,11 +38,10 @@ class Gem::BasicSpecification
a03b2d2
   # Return true if this spec can require +file+.
a03b2d2
 
a03b2d2
   def contains_requirable_file? file
a03b2d2
-    root     = full_gem_path
a03b2d2
     suffixes = Gem.suffixes
a03b2d2
 
a03b2d2
-    require_paths.any? do |lib|
a03b2d2
-      base = "#{root}/#{lib}/#{file}"
a03b2d2
+    full_require_paths.any? do |path|
a03b2d2
+      base = "#{path}/#{file}"
a03b2d2
       suffixes.any? { |suf| File.file? "#{base}#{suf}" }
a03b2d2
     end
a03b2d2
   end
a03b2d2
@@ -84,6 +83,17 @@ class Gem::BasicSpecification
a03b2d2
   end
a03b2d2
 
a03b2d2
   ##
a03b2d2
+  # Full paths in the gem to add to $LOAD_PATH when this gem is
a03b2d2
+  # activated.
a03b2d2
+  #
a03b2d2
+
a03b2d2
+  def full_require_paths
a03b2d2
+    require_paths.map do |path|
a03b2d2
+      File.join full_gem_path, path
a03b2d2
+    end
a03b2d2
+  end
a03b2d2
+
a03b2d2
+  ##
a03b2d2
   # Returns the full path to the gems directory containing this spec's
a03b2d2
   # gem directory. eg: /usr/local/lib/ruby/1.8/gems
a03b2d2
 
a03b2d2
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
a03b2d2
index 6de8c3b..deac343 100644
a03b2d2
--- a/lib/rubygems/specification.rb
a03b2d2
+++ b/lib/rubygems/specification.rb
a03b2d2
@@ -2015,17 +2015,6 @@ class Gem::Specification < Gem::BasicSpecification
a03b2d2
   end
a03b2d2
 
a03b2d2
   ##
a03b2d2
-  # Full paths in the gem to add to $LOAD_PATH when this gem is
a03b2d2
-  # activated.
a03b2d2
-  #
a03b2d2
-
a03b2d2
-  def full_require_paths
a03b2d2
-    require_paths.map do |path|
a03b2d2
-      File.join full_gem_path, path
a03b2d2
-    end
a03b2d2
-  end
a03b2d2
-
a03b2d2
-  ##
a03b2d2
   # The RubyGems version required by this gem
a03b2d2
 
a03b2d2
   def required_rubygems_version= req
a03b2d2
-- 
a03b2d2
1.8.3.1
a03b2d2