bundler 2.2.0.rc.1 → 2.2.0.rc.2

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.

Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +725 -687
  3. data/lib/bundler.rb +6 -3
  4. data/lib/bundler/build_metadata.rb +3 -11
  5. data/lib/bundler/cli.rb +27 -14
  6. data/lib/bundler/cli/add.rb +1 -1
  7. data/lib/bundler/cli/cache.rb +1 -7
  8. data/lib/bundler/cli/clean.rb +1 -1
  9. data/lib/bundler/cli/common.rb +14 -0
  10. data/lib/bundler/cli/doctor.rb +1 -1
  11. data/lib/bundler/cli/exec.rb +1 -1
  12. data/lib/bundler/cli/fund.rb +36 -0
  13. data/lib/bundler/cli/gem.rb +1 -1
  14. data/lib/bundler/cli/info.rb +2 -1
  15. data/lib/bundler/cli/init.rb +1 -1
  16. data/lib/bundler/cli/inject.rb +1 -1
  17. data/lib/bundler/cli/install.rb +4 -2
  18. data/lib/bundler/cli/list.rb +1 -1
  19. data/lib/bundler/cli/outdated.rb +1 -1
  20. data/lib/bundler/cli/pristine.rb +1 -1
  21. data/lib/bundler/cli/show.rb +1 -1
  22. data/lib/bundler/cli/update.rb +2 -0
  23. data/lib/bundler/compact_index_client.rb +1 -1
  24. data/lib/bundler/compact_index_client/cache.rb +1 -1
  25. data/lib/bundler/definition.rb +28 -37
  26. data/lib/bundler/dep_proxy.rb +1 -1
  27. data/lib/bundler/dsl.rb +4 -4
  28. data/lib/bundler/endpoint_specification.rb +1 -1
  29. data/lib/bundler/fetcher.rb +3 -3
  30. data/lib/bundler/fetcher/base.rb +1 -1
  31. data/lib/bundler/fetcher/compact_index.rb +1 -1
  32. data/lib/bundler/fetcher/downloader.rb +1 -1
  33. data/lib/bundler/fetcher/index.rb +1 -1
  34. data/lib/bundler/friendly_errors.rb +3 -3
  35. data/lib/bundler/gem_helper.rb +17 -9
  36. data/lib/bundler/gem_helpers.rb +6 -1
  37. data/lib/bundler/gem_version_promoter.rb +1 -1
  38. data/lib/bundler/graph.rb +1 -1
  39. data/lib/bundler/index.rb +1 -1
  40. data/lib/bundler/injector.rb +1 -1
  41. data/lib/bundler/installer.rb +1 -1
  42. data/lib/bundler/installer/gem_installer.rb +1 -1
  43. data/lib/bundler/installer/parallel_installer.rb +1 -1
  44. data/lib/bundler/installer/standalone.rb +2 -2
  45. data/lib/bundler/lazy_specification.rb +3 -3
  46. data/lib/bundler/lockfile_generator.rb +1 -1
  47. data/lib/bundler/lockfile_parser.rb +1 -1
  48. data/lib/bundler/mirror.rb +2 -2
  49. data/lib/bundler/plugin.rb +5 -6
  50. data/lib/bundler/plugin/index.rb +1 -1
  51. data/lib/bundler/plugin/installer.rb +1 -1
  52. data/lib/bundler/plugin/installer/rubygems.rb +1 -1
  53. data/lib/bundler/plugin/source_list.rb +1 -1
  54. data/lib/bundler/remote_specification.rb +1 -1
  55. data/lib/bundler/resolver.rb +4 -4
  56. data/lib/bundler/resolver/spec_group.rb +2 -2
  57. data/lib/bundler/retry.rb +1 -1
  58. data/lib/bundler/ruby_version.rb +1 -1
  59. data/lib/bundler/rubygems_ext.rb +46 -1
  60. data/lib/bundler/rubygems_gem_installer.rb +2 -2
  61. data/lib/bundler/rubygems_integration.rb +18 -6
  62. data/lib/bundler/runtime.rb +2 -2
  63. data/lib/bundler/settings.rb +49 -42
  64. data/lib/bundler/shared_helpers.rb +1 -1
  65. data/lib/bundler/similarity_detector.rb +1 -1
  66. data/lib/bundler/source.rb +1 -1
  67. data/lib/bundler/source/git.rb +1 -1
  68. data/lib/bundler/source/git/git_proxy.rb +4 -2
  69. data/lib/bundler/source/path.rb +2 -2
  70. data/lib/bundler/source/path/installer.rb +1 -1
  71. data/lib/bundler/source/rubygems.rb +2 -2
  72. data/lib/bundler/source/rubygems/remote.rb +1 -1
  73. data/lib/bundler/source_list.rb +2 -2
  74. data/lib/bundler/spec_set.rb +1 -1
  75. data/lib/bundler/stub_specification.rb +1 -1
  76. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  77. data/lib/bundler/templates/newgem/bin/console.tt +1 -2
  78. data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
  79. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +0 -1
  80. data/lib/bundler/ui/shell.rb +5 -5
  81. data/lib/bundler/uri_credentials_filter.rb +1 -1
  82. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +7 -4
  83. data/lib/bundler/vendored_persistent.rb +0 -7
  84. data/lib/bundler/version.rb +1 -1
  85. data/lib/bundler/worker.rb +1 -1
  86. data/lib/bundler/yaml_serializer.rb +1 -1
  87. data/man/bundle-add.1 +1 -1
  88. data/man/{bundle-add.ronn → bundle-add.1.ronn} +0 -0
  89. data/man/bundle-binstubs.1 +5 -3
  90. data/man/{bundle-binstubs.ronn → bundle-binstubs.1.ronn} +2 -4
  91. data/man/bundle-cache.1 +1 -1
  92. data/man/{bundle-cache.ronn → bundle-cache.1.ronn} +0 -0
  93. data/man/bundle-check.1 +1 -1
  94. data/man/{bundle-check.ronn → bundle-check.1.ronn} +0 -0
  95. data/man/bundle-clean.1 +1 -1
  96. data/man/{bundle-clean.ronn → bundle-clean.1.ronn} +0 -0
  97. data/man/bundle-config.1 +14 -14
  98. data/man/{bundle-config.ronn → bundle-config.1.ronn} +14 -13
  99. data/man/bundle-doctor.1 +1 -1
  100. data/man/{bundle-doctor.ronn → bundle-doctor.1.ronn} +0 -0
  101. data/man/bundle-exec.1 +1 -1
  102. data/man/{bundle-exec.ronn → bundle-exec.1.ronn} +0 -0
  103. data/man/bundle-gem.1 +1 -1
  104. data/man/{bundle-gem.ronn → bundle-gem.1.ronn} +0 -0
  105. data/man/bundle-info.1 +1 -1
  106. data/man/{bundle-info.ronn → bundle-info.1.ronn} +0 -0
  107. data/man/bundle-init.1 +1 -1
  108. data/man/{bundle-init.ronn → bundle-init.1.ronn} +0 -0
  109. data/man/bundle-inject.1 +1 -1
  110. data/man/{bundle-inject.ronn → bundle-inject.1.ronn} +0 -0
  111. data/man/bundle-install.1 +29 -2
  112. data/man/{bundle-install.ronn → bundle-install.1.ronn} +24 -2
  113. data/man/bundle-list.1 +1 -1
  114. data/man/{bundle-list.ronn → bundle-list.1.ronn} +0 -0
  115. data/man/bundle-lock.1 +1 -1
  116. data/man/{bundle-lock.ronn → bundle-lock.1.ronn} +0 -0
  117. data/man/bundle-open.1 +1 -1
  118. data/man/{bundle-open.ronn → bundle-open.1.ronn} +0 -0
  119. data/man/bundle-outdated.1 +1 -1
  120. data/man/{bundle-outdated.ronn → bundle-outdated.1.ronn} +0 -0
  121. data/man/bundle-platform.1 +1 -1
  122. data/man/{bundle-platform.ronn → bundle-platform.1.ronn} +0 -0
  123. data/man/bundle-pristine.1 +1 -1
  124. data/man/{bundle-pristine.ronn → bundle-pristine.1.ronn} +0 -0
  125. data/man/bundle-remove.1 +1 -1
  126. data/man/{bundle-remove.ronn → bundle-remove.1.ronn} +0 -0
  127. data/man/bundle-show.1 +1 -1
  128. data/man/{bundle-show.ronn → bundle-show.1.ronn} +0 -0
  129. data/man/bundle-update.1 +1 -1
  130. data/man/{bundle-update.ronn → bundle-update.1.ronn} +0 -0
  131. data/man/bundle-viz.1 +1 -1
  132. data/man/{bundle-viz.ronn → bundle-viz.1.ronn} +0 -0
  133. data/man/bundle.1 +1 -1
  134. data/man/{bundle.ronn → bundle.1.ronn} +0 -0
  135. data/man/gemfile.5 +4 -4
  136. data/man/gemfile.5.ronn +4 -4
  137. metadata +28 -53
  138. data/man/bundle-add.1.txt +0 -58
  139. data/man/bundle-binstubs.1.txt +0 -48
  140. data/man/bundle-cache.1.txt +0 -78
  141. data/man/bundle-check.1.txt +0 -33
  142. data/man/bundle-clean.1.txt +0 -26
  143. data/man/bundle-config.1.txt +0 -527
  144. data/man/bundle-doctor.1.txt +0 -44
  145. data/man/bundle-exec.1.txt +0 -181
  146. data/man/bundle-gem.1.txt +0 -117
  147. data/man/bundle-info.1.txt +0 -21
  148. data/man/bundle-init.1.txt +0 -34
  149. data/man/bundle-inject.1.txt +0 -32
  150. data/man/bundle-install.1.txt +0 -401
  151. data/man/bundle-list.1.txt +0 -44
  152. data/man/bundle-lock.1.txt +0 -93
  153. data/man/bundle-open.1.txt +0 -29
  154. data/man/bundle-outdated.1.txt +0 -131
  155. data/man/bundle-platform.1.txt +0 -57
  156. data/man/bundle-pristine.1.txt +0 -44
  157. data/man/bundle-remove.1.txt +0 -34
  158. data/man/bundle-show.1.txt +0 -27
  159. data/man/bundle-update.1.txt +0 -391
  160. data/man/bundle-viz.1.txt +0 -39
  161. data/man/bundle.1.txt +0 -116
  162. data/man/gemfile.5.txt +0 -651
  163. data/man/index.txt +0 -25
