~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to lib/rubygems/require_paths_builder.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
require 'rubygems'
2
2
 
 
3
# TODO: remove after 1.9.1 dropped
3
4
module Gem::RequirePathsBuilder
4
5
  def write_require_paths_file_if_needed(spec = @spec, gem_home = @gem_home)
5
 
    require_paths = spec.require_paths
6
 
    return if require_paths.size == 1 and require_paths.first == "lib"
7
 
    file_name = "#{gem_home}/gems/#{@spec.full_name}/.require_paths".untaint
8
 
    File.open(file_name, "wb") do |file|
9
 
      file.puts require_paths
 
6
    return if spec.require_paths == ["lib"] &&
 
7
              (spec.bindir.nil? || spec.bindir == "bin")
 
8
    file_name = File.join(gem_home, 'gems', "#{@spec.full_name}", ".require_paths")
 
9
    file_name.untaint
 
10
    File.open(file_name, "w") do |file|
 
11
      spec.require_paths.each do |path|
 
12
        file.puts path
 
13
      end
 
14
      file.puts spec.bindir if spec.bindir
10
15
    end
11
16
  end
12
 
end
 
17
end if Gem::QUICKLOADER_SUCKAGE
13
18