rubygems-update 3.2.9 → 3.2.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -0
  3. data/Manifest.txt +1 -0
  4. data/Rakefile +6 -0
  5. data/bundler/CHANGELOG.md +49 -0
  6. data/bundler/lib/bundler/build_metadata.rb +2 -2
  7. data/bundler/lib/bundler/cli/gem.rb +23 -17
  8. data/bundler/lib/bundler/compact_index_client/updater.rb +1 -1
  9. data/bundler/lib/bundler/definition.rb +43 -26
  10. data/bundler/lib/bundler/dsl.rb +36 -25
  11. data/bundler/lib/bundler/inline.rb +1 -0
  12. data/bundler/lib/bundler/installer.rb +2 -0
  13. data/bundler/lib/bundler/installer/parallel_installer.rb +6 -8
  14. data/bundler/lib/bundler/lockfile_parser.rb +3 -13
  15. data/bundler/lib/bundler/man/bundle-config.1 +4 -4
  16. data/bundler/lib/bundler/man/bundle-config.1.ronn +8 -7
  17. data/bundler/lib/bundler/plugin.rb +1 -0
  18. data/bundler/lib/bundler/plugin/api/source.rb +7 -0
  19. data/bundler/lib/bundler/plugin/installer.rb +8 -10
  20. data/bundler/lib/bundler/plugin/source_list.rb +4 -0
  21. data/bundler/lib/bundler/resolver.rb +36 -38
  22. data/bundler/lib/bundler/rubygems_gem_installer.rb +47 -0
  23. data/bundler/lib/bundler/source.rb +6 -0
  24. data/bundler/lib/bundler/source/metadata.rb +0 -4
  25. data/bundler/lib/bundler/source/rubygems.rb +20 -4
  26. data/bundler/lib/bundler/source_list.rb +27 -20
  27. data/bundler/lib/bundler/spec_set.rb +2 -0
  28. data/bundler/lib/bundler/stub_specification.rb +8 -0
  29. data/bundler/lib/bundler/templates/newgem/README.md.tt +5 -3
  30. data/bundler/lib/bundler/version.rb +1 -1
  31. data/lib/rubygems.rb +1 -1
  32. data/lib/rubygems/command.rb +1 -0
  33. data/lib/rubygems/config_file.rb +9 -0
  34. data/lib/rubygems/core_ext/tcpsocket_init.rb +52 -0
  35. data/lib/rubygems/remote_fetcher.rb +4 -8
  36. data/lib/rubygems/specification.rb +3 -0
  37. data/rubygems-update.gemspec +1 -1
  38. data/test/rubygems/test_gem.rb +2 -8
  39. data/test/rubygems/test_gem_config_file.rb +10 -0
  40. data/test/rubygems/test_gem_remote_fetcher.rb +44 -0
  41. metadata +4 -3
@@ -50,6 +50,7 @@ def gemfile(install = false, options = {}, &gemfile)
50
50
  Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
51
51
  builder = Bundler::Dsl.new
52
52
  builder.instance_eval(&gemfile)
53
+ builder.check_primary_source_safety
53
54
 
54
55
  Bundler.settings.temporary(:frozen => false) do
55
56
  definition = builder.to_definition(nil, true)
@@ -89,6 +89,8 @@ module Bundler
89
89
  end
90
90
  install(options)
91
91
 
92
+ Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
93
+
92
94
  lock unless Bundler.frozen_bundle?
93
95
  Standalone.new(options[:standalone], @definition).generate if options[:standalone]
94
96
  end
@@ -27,13 +27,8 @@ module Bundler
27
27
  state == :failed
28
28
  end
29
29
 
30
- def installation_attempted?
31
- installed? || failed?
32
- end
33
-
34
- # Only true when spec in neither installed nor already enqueued
35
30
  def ready_to_enqueue?
36
- !enqueued? && !installation_attempted?
31
+ state == :none
37
32
  end
38
33
 
39
34
  def has_post_install_message?
@@ -93,6 +88,11 @@ module Bundler
93
88
  def call
94
89
  check_for_corrupt_lockfile
95
90
 
91
+ if @rake
92
+ do_install(@rake, 0)
93
+ Gem::Specification.reset
94
+ end
95
+
96
96
  if @size > 1