@@ -39,7 +39,7 @@ module Bundler
39
39
  s
40
40
  end
41
41
 
42
- private
42
+ private
43
43
 
44
44
  def method_missing(*args, &blk)
45
45
  @dep.send(*args, &blk)
@@ -63,7 +63,7 @@ module Bundler
63
63
  development_group = opts[:development_group] || :development
64
64
  expanded_path = gemfile_root.join(path)
65
65
 
66
- gemspecs = Dir[File.join(expanded_path, "{,*}.gemspec")].map {|g| Bundler.load_gemspec(g) }.compact
66
+ gemspecs = Gem::Util.glob_files_in_dir("{,*}.gemspec", expanded_path).map {|g| Bundler.load_gemspec(g) }.compact
67
67
  gemspecs.reject! {|s| s.name != name } if name
68
68
  Index.sort_specs(gemspecs)
69
69
  specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] }
@@ -279,7 +279,7 @@ module Bundler
279
279
  raise GemfileError, "Undefined local variable or method `#{name}' for Gemfile"
280
280
  end
281
281
 
282
- private
282
+ private
283
283
 
284
284
  def add_git_sources
285
285
  git_source(:github) do |repo_name|
@@ -457,7 +457,7 @@ repo_name ||= user_name
457
457
  "Using `source` more than once without a block is a security risk, and " \
