rubygems-update 2.6.8 → 2.6.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +9 -6
  3. data/CODE_OF_CONDUCT.md +36 -33
  4. data/History.txt +16 -0
  5. data/Manifest.txt +5 -3
  6. data/Rakefile +5 -0
  7. data/bundler/CHANGELOG.md +72 -0
  8. data/bundler/DEVELOPMENT.md +2 -2
  9. data/bundler/README.md +5 -0
  10. data/bundler/lib/bundler.rb +1 -1
  11. data/bundler/lib/bundler/cli.rb +42 -29
  12. data/bundler/lib/bundler/cli/common.rb +17 -0
  13. data/bundler/lib/bundler/cli/exec.rb +6 -0
  14. data/bundler/lib/bundler/cli/gem.rb +16 -3
  15. data/bundler/lib/bundler/cli/install.rb +7 -20
  16. data/bundler/lib/bundler/cli/lock.rb +1 -1
  17. data/bundler/lib/bundler/cli/open.rb +2 -1
  18. data/bundler/lib/bundler/cli/outdated.rb +91 -43
  19. data/bundler/lib/bundler/cli/update.rb +3 -10
  20. data/bundler/lib/bundler/compact_index_client.rb +7 -1
  21. data/bundler/lib/bundler/current_ruby.rb +1 -0
  22. data/bundler/lib/bundler/definition.rb +9 -5
  23. data/bundler/lib/bundler/dependency.rb +12 -0
  24. data/bundler/lib/bundler/env.rb +25 -20
  25. data/bundler/lib/bundler/errors.rb +21 -0
  26. data/bundler/lib/bundler/fetcher.rb +2 -2
  27. data/bundler/lib/bundler/fetcher/compact_index.rb +15 -3
  28. data/bundler/lib/bundler/friendly_errors.rb +23 -7
  29. data/bundler/lib/bundler/index.rb +9 -4
  30. data/bundler/lib/bundler/inline.rb +1 -1
  31. data/bundler/lib/bundler/installer.rb +1 -1
  32. data/bundler/lib/bundler/installer/gem_installer.rb +2 -2
  33. data/bundler/lib/bundler/installer/parallel_installer.rb +40 -9
  34. data/bundler/lib/bundler/lockfile_parser.rb +0 -1
  35. data/bundler/lib/bundler/match_platform.rb +12 -4
  36. data/bundler/lib/bundler/plugin/api.rb +2 -1
  37. data/bundler/lib/bundler/plugin/api/source.rb +1 -1
  38. data/bundler/lib/bundler/postit_trampoline.rb +3 -3
  39. data/bundler/lib/bundler/resolver.rb +6 -1
  40. data/bundler/lib/bundler/retry.rb +4 -1
  41. data/bundler/lib/bundler/rubygems_gem_installer.rb +18 -6
  42. data/bundler/lib/bundler/rubygems_integration.rb +16 -3
  43. data/bundler/lib/bundler/settings.rb +8 -3
  44. data/bundler/lib/bundler/shared_helpers.rb +15 -12
  45. data/bundler/lib/bundler/source.rb +4 -0
  46. data/bundler/lib/bundler/source/git/git_proxy.rb +2 -1
  47. data/bundler/lib/bundler/source/rubygems.rb +9 -0
  48. data/bundler/lib/bundler/spec_set.rb +4 -0
  49. data/bundler/lib/bundler/templates/newgem/gitignore.tt +5 -0
  50. data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
  51. data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +10 -1
  52. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +10 -1
  53. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
  54. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -2
  55. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -2
  56. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
  57. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +10 -3
  58. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +12 -1
  59. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -2
  60. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
  61. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +2 -0
  62. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  63. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +27 -19
  64. data/bundler/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/faster.rb +1 -0
  65. data/bundler/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +24 -23
  66. data/bundler/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb +2 -1
  67. data/bundler/lib/bundler/vendored_persistent.rb +9 -4
  68. data/bundler/lib/bundler/version.rb +1 -1
  69. data/bundler/lib/bundler/worker.rb +27 -5
  70. data/bundler/man/bundle-config.ronn +28 -1
  71. data/bundler/man/bundle-install.ronn +1 -1
  72. data/bundler/man/bundle-lock.ronn +47 -0
  73. data/bundler/man/bundle-outdated.ronn +107 -0
  74. data/bundler/man/bundle-update.ronn +152 -3
  75. data/bundler/man/bundle.ronn +22 -4
  76. data/bundler/man/gemfile.5.ronn +16 -0
  77. data/lib/rubygems.rb +1 -1
  78. data/lib/rubygems/ext/ext_conf_builder.rb +5 -3
  79. data/lib/rubygems/ext/rake_builder.rb +1 -1
  80. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +3 -1
  81. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +9 -2
  82. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +2 -0
  83. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  84. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +17 -17
  85. data/lib/rubygems/server.rb +11 -4
  86. data/lib/rubygems/stub_specification.rb +6 -1
  87. data/lib/rubygems/version.rb +6 -2
  88. data/test/rubygems/test_gem.rb +2 -0
  89. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +23 -0
  90. data/test/rubygems/test_gem_ext_rake_builder.rb +34 -17
  91. data/test/rubygems/test_gem_server.rb +16 -0
  92. data/test/rubygems/test_gem_specification.rb +1 -1
  93. data/test/rubygems/test_gem_stub_specification.rb +61 -0
  94. data/test/rubygems/test_gem_version.rb +6 -0
  95. data/util/ci +5 -5
  96. metadata +31 -29
