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

« back to all changes in this revision

Viewing changes to lib/rubygems/test_utilities.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:
97
97
  end
98
98
 
99
99
  def download spec, source_uri, install_dir = Gem.dir
100
 
    name = spec.file_name
101
 
    path = File.join(install_dir, 'cache', name)
 
100
    name = File.basename spec.cache_file
 
101
    path = File.join install_dir, "cache", name
102
102
 
103
103
    Gem.ensure_gem_subdirectories install_dir
104
104
 
113
113
    path
114
114
  end
115
115
 
 
116
  def download_to_cache dependency
 
117
    found = Gem::SpecFetcher.fetcher.fetch dependency, true, true,
 
118
                                           dependency.prerelease?
 
119
 
 
120
    return if found.empty?
 
121
 
 
122
    spec, source_uri = found.first
 
123
 
 
124
    download spec, source_uri
 
125
  end
 
126
 
116
127
end
117
128
 
118
129
# :stopdoc:
128
139
##
129
140
# A StringIO duck-typed class that uses Tempfile instead of String as the
130
141
# backing store.
 
142
#
 
143
# This is available when rubygems/test_utilities is required.
131
144
#--
132
145
# This class was added to flush out problems in Rubinius' IO implementation.
133
146