458
458
  "may result in installing unexpected gems. To resolve this warning, use " \
459
459
  "a block to indicate which gems should come from the secondary source. " \
460
- "To upgrade this warning to an error, run `bundle config set " \
460
+ "To upgrade this warning to an error, run `bundle config set --local " \
461
461
  "disable_multisource true`."
462
462
  end
463
463
  end
@@ -567,7 +567,7 @@ The :#{name} git source is deprecated, and will be removed in the future.#{addit
567
567
  end
568
568
  end
569
569
 
570
- private
570
+ private
571
571
 
572
572
  def parse_line_number_from_description
573
573
  description = self.description
@@ -104,7 +104,7 @@ module Bundler
104
104
  @remote_specification = spec
105
105
  end
106
106
 
107
- private
107
+ private
108
108
 
109
109
  def local_specification_path
110
110
  "#{base_dir}/specifications/#{full_name}.gemspec"
@@ -47,7 +47,7 @@ module Bundler
47
47
  remote_uri = filter_uri(remote_uri)
48
48
  super "Authentication is required for #{remote_uri}.\n" \
49
49
  "Please supply credentials for this source. You can do this by running:\n" \
50
- " bundle config set #{remote_uri} username:password"
50
+ " bundle config set --global #{remote_uri} username:password"
51
51
  end