@@ -12,44 +12,49 @@ module Bundler
12
12
  print_gemfile = options.delete(:print_gemfile)
13
13
  print_gemspecs = options.delete(:print_gemspecs)
14
14
 
15
- out = String.new("Environment\n\n")
16
- out << " Bundler #{Bundler::VERSION}\n"
17
- out << " Rubygems #{Gem::VERSION}\n"
18
- out << " Ruby #{ruby_version}"
19
- out << " GEM_HOME #{ENV["GEM_HOME"]}\n" unless ENV["GEM_HOME"].nil? || ENV["GEM_HOME"].empty?
20
- out << " GEM_PATH #{ENV["GEM_PATH"]}\n" unless ENV["GEM_PATH"] == ENV["GEM_HOME"]
21
- out << " RVM #{ENV["rvm_version"]}\n" if ENV["rvm_version"]
22
- out << " Git #{git_version}\n"
23
- out << " Platform #{Gem::Platform.local}\n"
24
- out << " OpenSSL #{OpenSSL::OPENSSL_VERSION}\n" if defined?(OpenSSL::OPENSSL_VERSION)
15
+ out = String.new("## Environment\n\n```\n")
16
+ out << "Bundler #{Bundler::VERSION}\n"
17
+ out << "Rubygems #{Gem::VERSION}\n"
18
+ out << "Ruby #{ruby_version}"
19
+ out << "GEM_HOME #{ENV["GEM_HOME"]}\n" unless ENV["GEM_HOME"].nil? || ENV["GEM_HOME"].empty?
20
+ out << "GEM_PATH #{ENV["GEM_PATH"]}\n" unless ENV["GEM_PATH"] == ENV["GEM_HOME"]
21
+ out << "RVM #{ENV["rvm_version"]}\n" if ENV["rvm_version"]
22
+ out << "Git #{git_version}\n"
23
+ out << "Platform #{Gem::Platform.local}\n"
24
+ out << "OpenSSL #{OpenSSL::OPENSSL_VERSION}\n" if defined?(OpenSSL::OPENSSL_VERSION)
25
25
  %w(rubygems-bundler open_gem).each do |name|
26
26
  specs = Bundler.rubygems.find_name(name)
27
- out << " #{name} (#{specs.map(&:version).join(",")})\n" unless specs.empty?
27
+ out << "#{name} (#{specs.map(&:version).join(",")})\n" unless specs.empty?
28
28
  end
29
29
 
30
- out << "\nBundler settings\n\n" unless Bundler.settings.all.empty?
30
+ out << "```\n"
31
+
32
+ out << "\n## Bundler settings\n\n```\n" unless Bundler.settings.all.empty?
31
33
  Bundler.settings.all.each do |setting|
32
- out << " " << setting << "\n"
34
+ out << setting << "\n"
33
35
  Bundler.settings.pretty_values_for(setting).each do |line|
34
- out << " " << line << "\n"
36
+ out << " " << line << "\n"
35
37
  end
36
38
  end
39
+ out << "```\n"
37
40
 
38
41
  return out unless SharedHelpers.in_bundle?
39
42
 
40
43
  if print_gemfile
