Actions
Bug #2176
closed[rubygems] $LOAD_PATH includes bin directory
Bug #2176:
[rubygems] $LOAD_PATH includes bin directory
Description
=begin
Hi,
What is the reason that bin is needed in $LOAD_PATH? AFAIK,
bin directory is for executable files, but not for libraries.
Index: gem_prelude.rb¶
--- gem_prelude.rb (revision 25229)
+++ gem_prelude.rb (working copy)
@@ -256,12 +256,11 @@ if defined?(Gem) then
GemPaths.each_value do |path|
if File.exist?(file = File.join(path, ".require_paths")) then
Index: lib/rubygems.rb¶
--- lib/rubygems.rb (revision 25229)
+++ lib/rubygems.rb (working copy)
@@ -294,7 +294,4 @@ module Gem
end
-
bin directory must come before library directories¶
- spec.require_paths.unshift spec.bindir if spec.bindir
- require_paths = spec.require_paths.map do |path|
File.join spec.full_gem_path, path
Index: lib/rubygems/require_paths_builder.rb
===================================================================
--- lib/rubygems/require_paths_builder.rb (revision 25229)
+++ lib/rubygems/require_paths_builder.rb (working copy)
@@ -3,13 +3,10 @@ require 'rubygems'
module Gem::RequirePathsBuilder
def write_require_paths_file_if_needed(spec = @spec, gem_home = @gem_home) - return if spec.require_paths == ["lib"] &&
- require_paths = spec.require_paths
- return if require_paths == ["lib"]
file_name = File.join(gem_home, 'gems', "#{@spec.full_name}", ".require_paths")
file_name.untaint
- File.open(file_name, "w") do |file|
- File.open(file_name, "wb") do |file|
-
end
end
--
Nobu Nakada
=end
Actions