52
52
  end
53
53
  # This error is raised if HTTP authentication is provided, but incorrect.
@@ -216,7 +216,7 @@ module Bundler
216
216
  "#<#{self.class}:0x#{object_id} uri=#{uri}>"
217
217
  end
218
218
 
219
- private
219
+ private
220
220
 
221
221
  FETCHERS = [CompactIndex, Dependency, Index].freeze
222
222
 
@@ -303,7 +303,7 @@ module Bundler
303
303
  store
304
304
  end
305
305
 
306
- private
306
+ private
307
307
 
308
308
  def remote_uri
309
309
  @remote.uri
@@ -38,7 +38,7 @@ module Bundler
38
38
  false
39
39
  end
40
40
 
41
- private
41
+ private
42
42
 
43
43
  def log_specs(debug_msg)
44
44
  if Bundler.ui.debug?
@@ -83,7 +83,7 @@ module Bundler
83
83
  true
84
84
  end
85
85
 
86
- private
86
+ private
87
87
 
88
88
  def compact_index_client
89
89
  @compact_index_client ||=
@@ -74,7 +74,7 @@ module Bundler
74
74
  end
75
75
  end
76
76
 
77
- private
77
+ private
78
78
 
79
79
  def validate_uri_scheme!(uri)
80
80
  return if uri.scheme =~ /\Ahttps?\z/
@@ -42,7 +42,7 @@ module Bundler
42
42
  "Your network or your gem server is probably having issues right now."
43
43
  end
44
44
 
45
- private
45
+ private
46
46
 
47
47
  # cached gem specification path, if one exists
48
48
  def gemspec_cached_path(spec_file_name)
@@ -4,7 +4,7 @@ require_relative "vendored_thor"
4
4
 
5
5
  module Bundler
6
6
  module FriendlyErrors
7
- module_function
7
+ module_function
8
8
 
9
9
  def log_error(error)
10
10
  case error
@@ -51,7 +51,7 @@ module Bundler
51
51
  end
52
52
 
53
53
  def request_issue_report_for(e)
54
- Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
54
+ Bundler.ui.error <<-EOS.gsub(/^ {8}/, ""), nil, nil
55
55
  --- ERROR REPORT TEMPLATE -------------------------------------------------------
56
56
  # Error Report
57
57
 
