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
data/lib/bundler/retry.rb
CHANGED
@@ -43,7 +43,10 @@ module Bundler
|
|
43
43
|
|
44
44
|
def fail_attempt(e)
|
45
45
|
@failed = true
|
46
|
-
|
46
|
+
if last_attempt? || @exceptions.any? {|k| e.is_a?(k) }
|
47
|
+
Bundler.ui.info "" unless Bundler.ui.debug?
|
48
|
+
raise e
|
49
|
+
end
|
47
50
|
return true unless name
|
48
51
|
Bundler.ui.info "" unless Bundler.ui.debug? # Add new line incase dots preceded this
|
49
52
|
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", Bundler.ui.debug?
|
data/lib/bundler/ruby_version.rb
CHANGED
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -169,6 +169,11 @@ module Gem
|
|
169
169
|
def none?
|
170
170
|
@none ||= (to_s == ">= 0")
|
171
171
|
end unless allocate.respond_to?(:none?)
|
172
|
+
|
173
|
+
def exact?
|
174
|
+
return false unless @requirements.size == 1
|
175
|
+
@requirements[0][0] == "="
|
176
|
+
end unless allocate.respond_to?(:exact?)
|
172
177
|
end
|
173
178
|
|
174
179
|
class Platform
|
@@ -12,5 +12,65 @@ module Bundler
|
|
12
12
|
def check_executable_overwrite(filename)
|
13
13
|
# Bundler needs to install gems regardless of binstub overwriting
|
14
14
|
end
|
15
|
+
|
16
|
+
def pre_install_checks
|
17
|
+
super && validate_bundler_checksum(options[:bundler_expected_checksum])
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def validate_bundler_checksum(checksum)
|
23
|
+
return true if Bundler.settings[:disable_checksum_validation]
|
24
|
+
return true unless checksum
|
25
|
+
return true unless source = @package.instance_variable_get(:@gem)
|
26
|
+
return true unless source.respond_to?(:with_read_io)
|
27
|
+
digest = source.with_read_io do |io|
|
28
|
+
digest = Digest::SHA256.new
|
29
|
+
digest << io.read(16_384) until io.eof?
|
30
|
+
io.rewind
|
31
|
+
send(checksum_type(checksum), digest)
|
32
|
+
end
|
33
|
+
unless digest == checksum
|
34
|
+
raise SecurityError, <<-MESSAGE
|
35
|
+
Bundler cannot continue installing #{spec.name} (#{spec.version}).
|
36
|
+
The checksum for the downloaded `#{spec.full_name}.gem` does not match \
|
37
|
+
the checksum given by the server. This means the contents of the downloaded \
|
38
|
+
gem is different from what was uploaded to the server, and could be a potential security issue.
|
39
|
+
|
40
|
+
To resolve this issue:
|
41
|
+
1. delete the downloaded gem located at: `#{spec.gem_dir}/#{spec.full_name}.gem`
|
42
|
+
2. run `bundle install`
|
43
|
+
|
44
|
+
If you wish to continue installing the downloaded gem, and are certain it does not pose a \
|
45
|
+
security issue despite the mismatching checksum, do the following:
|
46
|
+
1. run `bundle config disable.checksum_validation true` to turn off checksum verification
|
47
|
+
2. run `bundle install`
|
48
|
+
|
49
|
+
(More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
|
50
|
+
checksum for the downloaded gem was #{digest.inspect}.)
|
51
|
+
MESSAGE
|
52
|
+
end
|
53
|
+
true
|
54
|
+
end
|
55
|
+
|
56
|
+
def checksum_type(checksum)
|
57
|
+
case checksum.length
|
58
|
+
when 64 then :hexdigest!
|
59
|
+
when 44 then :base64digest!
|
60
|
+
else raise InstallError, "The given checksum for #{spec.full_name} (#{checksum.inspect}) is not a valid SHA256 hexdigest nor base64digest"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def hexdigest!(digest)
|
65
|
+
digest.hexdigest!
|
66
|
+
end
|
67
|
+
|
68
|
+
def base64digest!(digest)
|
69
|
+
if digest.respond_to?(:base64digest!)
|
70
|
+
digest.base64digest!
|
71
|
+
else
|
72
|
+
[digest.digest!].pack("m0")
|
73
|
+
end
|
74
|
+
end
|
15
75
|
end
|
16
76
|
end
|
@@ -71,8 +71,13 @@ module Bundler
|
|
71
71
|
spec.installed_by_version = Gem::Version.create(installed_by_version)
|
72
72
|
end
|
73
73
|
|
74
|
-
def spec_missing_extensions?(spec)
|
75
|
-
|
74
|
+
def spec_missing_extensions?(spec, default = true)
|
75
|
+
return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
|
76
|
+
|
77
|
+
return false if spec.respond_to?(:default_gem?) && spec.default_gem?
|
78
|
+
return false if spec.extensions.empty?
|
79
|
+
|
80
|
+
default
|
76
81
|
end
|
77
82
|
|
78
83
|
def path(obj)
|
@@ -80,6 +85,7 @@ module Bundler
|
|
80
85
|
end
|
81
86
|
|
82
87
|
def platforms
|
88
|
+
return [Gem::Platform::RUBY] if Bundler.settings[:force_ruby_platform]
|
83
89
|
Gem.platforms
|
84
90
|
end
|
85
91
|
|
@@ -194,6 +200,10 @@ module Bundler
|
|
194
200
|
end
|
195
201
|
end
|
196
202
|
|
203
|
+
def load_plugins
|
204
|
+
Gem.load_plugins if Gem.respond_to?(:load_plugins)
|
205
|
+
end
|
206
|
+
|
197
207
|
def ui=(obj)
|
198
208
|
Gem::DefaultUserInteraction.ui = obj
|
199
209
|
end
|
@@ -243,6 +253,10 @@ module Bundler
|
|
243
253
|
end
|
244
254
|
end
|
245
255
|
|
256
|
+
def install_with_build_args(args)
|
257
|
+
with_build_args(args) { yield }
|
258
|
+
end
|
259
|
+
|
246
260
|
def gem_from_path(path, policy = nil)
|
247
261
|
require "rubygems/format"
|
248
262
|
Gem::Format.from_file_by_path(path, policy)
|
@@ -710,6 +724,10 @@ module Bundler
|
|
710
724
|
def repository_subdirectories
|
711
725
|
Gem::REPOSITORY_SUBDIRECTORIES
|
712
726
|
end
|
727
|
+
|
728
|
+
def install_with_build_args(args)
|
729
|
+
yield
|
730
|
+
end
|
713
731
|
end
|
714
732
|
|
715
733
|
# RubyGems 2.1.0
|
@@ -750,6 +768,14 @@ module Bundler
|
|
750
768
|
end.map(&:to_spec)
|
751
769
|
end
|
752
770
|
end
|
771
|
+
|
772
|
+
def use_gemdeps(gemfile)
|
773
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(gemfile)
|
774
|
+
runtime = Bundler.setup
|
775
|
+
Bundler.ui = nil
|
776
|
+
activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name)
|
777
|
+
[Gemdeps.new(runtime), activated_spec_names]
|
778
|
+
end
|
753
779
|
end
|
754
780
|
end
|
755
781
|
|
data/lib/bundler/runtime.rb
CHANGED
@@ -140,7 +140,8 @@ module Bundler
|
|
140
140
|
|
141
141
|
Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"
|
142
142
|
|
143
|
-
|
143
|
+
specs_to_cache = Bundler.settings[:cache_all_platforms] ? @definition.resolve.materialized_for_all_platforms : specs
|
144
|
+
specs_to_cache.each do |spec|
|
144
145
|
next if spec.name == "bundler"
|
145
146
|
next if spec.source.is_a?(Source::Gemspec)
|
146
147
|
spec.source.send(:fetch_gem, spec) if Bundler.settings[:cache_all_platforms] && spec.source.respond_to?(:fetch_gem, true)
|
data/lib/bundler/settings.rb
CHANGED
@@ -7,6 +7,7 @@ module Bundler
|
|
7
7
|
allow_offline_install
|
8
8
|
auto_install
|
9
9
|
cache_all
|
10
|
+
disable_checksum_validation
|
10
11
|
disable_exec_load
|
11
12
|
disable_local_branch_check
|
12
13
|
disable_shared_gems
|
@@ -17,6 +18,7 @@ module Bundler
|
|
17
18
|
major_deprecations
|
18
19
|
no_install
|
19
20
|
no_prune
|
21
|
+
force_ruby_platform
|
20
22
|
only_update_to_newer_versions
|
21
23
|
plugins
|
22
24
|
silence_root_warning
|
@@ -42,11 +44,18 @@ module Bundler
|
|
42
44
|
@local_config = load_config(local_config_file)
|
43
45
|
@global_config = load_config(global_config_file)
|
44
46
|
@cli_flags_given = false
|
47
|
+
@temporary = {}
|
45
48
|
end
|
46
49
|
|
47
50
|
def [](name)
|
48
51
|
key = key_for(name)
|
49
|
-
value = (
|
52
|
+
value = @temporary.fetch(name) do
|
53
|
+
@local_config.fetch(key) do
|
54
|
+
ENV.fetch(key) do
|
55
|
+
@global_config.fetch(key) do
|
56
|
+
DEFAULT_CONFIG.fetch(name) do
|
57
|
+
nil
|
58
|
+
end end end end end
|
50
59
|
|
51
60
|
if value.nil?
|
52
61
|
nil
|
@@ -76,9 +85,19 @@ module Bundler
|
|
76
85
|
local_config_file || raise(GemfileNotFound, "Could not locate Gemfile")
|
77
86
|
set_key(key, value, @local_config, local_config_file)
|
78
87
|
end
|
79
|
-
|
80
88
|
alias_method :set_local, :[]=
|
81
89
|
|
90
|
+
def temporary(update)
|
91
|
+
existing = Hash[update.map {|k, _| [k, @temporary[k]] }]
|
92
|
+
@temporary.update(update)
|
93
|
+
return unless block_given?
|
94
|
+
begin
|
95
|
+
yield
|
96
|
+
ensure
|
97
|
+
existing.each {|k, v| v.nil? ? @temporary.delete(k) : @temporary[k] = v }
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
82
101
|
def delete(key)
|
83
102
|
@local_config.delete(key_for(key))
|
84
103
|
end
|
@@ -221,7 +240,12 @@ module Bundler
|
|
221
240
|
end
|
222
241
|
|
223
242
|
def to_bool(value)
|
224
|
-
|
243
|
+
case value
|
244
|
+
when nil, /\A(false|f|no|n|0|)\z/i, false
|
245
|
+
false
|
246
|
+
else
|
247
|
+
true
|
248
|
+
end
|
225
249
|
end
|
226
250
|
|
227
251
|
def is_num(value)
|
@@ -279,10 +303,10 @@ module Bundler
|
|
279
303
|
}xo
|
280
304
|
|
281
305
|
def load_config(config_file)
|
282
|
-
return {}
|
306
|
+
return {} if !config_file || ignore_config?
|
283
307
|
SharedHelpers.filesystem_access(config_file, :read) do |file|
|
284
308
|
valid_file = file.exist? && !file.size.zero?
|
285
|
-
return {}
|
309
|
+
return {} unless valid_file
|
286
310
|
require "bundler/yaml_serializer"
|
287
311
|
YAMLSerializer.load file.read
|
288
312
|
end
|
data/lib/bundler/setup.rb
CHANGED
@@ -8,6 +8,7 @@ require "bundler/current_ruby"
|
|
8
8
|
|
9
9
|
module Gem
|
10
10
|
class Dependency
|
11
|
+
# This is only needed for RubyGems < 1.4
|
11
12
|
unless method_defined? :requirement
|
12
13
|
def requirement
|
13
14
|
version_requirements
|
@@ -18,8 +19,6 @@ end
|
|
18
19
|
|
19
20
|
module Bundler
|
20
21
|
module SharedHelpers
|
21
|
-
attr_accessor :gem_loaded
|
22
|
-
|
23
22
|
def default_gemfile
|
24
23
|
gemfile = find_gemfile
|
25
24
|
raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
|
@@ -39,10 +38,12 @@ module Bundler
|
|
39
38
|
bundle_dir = find_directory(".bundle")
|
40
39
|
return nil unless bundle_dir
|
41
40
|
|
42
|
-
|
41
|
+
bundle_dir = Pathname.new(bundle_dir)
|
42
|
+
|
43
|
+
global_bundle_dir = Bundler.user_home.join(".bundle")
|
43
44
|
return nil if bundle_dir == global_bundle_dir
|
44
45
|
|
45
|
-
|
46
|
+
bundle_dir
|
46
47
|
end
|
47
48
|
|
48
49
|
def in_bundle?
|
@@ -109,8 +110,14 @@ module Bundler
|
|
109
110
|
raise TemporaryResourceError.new(path, action)
|
110
111
|
rescue Errno::EPROTO
|
111
112
|
raise VirtualProtocolError.new
|
113
|
+
rescue Errno::ENOSPC
|
114
|
+
raise NoSpaceOnDeviceError.new(path, action)
|
112
115
|
rescue *[const_get_safely(:ENOTSUP, Errno)].compact
|
113
116
|
raise OperationNotSupportedError.new(path, action)
|
117
|
+
rescue Errno::EEXIST, Errno::ENOENT
|
118
|
+
raise
|
119
|
+
rescue SystemCallError => e
|
120
|
+
raise GenericSystemCallError.new(e, "There was an error accessing `#{path}`.")
|
114
121
|
end
|
115
122
|
|
116
123
|
def const_get_safely(constant_name, namespace)
|
@@ -202,29 +209,33 @@ module Bundler
|
|
202
209
|
|
203
210
|
def set_rubylib
|
204
211
|
rubylib = (ENV["RUBYLIB"] || "").split(File::PATH_SEPARATOR)
|
205
|
-
rubylib.unshift
|
212
|
+
rubylib.unshift bundler_ruby_lib
|
206
213
|
ENV["RUBYLIB"] = rubylib.uniq.join(File::PATH_SEPARATOR)
|
207
214
|
end
|
208
215
|
|
216
|
+
def bundler_ruby_lib
|
217
|
+
File.expand_path("../..", __FILE__)
|
218
|
+
end
|
219
|
+
|
209
220
|
def clean_load_path
|
210
221
|
# handle 1.9 where system gems are always on the load path
|
211
|
-
|
212
|
-
me = File.expand_path("../../", __FILE__)
|
213
|
-
me = /^#{Regexp.escape(me)}/
|
222
|
+
return unless defined?(::Gem)
|
214
223
|
|
215
|
-
|
224
|
+
bundler_lib = bundler_ruby_lib
|
216
225
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
226
|
+
loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
|
227
|
+
|
228
|
+
$LOAD_PATH.reject! do |p|
|
229
|
+
next if File.expand_path(p).start_with?(bundler_lib)
|
230
|
+
loaded_gem_paths.delete(p)
|
222
231
|
end
|
232
|
+
$LOAD_PATH.uniq!
|
223
233
|
end
|
224
234
|
|
225
235
|
def prints_major_deprecations?
|
226
236
|
require "bundler"
|
227
|
-
|
237
|
+
deprecation_release = Bundler::VERSION.split(".").drop(1).include?("99")
|
238
|
+
return false if !deprecation_release && !Bundler.settings[:major_deprecations]
|
228
239
|
require "bundler/deprecate"
|
229
240
|
return false if Bundler::Deprecate.skip
|
230
241
|
true
|
data/lib/bundler/source.rb
CHANGED
@@ -14,6 +14,7 @@ module Bundler
|
|
14
14
|
|
15
15
|
def version_message(spec)
|
16
16
|
message = "#{spec.name} #{spec.version}"
|
17
|
+
message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY && !spec.platform.nil?
|
17
18
|
|
18
19
|
if Bundler.locked_gems
|
19
20
|
locked_spec = Bundler.locked_gems.specs.find {|s| s.name == spec.name }
|
@@ -33,5 +34,9 @@ module Bundler
|
|
33
34
|
def include?(other)
|
34
35
|
other == self
|
35
36
|
end
|
37
|
+
|
38
|
+
def inspect
|
39
|
+
"#<#{self.class}:0x#{object_id} #{self}>"
|
40
|
+
end
|
36
41
|
end
|
37
42
|
end
|
data/lib/bundler/source/git.rb
CHANGED
@@ -292,7 +292,7 @@ module Bundler
|
|
292
292
|
def fetch
|
293
293
|
git_proxy.checkout
|
294
294
|
rescue GitError
|
295
|
-
raise unless Bundler.
|
295
|
+
raise unless Bundler.feature_flag.allow_offline_install?
|
296
296
|
Bundler.ui.warn "Using cached git data because of network errors"
|
297
297
|
end
|
298
298
|
end
|
@@ -224,6 +224,11 @@ module Bundler
|
|
224
224
|
raise GitError, "The git source #{uri} is not yet checked out. Please run `bundle install` before trying to start your application"
|
225
225
|
end
|
226
226
|
|
227
|
+
# TODO: Replace this with Open3 when upgrading to bundler 2
|
228
|
+
# Similar to #git_null, as Open3 is not cross-platform,
|
229
|
+
# a temporary way is to use Tempfile to capture the stderr.
|
230
|
+
# When replacing this using Open3, make sure git_null is
|
231
|
+
# also replaced by Open3, so stdout and stderr all got handled properly.
|
227
232
|
def capture_and_filter_stderr(uri)
|
228
233
|
return_value, captured_err = ""
|
229
234
|
backup_stderr = STDERR.dup
|
data/lib/bundler/source/path.rb
CHANGED
@@ -46,7 +46,7 @@ module Bundler
|
|
46
46
|
|
47
47
|
def to_lock
|
48
48
|
out = String.new("PATH\n")
|
49
|
-
out << " remote: #{
|
49
|
+
out << " remote: #{lockfile_path}\n"
|
50
50
|
out << " glob: #{@glob}\n" unless @glob == DEFAULT_GLOB
|
51
51
|
out << " specs:\n"
|
52
52
|
end
|
@@ -129,6 +129,11 @@ module Bundler
|
|
129
129
|
"`#{somepath}`.\nThe error message was: #{e.message}."
|
130
130
|
end
|
131
131
|
|
132
|
+
def lockfile_path
|
133
|
+
return relative_path if path.absolute?
|
134
|
+
expand(path).relative_path_from(Bundler.root)
|
135
|
+
end
|
136
|
+
|
132
137
|
def app_cache_path(custom_path = nil)
|
133
138
|
@app_cache_path ||= Bundler.app_cache(custom_path).join(app_cache_dirname)
|
134
139
|
end
|
@@ -140,7 +140,9 @@ module Bundler
|
|
140
140
|
:bin_dir => bin_path.to_s,
|
141
141
|
:ignore_dependencies => true,
|
142
142
|
:wrappers => true,
|
143
|
-
:env_shebang => true
|
143
|
+
:env_shebang => true,
|
144
|
+
:build_args => opts[:build_args],
|
145
|
+
:bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum
|
144
146
|
).install
|
145
147
|
end
|
146
148
|
spec.full_gem_path = installed_spec.full_gem_path
|
@@ -291,6 +293,10 @@ module Bundler
|
|
291
293
|
next if spec.name == "bundler" && spec.version.to_s != VERSION
|
292
294
|
have_bundler = true if spec.name == "bundler"
|
293
295
|
spec.source = self
|
296
|
+
if Bundler.rubygems.spec_missing_extensions?(spec, false)
|
297
|
+
Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
|
298
|
+
next
|
299
|
+
end
|
294
300
|
idx << spec
|
295
301
|
end
|
296
302
|
|
@@ -321,6 +327,10 @@ module Bundler
|
|
321
327
|
next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
|
322
328
|
s ||= Bundler.rubygems.spec_from_gem(gemfile)
|
323
329
|
s.source = self
|
330
|
+
if Bundler.rubygems.spec_missing_extensions?(s, false)
|
331
|
+
Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions"
|
332
|
+
next
|
333
|
+
end
|
324
334
|
idx << s
|
325
335
|
end
|
326
336
|
end
|