97
97
  install_with_worker
98
98
  else
@@ -217,8 +217,6 @@ module Bundler
217
217
  # are installed.
218
218
  def enqueue_specs
219
219
  @specs.select(&:ready_to_enqueue?).each do |spec|
220
- next if @rake && !@rake.installed? && spec.name != @rake.name
221
-
222
220
  if spec.dependencies_installed? @specs
223
221
  spec.state = :enqueued
224
222
  worker_pool.enq spec
@@ -64,8 +64,6 @@ module Bundler
64
64
  @state = nil
65
65
  @specs = {}
66
66
 
67
- @rubygems_aggregate = Source::Rubygems.new
68
-
69
67
  if lockfile.match(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/)
70
68
  raise LockfileError, "Your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} contains merge conflicts.\n" \
71
69
  "Run `git checkout HEAD -- #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` first to get a clean lock."
@@ -89,7 +87,6 @@ module Bundler
89
87
  send("parse_#{@state}", line)
90
88
  end
91
89
  end
92
- @sources << @rubygems_aggregate unless Bundler.feature_flag.disable_multisource?
93
90
  @specs = @specs.values.sort_by(&:identifier)
94
91
  warn_for_outdated_bundler_version
95
92
  rescue ArgumentError => e
@@ -134,16 +131,9 @@ module Bundler
134
131
  @sources << @current_source
135
132
  end
136
133
  when GEM
137
- if Bundler.feature_flag.disable_multisource?
138
- @opts["remotes"] = @opts.delete("remote")
139
- @current_source = TYPES[@type].from_lock(@opts)
140
- @sources << @current_source
141
- else
142
- Array(@opts["remote"]).each do |url|
143
- @rubygems_aggregate.add_remote(url)
144
- end
145
- @current_source = @rubygems_aggregate
146
- end
134
+ @opts["remotes"] = Array(@opts.delete("remote")).reverse
135
+ @current_source = TYPES[@type].from_lock(@opts)
136
+ @sources << @current_source
147
137
  when PLUGIN
148
138
  @current_source = Plugin.source_from_lock(@opts)
149
139
  @sources << @current_source
@@ -211,10 +211,10 @@ The following is a list of all configuration keys and their purpose\. You can le
211
211
  \fBignore_messages\fR (\fBBUNDLE_IGNORE_MESSAGES\fR): When set, no post install messages will be printed\. To silence a single gem, use dot notation like \fBignore_messages\.httparty true\fR\.
212
212
  .
213
213
  .IP "\(bu" 4
214
- \fBinit_gems_rb\fR (\fBBUNDLE_INIT_GEMS_RB\fR) Generate a \fBgems\.rb\fR instead of a \fBGemfile\fR when running \fBbundle init\fR\.
214
+ \fBinit_gems_rb\fR (\fBBUNDLE_INIT_GEMS_RB\fR): Generate a \fBgems\.rb\fR instead of a \fBGemfile\fR when running \fBbundle init\fR\.
215
215
  .
216
216
  .IP "\(bu" 4
217
- \fBjobs\fR (\fBBUNDLE_JOBS\fR): The number of gems Bundler can install in parallel\. Defaults to 1\.
217
+ \fBjobs\fR (\fBBUNDLE_JOBS\fR): The number of gems Bundler can install in parallel\. Defaults to 1 on Windows, and to the the number of processors on other platforms\.
218
218
  .
219
219
  .IP "\(bu" 4
220
220
  \fBno_install\fR (\fBBUNDLE_NO_INSTALL\fR): Whether \fBbundle package\fR should skip installing gems\.
@@ -241,7 +241,7 @@ The following is a list of all configuration keys and their purpose\. You can le
241
241
  \fBprefer_patch\fR (BUNDLE_PREFER_PATCH): Prefer updating only to next patch version during updates\. Makes \fBbundle update\fR calls equivalent to \fBbundler update \-\-patch\fR\.
242
242
  .
243
243
  .IP "\(bu" 4