@@ -94,7 +94,7 @@ module Bundler
94
94
 
95
95
  Bundler.ui.error "Unfortunately, an unexpected error occurred, and Bundler cannot continue."
96
96
 
97
- Bundler.ui.warn <<-EOS.gsub(/^ {8}/, "")
97
+ Bundler.ui.error <<-EOS.gsub(/^ {8}/, ""), nil, :yellow
98
98
 
99
99
  First, try this link to see if there are any existing issue reports for this error:
100
100
  #{issues_url(e)}
@@ -32,7 +32,7 @@ module Bundler
32
32
 
33
33
  def initialize(base = nil, name = nil)
34
34
  @base = File.expand_path(base || SharedHelpers.pwd)
35
- gemspecs = name ? [File.join(@base, "#{name}.gemspec")] : Dir[File.join(@base, "{,*}.gemspec")]
35
+ gemspecs = name ? [File.join(@base, "#{name}.gemspec")] : Gem::Util.glob_files_in_dir("{,*}.gemspec", @base)
36
36
  raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1
37
37
  @spec_path = gemspecs.first
38
38
  @gemspec = Bundler.load_gemspec(@spec_path)
@@ -100,27 +100,35 @@ module Bundler
100
100
  Bundler.ui.confirm "#{name} (#{version}) installed."
101
101
  end
102
102
 
103
- protected
103
+ protected
104
104
 
105
105
  def rubygem_push(path)
106
106
  cmd = [*gem_command, "push", path]
107
107
  cmd << "--key" << gem_key if gem_key
108
108
  cmd << "--host" << allowed_push_host if allowed_push_host
109
- unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
110
- raise "Your rubygems.org credentials aren't set. Run `gem signin` to set them."
111
- end
112
109
  sh_with_input(cmd)
113
110
  Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
114
111
  end
115
112
 
116
113
  def built_gem_path
117
- Dir[File.join(base, "#{name}-*.gem")].sort_by {|f| File.mtime(f) }.last
114
+ Gem::Util.glob_files_in_dir("#{name}-*.gem", base).sort_by {|f| File.mtime(f) }.last
118
115
  end
119
116
 
120
- def git_push(remote = "")
117
+ def git_push(remote = nil)
118
+ remote ||= default_remote
121
119
  perform_git_push remote
