bundler 2.2.11 → 2.2.16

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -0
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/cli.rb +1 -0
  5. data/lib/bundler/cli/common.rb +13 -2
  6. data/lib/bundler/cli/gem.rb +31 -17
  7. data/lib/bundler/cli/outdated.rb +1 -1
  8. data/lib/bundler/compact_index_client/updater.rb +1 -1
  9. data/lib/bundler/definition.rb +48 -31
  10. data/lib/bundler/dsl.rb +36 -25
  11. data/lib/bundler/feature_flag.rb +0 -1
  12. data/lib/bundler/gem_helper.rb +16 -0
  13. data/lib/bundler/inline.rb +1 -0
  14. data/lib/bundler/installer.rb +2 -0
  15. data/lib/bundler/installer/parallel_installer.rb +36 -15
  16. data/lib/bundler/lazy_specification.rb +6 -1
  17. data/lib/bundler/lockfile_parser.rb +3 -13
  18. data/lib/bundler/man/bundle-add.1 +1 -1
  19. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  20. data/lib/bundler/man/bundle-cache.1 +1 -1
  21. data/lib/bundler/man/bundle-check.1 +1 -1
  22. data/lib/bundler/man/bundle-clean.1 +1 -1
  23. data/lib/bundler/man/bundle-config.1 +4 -4
  24. data/lib/bundler/man/bundle-config.1.ronn +4 -3
  25. data/lib/bundler/man/bundle-doctor.1 +1 -1
  26. data/lib/bundler/man/bundle-exec.1 +1 -1
  27. data/lib/bundler/man/bundle-gem.1 +1 -1
  28. data/lib/bundler/man/bundle-info.1 +1 -1
  29. data/lib/bundler/man/bundle-init.1 +1 -1
  30. data/lib/bundler/man/bundle-inject.1 +1 -1
  31. data/lib/bundler/man/bundle-install.1 +1 -1
  32. data/lib/bundler/man/bundle-list.1 +1 -1
  33. data/lib/bundler/man/bundle-lock.1 +1 -1
  34. data/lib/bundler/man/bundle-open.1 +1 -1
  35. data/lib/bundler/man/bundle-outdated.1 +1 -1
  36. data/lib/bundler/man/bundle-platform.1 +1 -1
  37. data/lib/bundler/man/bundle-pristine.1 +1 -1
  38. data/lib/bundler/man/bundle-remove.1 +1 -1
  39. data/lib/bundler/man/bundle-show.1 +1 -1
  40. data/lib/bundler/man/bundle-update.1 +1 -1
  41. data/lib/bundler/man/bundle-viz.1 +1 -1
  42. data/lib/bundler/man/bundle.1 +1 -1
  43. data/lib/bundler/man/gemfile.5 +1 -1
  44. data/lib/bundler/plugin.rb +1 -0
  45. data/lib/bundler/plugin/api/source.rb +7 -0
  46. data/lib/bundler/plugin/installer.rb +8 -10
  47. data/lib/bundler/plugin/source_list.rb +4 -0
  48. data/lib/bundler/resolver.rb +34 -36
  49. data/lib/bundler/rubygems_gem_installer.rb +47 -0
  50. data/lib/bundler/settings.rb +0 -1
  51. data/lib/bundler/source.rb +6 -0
  52. data/lib/bundler/source/metadata.rb +0 -4
  53. data/lib/bundler/source/path.rb +3 -1
  54. data/lib/bundler/source/path/installer.rb +1 -1
  55. data/lib/bundler/source/rubygems.rb +20 -4
  56. data/lib/bundler/source_list.rb +28 -21
  57. data/lib/bundler/spec_set.rb +2 -0
  58. data/lib/bundler/stub_specification.rb +8 -0
  59. data/lib/bundler/templates/newgem/README.md.tt +5 -3
  60. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -4
  61. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +1 -1
  62. data/lib/bundler/version.rb +1 -1
  63. metadata +3 -3
@@ -5,24 +5,40 @@ module Bundler
5
5
  attr_reader :path_sources,
6
6
  :git_sources,
7
7
  :plugin_sources,
8
- :global_rubygems_source,
8
+ :global_path_source,
9
9
  :metadata_source
10
10
 