244
- \fBprint_only_version_number\fR (\fBBUNDLE_PRINT_ONLY_VERSION_NUMBER\fR) Print only version number from \fBbundler \-\-version\fR\.
244
+ \fBprint_only_version_number\fR (\fBBUNDLE_PRINT_ONLY_VERSION_NUMBER\fR): Print only version number from \fBbundler \-\-version\fR\.
245
245
  .
246
246
  .IP "\(bu" 4
247
247
  \fBredirect\fR (\fBBUNDLE_REDIRECT\fR): The number of redirects allowed for network requests\. Defaults to \fB5\fR\.
@@ -283,7 +283,7 @@ The following is a list of all configuration keys and their purpose\. You can le
283
283
  \fBunlock_source_unlocks_spec\fR (\fBBUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC\fR): Whether running \fBbundle update \-\-source NAME\fR unlocks a gem with the given name\. Defaults to \fBtrue\fR\.
284
284
  .
285
285
  .IP "\(bu" 4
286
- \fBupdate_requires_all_flag\fR (\fBBUNDLE_UPDATE_REQUIRES_ALL_FLAG\fR) Require passing \fB\-\-all\fR to \fBbundle update\fR when everything should be updated, and disallow passing no options to \fBbundle update\fR\.
286
+ \fBupdate_requires_all_flag\fR (\fBBUNDLE_UPDATE_REQUIRES_ALL_FLAG\fR): Require passing \fB\-\-all\fR to \fBbundle update\fR when everything should be updated, and disallow passing no options to \fBbundle update\fR\.
287
287
  .
288
288
  .IP "\(bu" 4
289
289
  \fBuser_agent\fR (\fBBUNDLE_USER_AGENT\fR): The custom user agent fragment Bundler includes in API requests\.
@@ -206,13 +206,14 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
206
206
  * `global_gem_cache` (`BUNDLE_GLOBAL_GEM_CACHE`):
207
207
  Whether Bundler should cache all gems globally, rather than locally to the
208
208
  installing Ruby installation.
209
- * `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`): When set, no post install
210
- messages will be printed. To silence a single gem, use dot notation like
211
- `ignore_messages.httparty true`.
212
- * `init_gems_rb` (`BUNDLE_INIT_GEMS_RB`)
209
+ * `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`):
210
+ When set, no post install messages will be printed. To silence a single gem,
211
+ use dot notation like `ignore_messages.httparty true`.
212
+ * `init_gems_rb` (`BUNDLE_INIT_GEMS_RB`):
213
213
  Generate a `gems.rb` instead of a `Gemfile` when running `bundle init`.
214
214
  * `jobs` (`BUNDLE_JOBS`):
215
- The number of gems Bundler can install in parallel. Defaults to 1.
215
+ The number of gems Bundler can install in parallel. Defaults to 1 on Windows,
216
+ and to the the number of processors on other platforms.
216
217
  * `no_install` (`BUNDLE_NO_INSTALL`):
217
218
  Whether `bundle package` should skip installing gems.
218
219
  * `no_prune` (`BUNDLE_NO_PRUNE`):
@@ -233,7 +234,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
233
234
  Enable Bundler's experimental plugin system.
234
235
  * `prefer_patch` (BUNDLE_PREFER_PATCH):
235
236
  Prefer updating only to next patch version during updates. Makes `bundle update` calls equivalent to `bundler update --patch`.
236
- * `print_only_version_number` (`BUNDLE_PRINT_ONLY_VERSION_NUMBER`)
237
+ * `print_only_version_number` (`BUNDLE_PRINT_ONLY_VERSION_NUMBER`):
237
238
  Print only version number from `bundler --version`.
238
239
  * `redirect` (`BUNDLE_REDIRECT`):
239
240
  The number of redirects allowed for network requests. Defaults to `5`.
@@ -269,7 +270,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
269
270
  * `unlock_source_unlocks_spec` (`BUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC`):
270
271
  Whether running `bundle update --source NAME` unlocks a gem with the given
271
272
  name. Defaults to `true`.
272
- * `update_requires_all_flag` (`BUNDLE_UPDATE_REQUIRES_ALL_FLAG`)
273
+ * `update_requires_all_flag` (`BUNDLE_UPDATE_REQUIRES_ALL_FLAG`):
273
274
  Require passing `--all` to `bundle update` when everything should be updated,
274
275
  and disallow passing no options to `bundle update`.
