summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Aimonetti <mattaimonetti@gmail.com>2010-04-27 14:44:09 -0700
committerAndre Arko <andre@arko.net>2010-04-27 16:51:29 -0700
commit53a57518049c545ca6c3b150674fbacedd771836 (patch)
treec6ba7bcb402153015a817a0df249fffa5d755e14
parent73ce1d2a54610700cbca32bc1443d62907b5932e (diff)
downloadbundler-53a57518049c545ca6c3b150674fbacedd771836.tar.gz
fixed a bug with Ruby 1.9 caused by a Pathname API change
-rw-r--r--lib/bundler/runtime.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index 1916bb8ed8..259bf53210 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -82,7 +82,7 @@ module Bundler
Bundler.ui.info "Copying .gem files into vendor/cache"
specs.each do |spec|
next unless spec.source.is_a?(Source::SystemGems) || spec.source.is_a?(Source::Rubygems)
- possibilities = Gem.path.map { |p| "#{p}/cache/#{spec.full_name}.gem" }
+ possibilities = Gem.path.map { |p| "#{p.to_s}/cache/#{spec.full_name}.gem" }
cached_path = possibilities.find { |p| File.exist? p }
raise GemNotFound, "Missing gem file '#{spec.full_name}.gem'." unless cached_path
Bundler.ui.info " * #{File.basename(cached_path)}"
@@ -93,19 +93,18 @@ module Bundler
def prune_cache
FileUtils.mkdir_p(cache_path)
-
Bundler.ui.info "Removing outdated .gem files from vendor/cache"
Pathname.glob(cache_path.join("*.gem").to_s).each do |gem_path|
- cached_spec = Gem::Format.from_file_by_path(gem_path).spec
+ cached_spec = Gem::Format.from_file_by_path(gem_path.to_s).spec
next unless Gem::Platform.match(cached_spec.platform)
unless specs.any?{|s| s.full_name == cached_spec.full_name }
- Bundler.ui.info " * #{File.basename(gem_path)}"
+ Bundler.ui.info " * #{File.basename(gem_path.to_s)}"
gem_path.rmtree
end
end
end
- private
+ private
def load_paths
specs.map { |s| s.load_paths }.flatten