41
- out << "\n#{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}\n\n"
42
- out << " " << read_file(Bundler.default_gemfile).gsub(/\n/, "\n ") << "\n"
44
+ out << "\n## Gemfile\n"
45
+ out << "\n### #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}\n\n"
46
+ out << "```ruby\n" << read_file(Bundler.default_gemfile).chomp << "\n```\n"
43
47
 
44
- out << "\n#{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}\n\n"
45
- out << " " << read_file(Bundler.default_lockfile).gsub(/\n/, "\n ") << "\n"
48
+ out << "\n### #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}\n\n"
49
+ out << "```\n" << read_file(Bundler.default_lockfile).chomp << "\n```\n"
46
50
  end
47
51
 
48
52
  if print_gemspecs
49
53
  dsl = Dsl.new.tap {|d| d.eval_gemfile(Bundler.default_gemfile) }
54
+ out << "\n## Gemspecs\n" unless dsl.gemspecs.empty?
50
55
  dsl.gemspecs.each do |gs|
51
- out << "\n#{File.basename(gs.loaded_from)}"
52
- out << "\n\n " << read_file(gs.loaded_from).gsub(/\n/, "\n ") << "\n"
56
+ out << "\n### #{File.basename(gs.loaded_from)}"
57
+ out << "\n\n```ruby\n" << read_file(gs.loaded_from).chomp << "\n```\n"
53
58
  end
54
59
  end
55
60
 
@@ -53,6 +53,7 @@ module Bundler
53
53
  class GemfileLockNotFound < BundlerError; status_code(22); end
54
54
  class PluginError < BundlerError; status_code(29); end
55
55
  class SudoNotPermittedError < BundlerError; status_code(30); end
56
+ class ThreadCreationError < BundlerError; status_code(33); end
56
57
  class GemfileEvalError < GemfileError; end
57
58
  class MarshalError < StandardError; end
58
59
 
@@ -132,4 +133,24 @@ module Bundler
132
133
 
133
134
  status_code(28)
134
135
  end
136
+
137
+ class NoSpaceOnDeviceError < PermissionError
138
+ def message
139
+ "There was an error while trying to #{action} `#{@path}`. " \
140
+ "There was insufficent space remaining on the device."
141
+ end
142
+
143
+ status_code(31)
144
+ end
145
+
146
+ class GenericSystemCallError < BundlerError
147
+ attr_reader :underlying_error
148
+
149
+ def initialize(underlying_error, message)
150
+ @underlying_error = underlying_error
151
+ super("#{message}\nThe underlying system error is #{@underlying_error.class}: #{@underlying_error}")
152
+ end
153
+
154
+ status_code(32)
155
+ end
135
156
  end
@@ -237,7 +237,7 @@ module Bundler
237
237
  Bundler.settings[:ssl_client_cert]
238
238
  raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
239
239
 
240
- con = Net::HTTP::Persistent.new "bundler", :ENV
240
+ con = Bundler::Persistent::Net::HTTP::Persistent.new "bundler", :ENV
241
241
  if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
242
242
  con.proxy = URI.parse(gem_proxy) if gem_proxy != :no_proxy
243
243
  end
@@ -273,7 +273,7 @@ module Bundler
273
273
  Timeout::Error, EOFError, SocketError, Errno::ENETDOWN, Errno::ENETUNREACH,
274
274
  Errno::EINVAL, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EAGAIN,
275
275
  Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
276
- Net::HTTP::Persistent::Error, Zlib::BufError, Errno::EHOSTUNREACH
276
+ Bundler::Persistent::Net::HTTP::Persistent::Error, Zlib::BufError, Errno::EHOSTUNREACH
277
277
  ].freeze
278
278
 
279
279
  def bundler_cert_store
@@ -3,10 +3,10 @@ require "bundler/fetcher/base"
3
3
  require "bundler/worker"
4
4
 
5
5
  module Bundler
6
+ autoload :CompactIndexClient, "bundler/compact_index_client"
7
+
6
8
  class Fetcher
7
9
  class CompactIndex < Base
8
- require "bundler/compact_index_client"
9
-
10
10
  def self.compact_index_request(method_name)
11
11
  method = instance_method(method_name)
12
12
  undef_method(method_name)
@@ -61,6 +61,7 @@ module Bundler
61
61
  compact_index_request :fetch_spec
62
62
 
63
63
  def available?
64
+ return nil unless md5_available?
64
65
  user_home = Bundler.user_home
65
66
  return nil unless user_home.directory? && user_home.writable?