275
276
  * `user_agent` (`BUNDLE_USER_AGENT`):
@@ -105,6 +105,7 @@ module Bundler
105
105
  else
106
106
  builder.eval_gemfile(gemfile)
107
107
  end
108
+ builder.check_primary_source_safety
108
109
  definition = builder.to_definition(nil, true)
109
110
 
110
111
  return if definition.dependencies.empty?
@@ -140,6 +140,13 @@ module Bundler
140
140
  end
141
141
  end
142
142
 
143
+ # Set internal representation to fetch the gems/specs locally.
144
+ #
145
+ # When this is called, the source should try to fetch the specs and
146
+ # install from the local system.
147
+ def local!
148
+ end
149
+
143
150
  # Set internal representation to fetch the gems/specs from remote.
144
151
  #
145
152
  # When this is called, the source should try to fetch the specs and
@@ -16,15 +16,13 @@ module Bundler
16
16
 
17
17
  version = options[:version] || [">= 0"]
18
18
 
19
- Bundler.settings.temporary(:disable_multisource => false) do
20
- if options[:git]
21
- install_git(names, version, options)
22
- elsif options[:local_git]
23
- install_local_git(names, version, options)
24
- else
25
- sources = options[:source] || Bundler.rubygems.sources
26
- install_rubygems(names, version, sources)
27
- end
19
+ if options[:git]
20
+ install_git(names, version, options)
21
+ elsif options[:local_git]
22
+ install_local_git(names, version, options)
23
+ else
24
+ sources = options[:source] || Bundler.rubygems.sources
25
+ install_rubygems(names, version, sources)
28
26
  end
29
27
  end
30
28
 
@@ -79,7 +77,7 @@ module Bundler
79
77
  source_list = SourceList.new
80
78
 
81
79
  source_list.add_git_source(git_source_options) if git_source_options
82
- source_list.add_rubygems_source("remotes" => rubygems_source) if rubygems_source
80
+ source_list.global_rubygems_source = rubygems_source if rubygems_source
83
81
 
84
82
  deps = names.map {|name| Dependency.new name, version }
85
83
 
@@ -17,6 +17,10 @@ module Bundler
17
17
  path_sources + git_sources + rubygems_sources + [metadata_source]
18
18
  end
19
19
 
20
+ def default_source
21
+ git_sources.first || global_rubygems_source
22
+ end
23
+
20
24
  private
21
25
 
22
26
  def rubygems_aggregate_class
@@ -17,16 +17,21 @@ module Bundler
17
17
  # ==== Returns
18
18
  # <GemBundle>,nil:: If the list of dependencies can be resolved, a
19
19
  # collection of gemspecs is returned. Otherwise, nil is returned.
20
- def self.resolve(requirements, index, source_requirements = {}, base = [], gem_version_promoter = GemVersionPromoter.new, additional_base_requirements = [], platforms = nil)
20
+ def self.resolve(requirements, source_requirements = {}, base = [], gem_version_promoter = GemVersionPromoter.new, additional_base_requirements = [], platforms = nil)
21
21
  base = SpecSet.new(base) unless base.is_a?(SpecSet)
