bundler 1.13.7 → 1.14.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop_todo.yml +100 -18
- data/.travis.yml +32 -18
- data/CHANGELOG.md +64 -2
- data/DEVELOPMENT.md +5 -3
- data/ISSUES.md +17 -0
- data/README.md +7 -0
- data/Rakefile +34 -23
- data/bin/rubocop +1 -1
- data/bundler.gemspec +2 -2
- data/exe/bundle +4 -6
- data/lib/bundler.rb +57 -5
- data/lib/bundler/cli.rb +51 -38
- data/lib/bundler/cli/binstubs.rb +1 -1
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/check.rb +1 -1
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +30 -0
- data/lib/bundler/cli/doctor.rb +17 -19
- data/lib/bundler/cli/exec.rb +6 -0
- data/lib/bundler/cli/gem.rb +18 -4
- data/lib/bundler/cli/install.rb +9 -25
- data/lib/bundler/cli/lock.rb +8 -7
- data/lib/bundler/cli/outdated.rb +163 -56
- data/lib/bundler/cli/platform.rb +1 -1
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +10 -23
- data/lib/bundler/compact_index_client.rb +108 -0
- data/lib/bundler/compact_index_client/cache.rb +119 -0
- data/lib/bundler/compact_index_client/updater.rb +88 -0
- data/lib/bundler/current_ruby.rb +4 -3
- data/lib/bundler/definition.rb +107 -17
- data/lib/bundler/dependency.rb +6 -0
- data/lib/bundler/dsl.rb +3 -2
- data/lib/bundler/env.rb +27 -18
- data/lib/bundler/errors.rb +22 -0
- data/lib/bundler/feature_flag.rb +32 -0
- data/lib/bundler/fetcher.rb +2 -2
- data/lib/bundler/fetcher/compact_index.rb +17 -5
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +11 -0
- data/lib/bundler/friendly_errors.rb +28 -7
- data/lib/bundler/gem_helper.rb +1 -1
- data/lib/bundler/gem_helpers.rb +69 -1
- data/lib/bundler/gemdeps.rb +28 -0
- data/lib/bundler/index.rb +9 -4
- data/lib/bundler/inline.rb +3 -3
- data/lib/bundler/installer.rb +3 -2
- data/lib/bundler/installer/gem_installer.rb +2 -2
- data/lib/bundler/installer/parallel_installer.rb +40 -9
- data/lib/bundler/lazy_specification.rb +16 -1
- data/lib/bundler/lockfile_parser.rb +1 -2
- data/lib/bundler/match_platform.rb +12 -3
- data/lib/bundler/plugin.rb +4 -2
- data/lib/bundler/plugin/api.rb +2 -1
- data/lib/bundler/plugin/api/source.rb +1 -1
- data/lib/bundler/postit_trampoline.rb +12 -7
- data/lib/bundler/remote_specification.rb +5 -0
- data/lib/bundler/resolver.rb +59 -49
- data/lib/bundler/retry.rb +4 -1
- data/lib/bundler/ruby_version.rb +5 -0
- data/lib/bundler/rubygems_ext.rb +5 -0
- data/lib/bundler/rubygems_gem_installer.rb +60 -0
- data/lib/bundler/rubygems_integration.rb +28 -2
- data/lib/bundler/runtime.rb +2 -1
- data/lib/bundler/settings.rb +29 -5
- data/lib/bundler/setup.rb +1 -1
- data/lib/bundler/shared_helpers.rb +26 -15
- data/lib/bundler/source.rb +5 -0
- data/lib/bundler/source/git.rb +1 -1
- data/lib/bundler/source/git/git_proxy.rb +5 -0
- data/lib/bundler/source/path.rb +6 -1
- data/lib/bundler/source/rubygems.rb +11 -1
- data/lib/bundler/spec_set.rb +32 -13
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/templates/newgem/bin/console.tt +1 -1
- data/lib/bundler/templates/newgem/gitignore.tt +5 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +10 -1
- data/lib/bundler/ui/shell.rb +4 -0
- data/lib/bundler/ui/silent.rb +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +12 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +22 -13
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/faster.rb +1 -0
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +24 -23
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb +2 -1
- data/lib/bundler/vendored_persistent.rb +9 -4
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +27 -5
- data/lib/bundler/yaml_serializer.rb +1 -1
- data/man/bundle-config.ronn +29 -2
- data/man/bundle-install.ronn +1 -1
- data/man/bundle-lock.ronn +47 -0
- data/man/bundle-outdated.ronn +107 -0
- data/man/bundle-update.ronn +152 -3
- data/man/bundle.ronn +27 -9
- data/man/gemfile.5.ronn +8 -0
- metadata +37 -31
- data/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +0 -79
- data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb +0 -112
- data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +0 -80
- data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb +0 -4
@@ -1,80 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require "fileutils"
|
3
|
-
require "stringio"
|
4
|
-
require "tmpdir"
|
5
|
-
require "zlib"
|
6
|
-
|
7
|
-
class Bundler::CompactIndexClient
|
8
|
-
class Updater
|
9
|
-
class MisMatchedChecksumError < Error
|
10
|
-
def initialize(path, server_checksum, local_checksum)
|
11
|
-
@path = path
|
12
|
-
@server_checksum = server_checksum
|
13
|
-
@local_checksum = local_checksum
|
14
|
-
end
|
15
|
-
|
16
|
-
def message
|
17
|
-
"The checksum of /#{@path} does not match the checksum provided by the server! Something is wrong " \
|
18
|
-
"(local checksum is #{@local_checksum.inspect}, was expecting #{@server_checksum.inspect})."
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def initialize(fetcher)
|
23
|
-
@fetcher = fetcher
|
24
|
-
end
|
25
|
-
|
26
|
-
def update(local_path, remote_path, retrying = nil)
|
27
|
-
headers = {}
|
28
|
-
|
29
|
-
Dir.mktmpdir("bundler-compact-index-") do |local_temp_dir|
|
30
|
-
local_temp_path = Pathname.new(local_temp_dir).join(local_path.basename)
|
31
|
-
|
32
|
-
# first try to fetch any new bytes on the existing file
|
33
|
-
if retrying.nil? && local_path.file?
|
34
|
-
FileUtils.cp local_path, local_temp_path
|
35
|
-
headers["If-None-Match"] = etag_for(local_temp_path)
|
36
|
-
headers["Range"] = "bytes=#{local_temp_path.size}-"
|
37
|
-
else
|
38
|
-
# Fastly ignores Range when Accept-Encoding: gzip is set
|
39
|
-
headers["Accept-Encoding"] = "gzip"
|
40
|
-
end
|
41
|
-
|
42
|
-
response = @fetcher.call(remote_path, headers)
|
43
|
-
return if response.is_a?(Net::HTTPNotModified)
|
44
|
-
|
45
|
-
content = response.body
|
46
|
-
if response["Content-Encoding"] == "gzip"
|
47
|
-
content = Zlib::GzipReader.new(StringIO.new(content)).read
|
48
|
-
end
|
49
|
-
|
50
|
-
mode = response.is_a?(Net::HTTPPartialContent) ? "a" : "w"
|
51
|
-
local_temp_path.open(mode) {|f| f << content }
|
52
|
-
|
53
|
-
response_etag = response["ETag"].gsub(%r{\AW/}, "")
|
54
|
-
if etag_for(local_temp_path) == response_etag
|
55
|
-
FileUtils.mv(local_temp_path, local_path)
|
56
|
-
return
|
57
|
-
end
|
58
|
-
|
59
|
-
if retrying.nil?
|
60
|
-
update(local_path, remote_path, :retrying)
|
61
|
-
else
|
62
|
-
raise MisMatchedChecksumError.new(remote_path, response_etag, etag_for(local_temp_path))
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def etag_for(path)
|
68
|
-
sum = checksum_for_file(path)
|
69
|
-
sum ? %("#{sum}") : nil
|
70
|
-
end
|
71
|
-
|
72
|
-
def checksum_for_file(path)
|
73
|
-
return nil unless path.file?
|
74
|
-
# This must use IO.read instead of Digest.file().hexdigest
|
75
|
-
# because we need to preserve \n line endings on windows when calculating
|
76
|
-
# the checksum
|
77
|
-
Digest::MD5.hexdigest(IO.read(path))
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|