lib/bundler/source.rb in bundler-0.9.11 vs lib/bundler/source.rb in bundler-0.9.12
- old
+ new
@@ -38,10 +38,12 @@
:wrappers => true,
:env_shebang => true,
:bin_dir => "#{Gem.dir}/bin"
installer.install
+
+ spec.loaded_from = "#{Gem.dir}/specifications/#{spec.full_name}.gemspec"
end
private
def gem_path(spec)
@@ -60,11 +62,11 @@
spec.source = self
index << spec
end
end
- index.freeze
+ index
ensure
Gem.sources = old
end
def fetch_all_specs(&blk)
@@ -129,10 +131,11 @@
:wrappers => true,
:env_shebang => true,
:bin_dir => "#{Gem.dir}/bin"
installer.install
+ spec.loaded_from = "#{Gem.dir}/specifications/#{spec.full_name}.gemspec"
end
end
class Path
attr_reader :path, :options, :default_spec
@@ -150,10 +153,11 @@
s.name = options["name"]
s.source = self
s.version = Gem::Version.new(options["version"])
s.summary = "Fake gemspec for #{options["name"]}"
s.relative_loaded_from = "#{options["name"]}.gemspec"
+ s.virtual = true
end
end
end
def to_s
@@ -178,11 +182,11 @@
index << default_spec if default_spec && index.empty?
else
raise PathError, "The path `#{path}` does not exist."
end
- index.freeze
+ index
end
def local_specs
@local_specs ||= load_spec_files
end
@@ -250,11 +254,11 @@
def specs
# Start by making sure the git cache is up to date
cache
checkout
- @specs ||= load_spec_files
+ local_specs
end
def install(spec)
Bundler.ui.debug " * Using git #{uri}"
@@ -310,20 +314,20 @@
end
def cache
if cache_path.exist?
Bundler.ui.info "Updating #{uri}"
- in_cache { git "fetch --quiet #{uri} master:master" }
+ in_cache { git "fetch --quiet '#{uri}' master:master" }
else
Bundler.ui.info "Fetching #{uri}"
FileUtils.mkdir_p(cache_path.dirname)
- git "clone #{uri} #{cache_path} --bare --no-hardlinks"
+ git "clone '#{uri}' '#{cache_path}' --bare --no-hardlinks"
end
end
def checkout
- unless File.exist?("#{path}/.git")
- %x(git clone --no-checkout file://#{cache_path} #{path})
+ unless File.exist?(path.join(".git"))
+ git "clone --no-checkout '#{cache_path}' '#{path}'"
end
Dir.chdir(path) do
git "fetch --quiet"
git "reset --hard #{revision}"
end