22
- resolver = new(index, source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
22
+ resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
23
23
  result = resolver.start(requirements)
24
24
  SpecSet.new(result)
25
25
  end
26
26
 
27
- def initialize(index, source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
28
- @index = index
27
+ def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
29
28
  @source_requirements = source_requirements
29
+
30
+ @index_requirements = source_requirements.each_with_object({}) do |source_requirement, index_requirements|
31
+ name, source = source_requirement
32
+ index_requirements[name] = name == :global ? source : source.specs
33
+ end
34
+
30
35
  @base = base
31
36
  @resolver = Molinillo::Resolver.new(self, self)
32
37
  @search_for = {}
@@ -36,14 +41,14 @@ module Bundler
36
41
  @base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
37
42
  end
38
43
  additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
39
- @platforms = platforms
44
+ @platforms = platforms.reject {|p| p != Gem::Platform::RUBY && (platforms - [p]).any? {|pl| generic(pl) == p } }
40
45
  @resolving_only_for_ruby = platforms == [Gem::Platform::RUBY]
41
46
  @gem_version_promoter = gem_version_promoter
42
47
  @use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
43
- @lockfile_uses_separate_rubygems_sources = Bundler.feature_flag.disable_multisource?
48
+ @no_aggregate_global_source = @source_requirements[:global].nil?
44
49
 
45
50
  @variant_specific_names = []
46
- @generic_names = []
51
+ @generic_names = ["Ruby\0", "RubyGems\0"]
47
52
  end
48
53
 
49
54
  def start(requirements)
@@ -125,8 +130,7 @@ module Bundler
125
130
  dependency = dependency_proxy.dep
126
131
  name = dependency.name
127
132
  search_result = @search_for[dependency_proxy] ||= begin
128
- index = index_for(dependency)
129
- results = index.search(dependency, @base[name])
133
+ results = results_for(dependency, @base[name])
130
134
 
131
135
  if vertex = @base_dg.vertex_named(name)
132
136
  locked_requirement = vertex.payload.requirement
@@ -196,22 +200,22 @@ module Bundler
196
200
  end
197
201
 
198
202
  def index_for(dependency)
199
- source = @source_requirements[dependency.name]
203
+ source = @index_requirements[dependency.name]
200
204
  if source
201
- source.specs
202
- elsif @lockfile_uses_separate_rubygems_sources
205
+ source
206
+ elsif @no_aggregate_global_source
203
207
  Index.build do |idx|
204
- if dependency.all_sources
205
- dependency.all_sources.each {|s| idx.add_source(s.specs) if s }
206
- else
207
- idx.add_source @source_requirements[:default].specs
208
- end
208
+ dependency.all_sources.each {|s| idx.add_source(s.specs) }
209
209
  end
210
210
  else
211
- @index
211
+ @index_requirements[:global]
212
212
  end
213
213
  end
214
214
 
215
+ def results_for(dependency, base)
216
+ index_for(dependency).search(dependency, base)
217
+ end
218
+
215
219
  def name_for(dependency)
216
220
  dependency.name
217
221
  end
@@ -239,18 +243,20 @@ module Bundler
239
243
  def relevant_sources_for_vertex(vertex)
240
244
  if vertex.root?
241
245
  [@source_requirements[vertex.name]]
242
- elsif @lockfile_uses_separate_rubygems_sources
246
+ elsif @no_aggregate_global_source
243
247
  vertex.recursive_predecessors.map do |v|
244
248
  @source_requirements[v.name]
245
- end << @source_requirements[:default]
249
+ end.compact << @source_requirements[:default]
250
+ else
251
+ []
246
252
  end
247
253
  end
248
254
 
249
255
  def sort_dependencies(dependencies, activated, conflicts)
250
256
  dependencies.sort_by do |dependency|
251
- dependency.all_sources = relevant_sources_for_vertex(activated.vertex_named(dependency.name))
252
257
  name = name_for(dependency)
253
258
  vertex = activated.vertex_named(name)
259
+ dependency.all_sources = relevant_sources_for_vertex(vertex)
254
260
  [
255
261
  @base_dg.vertex_named(name) ? 0 : 1,
256
262
  vertex.payload ? 0 : 1,
@@ -317,7 +323,7 @@ module Bundler
317
323
  "If you are updating multiple gems in your Gemfile at once,\n" \
318
324
  "try passing them all to `bundle update`"
319
325
  elsif source = @source_requirements[name]
320
- specs = source.specs[name]
326
+ specs = source.specs.search(name)
321
327
  versions_with_platforms = specs.map {|s| [s.version, s.platform] }
322
328
  message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
323
329
  message << if versions_with_platforms.any?
@@ -326,7 +332,7 @@ module Bundler
326
332
  "The source does not contain any versions of '#{name}'"
327
333
  end
328
334
  else
329
- message = "Could not find gem '#{requirement}' in any of the gem sources " \
335
+ message = "Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in any of the gem sources " \
330
336
  "listed in your Gemfile#{cache_message}."
331
337
  end
332
338
  raise GemNotFound, message
@@ -392,7 +398,7 @@ module Bundler
392
398
  if other_bundler_required
393
399
  o << "\n\n"
394
400
 
395
- candidate_specs = @source_requirements[:default_bundler].specs.search(conflict_dependency)
401
+ candidate_specs = @index_requirements[:default_bundler].search(conflict_dependency)
396
402
  if candidate_specs.any?
397
403
  target_version = candidate_specs.last.version
398
404
  new_command = [File.basename($PROGRAM_NAME), "_#{target_version}_", *ARGV].join(" ")
@@ -411,14 +417,8 @@ module Bundler
411
417
 
412
418
  relevant_sources = if conflict.requirement.source
413
419
  [conflict.requirement.source]
414
- elsif conflict.requirement.all_sources
415
- conflict.requirement.all_sources
416
- elsif @lockfile_uses_separate_rubygems_sources
417
- # every conflict should have an explicit group of sources when we
418
- # enforce strict pinning
419
- raise "no source set for #{conflict}"
420
420
  else
421
- []
421
+ conflict.requirement.all_sources
422
422
  end.compact.map(&:to_s).uniq.sort
423
423
 
424
424
  metadata_requirement = name.end_with?("\0")
@@ -455,23 +455,21 @@ module Bundler
455
455
  def validate_resolved_specs!(resolved_specs)
456
456
  resolved_specs.each do |v|
457
457
  name = v.name
458
- next unless sources = relevant_sources_for_vertex(v)
459
- sources.compact!
458
+ sources = relevant_sources_for_vertex(v)
459
+ next unless sources.any?
460
460
  if default_index = sources.index(@source_requirements[:default])
461
461
  sources.delete_at(default_index)
462
462
  end
463
- sources.reject! {|s| s.specs[name].empty? }
463
+ sources.reject! {|s| s.specs.search(name).empty? }
464
464
  sources.uniq!
465
465
  next if sources.size <= 1
466
466
 
467
- multisource_disabled = Bundler.feature_flag.disable_multisource?
468
-
469
467
  msg = ["The gem '#{name}' was found in multiple relevant sources."]
470
468
  msg.concat sources.map {|s| " * #{s}" }.sort
471
- msg << "You #{multisource_disabled ? :must : :should} add this gem to the source block for the source you wish it to be installed from."
469
+ msg << "You #{@no_aggregate_global_source ? :must : :should} add this gem to the source block for the source you wish it to be installed from."
472
470
  msg = msg.join("\n")
473
471
 
474
- raise SecurityError, msg if multisource_disabled
472
+ raise SecurityError, msg if @no_aggregate_global_source
475
473
  Bundler.ui.warn "Warning: #{msg}"
476
474
  end
477
475
  end
@@ -8,6 +8,53 @@ module Bundler
8
8
  # Bundler needs to install gems regardless of binstub overwriting
9
9
  end
10
10
 
11
+ def install
12
+ pre_install_checks
13
+
14
+ run_pre_install_hooks
15
+
16
+ spec.loaded_from = spec_file
17
+
18
+ # Completely remove any previous gem files
19
+ FileUtils.rm_rf gem_dir
20
+ FileUtils.rm_rf spec.extension_dir
21
+
22
+ FileUtils.mkdir_p gem_dir, :mode => 0o755
23
+
24
+ extract_files
25
+
26
+ build_extensions
27
+ write_build_info_file
28
+ run_post_build_hooks
29
+
30
+ generate_bin
31
+ generate_plugins
32
+
33
+ write_spec
34
+ write_cache_file
35
+
36
+ say spec.post_install_message unless spec.post_install_message.nil?
37
+
38
+ run_post_install_hooks
39
+
40
+ spec
41
+ end
42
+
43
+ def generate_plugins
44
+ return unless Gem::Installer.instance_methods(false).include?(:generate_plugins)
45
+
46
+ latest = Gem::Specification.stubs_for(spec.name).first
47
+ return if latest && latest.version > spec.version
48
+
49
+ ensure_writable_dir @plugins_dir
50
+
51
+ if spec.plugins.empty?
52
+ remove_plugins_for(spec, @plugins_dir)
53
+ else
54
+ regenerate_plugins_for(spec, @plugins_dir)
55
+ end
56
+ end
57
+
11
58
  def pre_install_checks
12
59
  super && validate_bundler_checksum(options[:bundler_expected_checksum])
13
60
  end