66
67
  # Read info file checksums out of /versions, so we can know if gems are up to date
@@ -95,7 +96,7 @@ module Bundler
95
96
  def bundle_worker(func = nil)
96
97
  @bundle_worker ||= begin
97
98
  worker_name = "Compact Index (#{display_uri.host})"
98
- Bundler::Worker.new(25, worker_name, func)
99
+ Bundler::Worker.new(Bundler.current_ruby.rbx? ? 1 : 25, worker_name, func)
99
100
  end
100
101
  @bundle_worker.tap do |worker|
101
102
  worker.instance_variable_set(:@func, func) if func
@@ -119,6 +120,17 @@ module Bundler
119
120
  Net::HTTPNotModified.new(nil, nil, nil)
120
121
  end
121
122
  end
123
+
124
+ def md5_available?
125
+ begin
126
+ require "openssl"
127
+ return false if defined?(OpenSSL::OPENSSL_FIPS) && OpenSSL::OPENSSL_FIPS
128
+ rescue LoadError
129
+ nil
130
+ end
131
+
132
+ true
133
+ end
122
134
  end
123
135
  end
124
136
  end
@@ -58,25 +58,41 @@ module Bundler
58
58
  def request_issue_report_for(e)
59
59
  Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
60
60
  --- ERROR REPORT TEMPLATE -------------------------------------------------------
61
- - What did you do?
61
+ # Error Report
62
+
63
+ ## Questions
64
+
65
+ Please fill out answers to these questions, it'll help us figure out
66
+ why things are going wrong.
67
+
68
+ - **What did you do?**
62
69
 
63
70
  I ran the command `#{$PROGRAM_NAME} #{ARGV.join(" ")}`
64
71
 
65
- - What did you expect to happen?
72
+ - **What did you expect to happen?**
66
73
 
67
74
  I expected Bundler to...
68
75
 
69
- - What happened instead?
76
+ - **What happened instead?**
70
77
 
71
78
  Instead, what happened was...
72
79
 
80
+ - **Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?**
81
+
82
+ I tried...
83
+
84
+ - **Have you read our issues document, https://github.com/bundler/bundler/blob/master/ISSUES.md?**
85
+
86
+ ...
73
87
 
74
- Error details
88
+ ## Backtrace
75
89
 
76
- #{e.class}: #{e.message}
77
- #{e.backtrace && e.backtrace.join("\n ")}
90
+ ```
91
+ #{e.class}: #{e.message}
92
+ #{e.backtrace && e.backtrace.join("\n ").chomp}
93
+ ```
78
94
 
79
- #{Bundler::Env.new.report(:print_gemfile => false, :print_gemspecs => false).gsub(/\n/, "\n ").strip}
95
+ #{Bundler::Env.new.report(:print_gemfile => false, :print_gemspecs => false)}
80
96
  --- TEMPLATE END ----------------------------------------------------------------
81
97
 
82
98
  EOS
@@ -109,14 +109,19 @@ module Bundler
109
109
 
110
110
  # returns a list of the dependencies
111
111
  def unmet_dependency_names
112
- names = dependency_names
113
- names.delete_if {|n| n == "bundler" }
114
- names.select {|n| search(n).empty? }
112
+ dependency_names.select do |name|
113
+ name != "bundler" && search(name).empty?
114
+ end
115
115
  end
116
116
 
117
117
  def dependency_names
118
118
  names = []
119
- each {|s| names.concat(s.dependencies.map(&:name)) }
119
+ each do |spec|
120
+ spec.dependencies.each do |dep|
121
+ next if dep.type == :development
122
+ names << dep.name
123
+ end
124
+ end
120
125
  names.uniq
121
126
  end
122
127
 
@@ -60,7 +60,7 @@ def gemfile(install = false, options = {}, &gemfile)
60
60
 
61
61
  Bundler.ui = ui if install
62
62
  if install || missing_specs.call
63
- installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
63
+ installer = Bundler::Installer.install(Bundler.root, definition, :system => true, :inline => true)
64
64
  installer.post_install_messages.each do |name, message|
65
65
  Bundler.ui.info "Post-install message from #{name}:\n#{message}"
66
66
  end
@@ -212,7 +212,7 @@ module Bundler
212
212
  end
213
213
 
214
214
  def resolve_if_need(options)
215
- if Bundler.default_lockfile.exist? && !options["update"]
215
+ if Bundler.default_lockfile.exist? && !options["update"] && !options[:inline]
216
216
  local = Bundler.ui.silence do