122
- perform_git_push "#{remote} --tags"
123
- Bundler.ui.confirm "Pushed git commits and tags."
120
+ perform_git_push "#{remote} #{version_tag}"
121
+ Bundler.ui.confirm "Pushed git commits and release tag."
122
+ end
123
+
124
+ def default_remote
125
+ current_branch = sh(%w[git rev-parse --abbrev-ref HEAD]).strip
126
+ return "origin" if current_branch.empty?
127
+
128
+ remote_for_branch = sh(%W[git config --get branch.#{current_branch}.remote]).strip
129
+ return "origin" if remote_for_branch.empty?
130
+
131
+ remote_for_branch
124
132
  end
125
133
 
126
134
  def allowed_push_host
@@ -24,10 +24,15 @@ module Bundler
24
24
  module_function :generic
25
25
 
26
26
  def generic_local_platform
27
- generic(Bundler.local_platform)
27
+ generic(local_platform)
28
28
  end
29
29
  module_function :generic_local_platform
30
30
 
31
+ def local_platform
32
+ Bundler.local_platform
33
+ end
34
+ module_function :local_platform
35
+
31
36
  def platform_specificity_match(spec_platform, user_platform)
32
37
  spec_platform = Gem::Platform.new(spec_platform)
33
38
  return PlatformMatch::EXACT_MATCH if spec_platform == user_platform
@@ -98,7 +98,7 @@ module Bundler
98
98
  level == :minor
99
99
  end
100
100
 
101
- private
101
+ private
102
102
 
103
103
  def filter_dep_specs(spec_groups, locked_spec)
104
104
  res = spec_groups.select do |spec_group|
@@ -27,7 +27,7 @@ module Bundler
27
27
  GraphVizClient.new(self).run
28
28
  end
29
29
 
30
- private
30
+ private
31
31
 
32
32
  def _populate_relations
33
33
  parent_dependencies = _groups.values.to_set.flatten
@@ -179,7 +179,7 @@ module Bundler
179
179
  @sources.uniq! # need to use uniq! here instead of checking for the item before adding
180
180
  end
181
181
 
182
- private
182
+ private
183
183
 
184
184
  def specs_by_name(name)
185
185
  @specs[name].values
@@ -74,7 +74,7 @@ module Bundler
74
74
  end
75
75
  end
76
76
 
77
- private
77
+ private
78
78
 
79
79
  def conservative_version(spec)
80
80
  version = spec.version
@@ -196,7 +196,7 @@ module Bundler
196
196
  end
197
197
  end
198
198
 
199
- private
199
+ private
200
200
 
201
201
  # the order that the resolver provides is significant, since
202
202
  # dependencies might affect the installation of a gem.
@@ -27,7 +27,7 @@ module Bundler
27
27
  return false, specific_failure_message(e)
28
28
  end
29
29
 
30
- private
30
+ private
31
31
 
32
32
  def specific_failure_message(e)
33
33
  message = "#{e.class}: #{e.message}\n"
@@ -130,7 +130,7 @@ module Bundler
130
130
  Bundler.ui.warn(warning.join("\n"))
131
131
  end
132
132
 
133
- private
133
+ private
134
134
 
135
135
  def failed_specs
136
136
  @specs.select(&:failed?)
@@ -16,12 +16,12 @@ module Bundler
16
16
  file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
17
17
  file.puts "path = File.expand_path('..', __FILE__)"
18
18
  paths.each do |path|
19
- file.puts %($:.unshift "\#{path}/#{path}")
19
+ file.puts %($:.unshift File.expand_path("\#{path}/#{path}"))
20
20
  end
21
21
  end
22
22
  end
23
23
 
24
- private
24
+ private
25
25
 
26
26
  def paths
27
27
  @specs.map do |spec|
@@ -12,7 +12,7 @@ module Bundler
12
12
  [name, version, platform_string] <=> [other.name, other.version, other.platform_string]
13
13
  end
14
14
 
15
- protected
15
+ protected
16
16
 
17
17
  def platform_string
18
18
  platform_string = platform.to_s
@@ -89,7 +89,7 @@ module Bundler
89
89
  if search && Gem::Platform.new(search.platform) != platform_object && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
90
90
  Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
91
91
  "because it has different dependencies from the #{platform} version. " \
92
- "To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again."
92
+ "To use the platform-specific version of the gem, run `bundle config set --local specific_platform true` and install again."
93
93
  search = source.specs.search(self).last
94
94
  end
95
95
  search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
@@ -118,7 +118,7 @@ module Bundler
118
118
  " #{source.revision[0..6]}"
119
119
  end
120
120
 
121
- private
121
+ private
122
122
 
123
123
  def to_ary
124
124
  nil
@@ -25,7 +25,7 @@ module Bundler
25
25
  out
26
26
  end
27
27
 
28
- private
28
+ private
29
29
 
30
30
  def add_sources
31
31
  definition.send(:sources).lock_sources.each_with_index do |source, idx|
@@ -109,7 +109,7 @@ module Bundler
109
109
  "bundler:#{bundler_version}#{prerelease_text}`.\n"
110
110
  end
111
111
 
112
- private
112
+ private
113
113
 
114
114
  TYPES = {
115
115
  GIT => Bundler::Source::Git,
@@ -43,7 +43,7 @@ module Bundler
43
43
  config.update_mirror(mirror)
44
44
  end
45
45
 
46
- private
46
+ private
47
47
 
48
48
  def fetch_valid_mirror_for(uri)
49
49
  downcased = uri.to_s.downcase
@@ -158,7 +158,7 @@ module Bundler
158
158
  end
159
159
  end
160
160
 
161
- private
161
+ private
162
162
 
163
163
  def wait_for_writtable_socket(socket, address, timeout)
164
164
  if IO.select(nil, [socket], nil, timeout)
@@ -16,7 +16,7 @@ module Bundler
16
16
 
17
17
  PLUGIN_FILE_NAME = "plugins.rb".freeze
18
18
 
19
- module_function
19
+ module_function
20
20
 
21
21
  def reset!
22
22
  instance_variables.each {|i| remove_instance_variable(i) }
@@ -39,12 +39,11 @@ module Bundler
39
39
 
40
40
  save_plugins names, specs
41
41
  rescue PluginError => e
42
- if specs
43
- specs_to_delete = Hash[specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }]
44
- specs_to_delete.values.each {|spec| Bundler.rm_rf(spec.full_gem_path) }
45
- end
42
+ specs_to_delete = specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }
43
+ specs_to_delete.each_value {|spec| Bundler.rm_rf(spec.full_gem_path) }
46
44
 
47
- Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
45
+ names_list = names.map {|name| "`#{name}`" }.join(", ")
46
+ Bundler.ui.error "Failed to install the following plugins: #{names_list}. The underlying error was: #{e.message}.\n #{e.backtrace.join("\n ")}"
48
47
  end
49
48
 
50
49
  # Uninstalls plugins by the given names
@@ -133,7 +133,7 @@ module Bundler
133
133
  @hooks[event] || []
134
134
  end
135
135
 
136
- private
136
+ private
137
137
 
138
138
  # Reads the index file from the directory and initializes the instance
139
139
  # variables.
@@ -41,7 +41,7 @@ module Bundler
41
41
  install_from_specs specs
42
42
  end
43
43
 
44
- private
44
+ private
45
45
 
46
46
  def check_sources_consistency!(options)
47
47
  if options.key?(:git) && options.key?(:local_git)
@@ -8,7 +8,7 @@ module Bundler
8
8
  "#{spec.name} #{spec.version}"
9
9
  end
10
10
 
11
- private
11
+ private
12
12
 
13
13
  def requires_sudo?
14
14
  false # Will change on implementation of project level plugins
@@ -17,7 +17,7 @@ module Bundler
17
17
  path_sources + git_sources + rubygems_sources + [metadata_source]
18
18
  end
19
19
 
20
- private
20
+ private
21
21
 
22
22
  def rubygems_aggregate_class
23
23
  Plugin::Installer::Rubygems
@@ -91,7 +91,7 @@ module Bundler
91
91
  " #{source.revision[0..6]}"
92
92
  end
93
93
 
94
- private
94
+ private
95
95
 
96
96
  def to_ary
97
97
  nil
@@ -158,10 +158,10 @@ module Bundler
158
158
  # spec group.
159
159
  sg_ruby = sg.copy_for(Gem::Platform::RUBY)
160
160
  selected_sgs << sg_ruby if sg_ruby
161
- sg_all_platforms = nil
162
161
  all_platforms = @platforms + [platform]
163
- sorted_all_platforms = self.class.sort_platforms(all_platforms)
164
- sorted_all_platforms.reverse_each do |other_platform|
162
+ next if all_platforms.to_a == [Gem::Platform::RUBY]
163
+ sg_all_platforms = nil
164
+ self.class.sort_platforms(all_platforms).reverse_each do |other_platform|
165
165
  if sg_all_platforms.nil?
166
166
  sg_all_platforms = sg.copy_for(other_platform)
167
167
  else
@@ -250,7 +250,7 @@ module Bundler
250
250
  ["00", *platform.to_a.map {|part| part || "" }]
251
251
  end
252
252
 
253
- private
253
+ private
254
254
 
255
255
  # returns an integer \in (-\infty, 0]
256
256
  # a number closer to 0 means the dependency is less constraining