11
+ def global_rubygems_source
12
+ @global_rubygems_source ||= rubygems_aggregate_class.new("allow_local" => true)
13
+ end
14
+
11
15
  def initialize
12
16
  @path_sources = []
13
17
  @git_sources = []
14
18
  @plugin_sources = []
15
19
  @global_rubygems_source = nil
16
- @rubygems_aggregate = rubygems_aggregate_class.new
20
+ @global_path_source = nil
17
21
  @rubygems_sources = []
18
22
  @metadata_source = Source::Metadata.new
23
+
24
+ @disable_multisource = true
25
+ end
26
+
27
+ def disable_multisource?
28
+ @disable_multisource
29
+ end
30
+
31
+ def merged_gem_lockfile_sections!
32
+ @disable_multisource = false
19
33
  end
20
34
 
21
35
  def add_path_source(options = {})
22
36
  if options["gemspec"]
23
37
  add_source_to_list Source::Gemspec.new(options), path_sources
24
38
  else
25
- add_source_to_list Source::Path.new(options), path_sources
39
+ path_source = add_source_to_list Source::Path.new(options), path_sources
40
+ @global_path_source ||= path_source if options["global"]
41
+ path_source
26
42
  end
27
43
  end
28
44
 
@@ -41,24 +57,20 @@ module Bundler
41
57
  end
42
58
 
43
59
  def global_rubygems_source=(uri)
44
- if Bundler.feature_flag.disable_multisource?
45
- @global_rubygems_source ||= rubygems_aggregate_class.new("remotes" => uri)
46
- end
47
- add_rubygems_remote(uri)
60
+ @global_rubygems_source ||= rubygems_aggregate_class.new("remotes" => uri, "allow_local" => true)
48
61
  end
49
62
 
50
63
  def add_rubygems_remote(uri)
51
- return if Bundler.feature_flag.disable_multisource?
52
- @rubygems_aggregate.add_remote(uri)
53
- @rubygems_aggregate
64
+ global_rubygems_source.add_remote(uri)
65
+ global_rubygems_source
54
66
  end
55
67
 
56
68
  def default_source
57
- global_rubygems_source || @rubygems_aggregate
69
+ global_path_source || global_rubygems_source
58
70
  end
59
71
 
60
72
  def rubygems_sources
61
- @rubygems_sources + [default_source]
73
+ @rubygems_sources + [global_rubygems_source]
62
74
  end
63
75
 
64
76
  def rubygems_remotes
@@ -75,8 +87,8 @@ module Bundler
75
87
 
76
88
  def lock_sources
77
89
  lock_sources = (path_sources + git_sources + plugin_sources).sort_by(&:to_s)
78
- if Bundler.feature_flag.disable_multisource?
79
- lock_sources + rubygems_sources.sort_by(&:to_s)
90
+ if disable_multisource?
91
+ lock_sources + rubygems_sources.sort_by(&:to_s).uniq
80
92
  else
81
93
  lock_sources << combine_rubygems_sources
82
94
  end
@@ -92,12 +104,11 @@ module Bundler
92
104
  end
93
105
  end
94
106
 
95
- replacement_rubygems = !Bundler.feature_flag.disable_multisource? &&
107
+ replacement_rubygems = !disable_multisource? &&
96
108
  replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
97
- @rubygems_aggregate = replacement_rubygems if replacement_rubygems
109
+ @global_rubygems_source = replacement_rubygems if replacement_rubygems
98
110
 
99
111
  return true if !equal_sources?(lock_sources, replacement_sources) && !equivalent_sources?(lock_sources, replacement_sources)
100
- return true if replacement_rubygems && rubygems_remotes.sort_by(&:to_s) != replacement_rubygems.remotes.sort_by(&:to_s)
101
112
 
102
113
  false
103
114
  end
@@ -110,10 +121,6 @@ module Bundler
110
121
  all_sources.each(&:remote!)
111
122
  end
112
123
 
113
- def rubygems_primary_remotes
114
- @rubygems_aggregate.remotes
115
- end
116
-
117
124
  private
118
125
 
119
126
  def rubygems_aggregate_class
@@ -82,6 +82,7 @@ module Bundler
82
82
  materialized.map! do |s|
83
83
  next s unless s.is_a?(LazySpecification)
84
84
  s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=)
85
+ s.source.local!
85
86
  spec = s.__materialize__