217
217
  begin
218
218
  tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
@@ -52,12 +52,12 @@ module Bundler
52
52
  end
53
53
 
54
54
  def install
55
- spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone)
55
+ spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone, :build_args => [spec_settings])
56
56
  end
57
57
 
58
58
  def install_with_settings
59
59
  # Build arguments are global, so this is mutexed
60
- Bundler.rubygems.with_build_args([spec_settings]) { install }
60
+ Bundler.rubygems.install_with_build_args([spec_settings]) { install }
61
61
  end
62
62
 
63
63
  def out_of_space_message
@@ -47,23 +47,22 @@ module Bundler
47
47
  # sure needed dependencies have been installed.
48
48
  def dependencies_installed?(all_specs)
49
49
  installed_specs = all_specs.select(&:installed?).map(&:name)
50
- dependencies(all_specs.map(&:name)).all? {|d| installed_specs.include? d.name }
50
+ dependencies.all? {|d| installed_specs.include? d.name }
51
51
  end
52
52
 
53
53
  # Represents only the non-development dependencies, the ones that are
54
54
  # itself and are in the total list.
55
- def dependencies(all_spec_names)
55
+ def dependencies
56
56
  @dependencies ||= begin
57
- deps = all_dependencies.reject {|dep| ignorable_dependency? dep }
58
- missing = deps.reject {|dep| all_spec_names.include? dep.name }
59
- unless missing.empty?
60
- raise Bundler::LockfileError, "Your Gemfile.lock is corrupt. The following #{missing.size > 1 ? "gems are" : "gem is"} missing " \
61
- "from the DEPENDENCIES section: '#{missing.map(&:name).join('\' \'')}'"
62
- end
63
- deps
57
+ all_dependencies.reject {|dep| ignorable_dependency? dep }
64
58
  end
65
59
  end
66
60
 
61
+ def missing_lockfile_dependencies(all_spec_names)
62
+ deps = all_dependencies.reject {|dep| ignorable_dependency? dep }
63
+ deps.reject {|dep| all_spec_names.include? dep.name }
64
+ end
65
+
67
66
  # Represents all dependencies
68
67
  def all_dependencies
69
68
  @spec.dependencies
@@ -79,6 +78,8 @@ module Bundler
79
78
  [Bundler.settings[:jobs].to_i - 1, 1].max
80
79
  end
81
80
 
81
+ attr_reader :size
82
+
82
83
  def initialize(installer, all_specs, size, standalone, force)
83
84
  @installer = installer
84
85
  @size = size
@@ -88,6 +89,11 @@ module Bundler
88
89
  end
89
90
 
90
91
  def call
92
+ # Since `autoload` has the potential for threading issues on 1.8.7
93
+ # TODO: remove in bundler 2.0
94
+ require "bundler/gem_remote_fetcher" if RUBY_VERSION < "1.9"
95
+
96
+ check_for_corrupt_lockfile
91
97
  enqueue_specs
92
98
  process_specs until @specs.all?(&:installed?) || @specs.any?(&:failed?)
93
99
  handle_error if @specs.any?(&:failed?)
@@ -131,6 +137,31 @@ module Bundler
131
137
  raise Bundler::InstallError, errors.map(&:to_s).join("\n\n")
132
138
  end
133
139
 
140
+ def check_for_corrupt_lockfile
141
+ missing_dependencies = @specs.map do |s|
142
+ [
143
+ s,
144
+ s.missing_lockfile_dependencies(@specs.map(&:name)),
145
+ ]
146
+ end.reject { |a| a.last.empty? }
147
+ return if missing_dependencies.empty?
148
+
149
+ warning = []
150
+ warning << "Your lockfile was created by an old Bundler that left some things out."
151
+ if @size != 1
152
+ warning << "Because of the missing DEPENDENCIES, we can only install gems one at a time, instead of installing #{@size} at a time."
153
+ @size = 1
154
+ end
155
+ warning << "You can fix this by adding the missing gems to your Gemfile, running bundle install, and then removing the gems from your Gemfile."
156
+ warning << "The missing gems are:"
157
+
158
+ missing_dependencies.each do |spec, missing|
159
+ warning << "* #{missing.map(&:name).join(", ")} depended upon by #{spec.name}"
160
+ end
161
+
162
+ Bundler.ui.warn(warning.join("\n"))
163
+ end
164
+
134
165
  # Keys in the remains hash represent uninstalled gems specs.
135
166
  # We enqueue all gem specs that do not have any dependencies.
136
167
  # Later we call this lambda again to install specs that depended on
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require "strscan"
3
2
 
4
3
  # Some versions of the Bundler 1.1 RC series introduced corrupted
5
4
  # lockfiles. There were two major problems:
@@ -6,10 +6,18 @@ module Bundler
6
6
  include GemHelpers
7
7
 
8
8
  def match_platform(p)
9
- Gem::Platform::RUBY == platform ||
10
- platform.nil? || p == platform ||
11
- generic(Gem::Platform.new(platform)) === p ||
12
- Gem::Platform.new(platform) === p
9
+ MatchPlatform.platforms_match?(platform, p)
10
+ end
11
+
12
+ def self.platforms_match?(gemspec_platform, local_platform)
13
+ return true if gemspec_platform.nil?
14
+ return true if Gem::Platform::RUBY == gemspec_platform
15
+ return true if local_platform == gemspec_platform
16
+ gemspec_platform = Gem::Platform.new(gemspec_platform)
17
+ return true if GemHelpers.generic(gemspec_platform) === local_platform
18
+ return true if gemspec_platform === local_platform
19
+
20
+ false
13
21
  end
14
22
  end
15
23
  end
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require "bundler/plugin/api/source"
3
2
 
4
3
  module Bundler
5
4
  # This is the interfacing class represents the API that we intend to provide
@@ -24,6 +23,8 @@ module Bundler
24
23
  # and hooks).
25
24
  module Plugin
26
25
  class API
26
+ autoload :Source, "bundler/plugin/api/source"
27
+
27
28
  # The plugins should declare that they handle a command through this helper.
28
29
  #
29
30
  # @param [String] command being handled by them
@@ -93,7 +93,7 @@ module Bundler
93
93
  # It should be called in `install` after the plugin is done placing the
94
94
  # gem at correct install location.
95
95
  #
96
- # It also runs Gem hooks `post_install`, `post_build` and `post_install`
96
+ # It also runs Gem hooks `pre_install`, `post_build` and `post_install`
97
97
  #
98
98
  # Note: Do not override if you don't know what you are doing.
99
99
  def post_install(spec, disable_exts = false)
@@ -8,11 +8,11 @@ environment = BundlerVendoredPostIt::PostIt::Environment.new([])
8
8
  version = Gem::Requirement.new(environment.bundler_version)
9
9
  if version.requirements.size == 1 && version.requirements.first.first == "=" # version.exact?
10
10
  if version.requirements.first.last.segments.first >= 2
11
- ENV["BUNDLE_ENABLE_TRAMPOLINE"] = "true"
11
+ ENV["BUNDLE_TRAMPOLINE_FORCE"] = "true"
12
12
  end
13
13
  end
14
14
 
15
- if ENV["BUNDLE_ENABLE_TRAMPOLINE"] && !ENV["BUNDLE_DISABLE_POSTIT"]
15
+ if ENV["BUNDLE_TRAMPOLINE_FORCE"] && !ENV["BUNDLE_TRAMPOLINE_DISABLE"]
16
16
  installed_version =
17
17
  if defined?(Bundler::VERSION)
18
18
  Bundler::VERSION
@@ -70,4 +70,4 @@ You're running Bundler #{installed_version} but this project uses #{running_vers
70
70
  abort "The running bundler (#{running_version}) does not match the required `#{version}`"
71
71
  end
72
72
 
73
- end # if ENV["BUNDLE_ENABLE_TRAMPOLINE"] && !ENV["BUNDLE_DISABLE_POSTIT"]
73
+ end # if ENV["BUNDLE_TRAMPOLINE_FORCE"] && !ENV["BUNDLE_TRAMPOLINE_DISABLE"]
@@ -365,8 +365,13 @@ module Bundler
365
365
  "Source does not contain any versions of '#{requirement}'"
366
366
  end
367
367
  else
368
+ cache_message = begin
369
+ " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
370
+ rescue GemfileNotFound
371
+ nil
372
+ end
368
373
  message = "Could not find gem '#{requirement}' in any of the gem sources " \
369
- "listed in your Gemfile or available on this machine."
374
+ "listed in your Gemfile#{cache_message}."
370
375
  end
371
376
  raise GemNotFound, message
372
377
  end