86
87
  unless spec
87
88
  unless missing_specs
@@ -102,6 +103,7 @@ module Bundler
102
103
  @specs.map do |s|
103
104
  next s unless s.is_a?(LazySpecification)
104
105
  s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
106
+ s.source.local!
105
107
  s.source.remote!
106
108
  spec = s.__materialize__
107
109
  raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
@@ -26,11 +26,19 @@ module Bundler
26
26
 
27
27
  # @!group Stub Delegates
28
28
 
29
+ def manually_installed?
30
+ # This is for manually installed gems which are gems that were fixed in place after a
31
+ # failed installation. Once the issue was resolved, the user then manually created
32
+ # the gem specification using the instructions provided by `gem help install`
33
+ installed_by_version == Gem::Version.new(0)
34
+ end
35
+
29
36
  # This is defined directly to avoid having to loading the full spec
30
37
  def missing_extensions?
31
38
  return false if default_gem?
32
39
  return false if extensions.empty?
33
40
  return false if File.exist? gem_build_complete_path
41
+ return false if manually_installed?
34
42
 
35
43
  true
36
44
  end
@@ -29,19 +29,21 @@ TODO: Write usage instructions here
29
29
  After checking out the repo, run `bin/setup` to install dependencies.<% if config[:test] %> Then, run `rake <%= config[:test].sub('mini', '').sub('rspec', 'spec') %>` to run the tests.<% end %> You can also run `bin/console` for an interactive prompt that will allow you to experiment.<% if config[:bin] %> Run `bundle exec <%= config[:name] %>` to use the gem in this directory, ignoring other installed copies of this gem.<% end %>
30
30
 
31
31
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+ <% if config[:git] -%>
32
33
 
33
34
  ## Contributing
34
35
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).<% end %>
36
+ Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/<%= config[:git_default_branch] %>/CODE_OF_CONDUCT.md).<% end %>
37
+ <% end -%>
36
38
  <% if config[:mit] -%>
37
39
 
38
40
  ## License
39
41
 
40
42
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
41
43
  <% end -%>
42
- <% if config[:coc] -%>
44
+ <% if config[:git] && config[:coc] -%>
43
45
 
44
46
  ## Code of Conduct
45
47
 
46
- Everyone interacting in the <%= config[:constant_name] %> project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).
48
+ Everyone interacting in the <%= config[:constant_name] %> project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/<%= config[:git_default_branch] %>/CODE_OF_CONDUCT.md).
47
49
  <% end -%>
@@ -11,8 +11,6 @@ jobs:
11
11
  uses: ruby/setup-ruby@v1
12
12
  with:
13
13
  ruby-version: <%= RUBY_VERSION %>
14
+ bundler-cache: true
14
15
  - name: Run the default task
15
- run: |
16
- gem install bundler -v <%= Bundler::VERSION %>
17
- bundle install
18
- bundle exec rake
16
+ run: bundle exec rake
@@ -115,7 +115,7 @@ class Bundler::Dir < Dir
115
115
  Bundler::Dir.tmpdir
116
116
  end
117
117
 
118
- UNUSABLE_CHARS = [File::SEPARATOR, File::ALT_SEPARATOR, File::PATH_SEPARATOR, ":"].uniq.join("").freeze
118
+ UNUSABLE_CHARS = "^,-.0-9A-Z_a-z~"
119
119
 
120
120
  class << (RANDOM = Random.new)
121
121
  MAX = 36**6 # < 0x100000000
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.11".freeze
4
+ VERSION = "2.2.16".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.11
4
+ version: 2.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -22,7 +22,7 @@ authors:
22
22
  autorequire:
23
23
  bindir: exe
24
24
  cert_chain: []
25
- date: 2021-02-17 00:00:00.000000000 Z
25
+ date: 2021-04-09 00:00:00.000000000 Z
26
26
  dependencies: []
27
27
  description: Bundler manages an application's dependencies through its entire life,
28
28
  across many machines, systematically and repeatably
@@ -352,7 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
352
352
  - !ruby/object:Gem::Version
353
353
  version: 2.5.2
354
354
  requirements: []
355
- rubygems_version: 3.2.11
355
+ rubygems_version: 3.2.16
356
356
  signing_key:
357
357
  specification_version: 4
358
358
  summary: The best way to manage your application's dependencies