bundler 2.1.4 → 2.2.17

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 (225) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1774 -1430
  3. data/README.md +6 -8
  4. data/bundler.gemspec +4 -4
  5. data/exe/bundle +3 -0
  6. data/lib/bundler.rb +33 -9
  7. data/lib/bundler/build_metadata.rb +3 -11
  8. data/lib/bundler/cli.rb +59 -23
  9. data/lib/bundler/cli/add.rb +1 -1
  10. data/lib/bundler/cli/binstubs.rb +6 -2
  11. data/lib/bundler/cli/cache.rb +2 -7
  12. data/lib/bundler/cli/clean.rb +1 -1
  13. data/lib/bundler/cli/common.rb +29 -2
  14. data/lib/bundler/cli/console.rb +1 -1
  15. data/lib/bundler/cli/doctor.rb +1 -1
  16. data/lib/bundler/cli/exec.rb +4 -4
  17. data/lib/bundler/cli/fund.rb +36 -0
  18. data/lib/bundler/cli/gem.rb +129 -28
  19. data/lib/bundler/cli/info.rb +15 -4
  20. data/lib/bundler/cli/init.rb +2 -2
  21. data/lib/bundler/cli/inject.rb +1 -1
  22. data/lib/bundler/cli/install.rb +13 -11
  23. data/lib/bundler/cli/issue.rb +2 -2
  24. data/lib/bundler/cli/list.rb +12 -10
  25. data/lib/bundler/cli/outdated.rb +88 -67
  26. data/lib/bundler/cli/plugin.rb +10 -0
  27. data/lib/bundler/cli/pristine.rb +5 -0
  28. data/lib/bundler/cli/show.rb +1 -1
  29. data/lib/bundler/cli/update.rb +3 -1
  30. data/lib/bundler/compact_index_client.rb +1 -1
  31. data/lib/bundler/compact_index_client/cache.rb +6 -14
  32. data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  33. data/lib/bundler/compact_index_client/updater.rb +13 -17
  34. data/lib/bundler/current_ruby.rb +1 -0
  35. data/lib/bundler/definition.rb +121 -131
  36. data/lib/bundler/dep_proxy.rb +16 -9
  37. data/lib/bundler/dependency.rb +3 -10
  38. data/lib/bundler/dsl.rb +40 -33
  39. data/lib/bundler/endpoint_specification.rb +1 -1
  40. data/lib/bundler/env.rb +1 -1
  41. data/lib/bundler/environment_preserver.rb +26 -2
  42. data/lib/bundler/errors.rb +1 -0
  43. data/lib/bundler/feature_flag.rb +0 -5
  44. data/lib/bundler/fetcher.rb +5 -4
  45. data/lib/bundler/fetcher/base.rb +1 -1
  46. data/lib/bundler/fetcher/compact_index.rb +1 -1
  47. data/lib/bundler/fetcher/downloader.rb +9 -5
  48. data/lib/bundler/fetcher/index.rb +3 -4
  49. data/lib/bundler/friendly_errors.rb +22 -13
  50. data/lib/bundler/gem_helper.rb +51 -18
  51. data/lib/bundler/gem_helpers.rb +36 -25
  52. data/lib/bundler/gem_version_promoter.rb +4 -4
  53. data/lib/bundler/graph.rb +1 -1
  54. data/lib/bundler/index.rb +12 -7
  55. data/lib/bundler/injector.rb +23 -5
  56. data/lib/bundler/inline.rb +3 -2
  57. data/lib/bundler/installer.rb +37 -49
  58. data/lib/bundler/installer/gem_installer.rb +3 -3
  59. data/lib/bundler/installer/parallel_installer.rb +46 -25
  60. data/lib/bundler/installer/standalone.rb +17 -2
  61. data/lib/bundler/lazy_specification.rb +45 -25
  62. data/lib/bundler/lockfile_generator.rb +1 -1
  63. data/lib/bundler/lockfile_parser.rb +4 -14
  64. data/lib/bundler/man/.document +1 -0
  65. data/{man → lib/bundler/man}/bundle-add.1 +1 -1
  66. data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +0 -0
  67. data/{man → lib/bundler/man}/bundle-binstubs.1 +5 -3
  68. data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
  69. data/{man → lib/bundler/man}/bundle-cache.1 +1 -1
  70. data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +0 -0
  71. data/{man → lib/bundler/man}/bundle-check.1 +1 -1
  72. data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
  73. data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
  74. data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
  75. data/{man → lib/bundler/man}/bundle-config.1 +42 -34
  76. data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +51 -43
  77. data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
  78. data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
  79. data/{man → lib/bundler/man}/bundle-exec.1 +1 -1
  80. data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +0 -0
  81. data/{man → lib/bundler/man}/bundle-gem.1 +25 -3
  82. data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +30 -7
  83. data/{man → lib/bundler/man}/bundle-info.1 +1 -1
  84. data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
  85. data/{man → lib/bundler/man}/bundle-init.1 +1 -1
  86. data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
  87. data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
  88. data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
  89. data/{man → lib/bundler/man}/bundle-install.1 +30 -3
  90. data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +25 -3
  91. data/{man → lib/bundler/man}/bundle-list.1 +7 -7
  92. data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
  93. data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
  94. data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
  95. data/{man → lib/bundler/man}/bundle-open.1 +1 -1
  96. data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
  97. data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
  98. data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
  99. data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
  100. data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
  101. data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
  102. data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
  103. data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
  104. data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
  105. data/{man → lib/bundler/man}/bundle-show.1 +1 -1
  106. data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
  107. data/{man → lib/bundler/man}/bundle-update.1 +1 -1
  108. data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +0 -0
  109. data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
  110. data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
  111. data/{man → lib/bundler/man}/bundle.1 +1 -1
  112. data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +0 -0
  113. data/{man → lib/bundler/man}/gemfile.5 +4 -4
  114. data/{man → lib/bundler/man}/gemfile.5.ronn +4 -4
  115. data/{man → lib/bundler/man}/index.txt +0 -0
  116. data/lib/bundler/mirror.rb +2 -2
  117. data/lib/bundler/plugin.rb +33 -7
  118. data/lib/bundler/plugin/api/source.rb +8 -1
  119. data/lib/bundler/plugin/dsl.rb +1 -1
  120. data/lib/bundler/plugin/index.rb +10 -1
  121. data/lib/bundler/plugin/installer.rb +9 -11
  122. data/lib/bundler/plugin/installer/rubygems.rb +1 -1
  123. data/lib/bundler/plugin/source_list.rb +5 -1
  124. data/lib/bundler/psyched_yaml.rb +0 -15
  125. data/lib/bundler/remote_specification.rb +5 -2
  126. data/lib/bundler/resolver.rb +133 -77
  127. data/lib/bundler/resolver/spec_group.rb +75 -48
  128. data/lib/bundler/retry.rb +2 -2
  129. data/lib/bundler/ruby_version.rb +1 -1
  130. data/lib/bundler/rubygems_ext.rb +69 -9
  131. data/lib/bundler/rubygems_gem_installer.rb +50 -9
  132. data/lib/bundler/rubygems_integration.rb +25 -60
  133. data/lib/bundler/runtime.rb +4 -14
  134. data/lib/bundler/settings.rb +107 -54
  135. data/lib/bundler/shared_helpers.rb +3 -3
  136. data/lib/bundler/similarity_detector.rb +1 -1
  137. data/lib/bundler/source.rb +7 -1
  138. data/lib/bundler/source/git.rb +24 -22
  139. data/lib/bundler/source/git/git_proxy.rb +82 -80
  140. data/lib/bundler/source/metadata.rb +0 -4
  141. data/lib/bundler/source/path.rb +10 -4
  142. data/lib/bundler/source/path/installer.rb +10 -10
  143. data/lib/bundler/source/rubygems.rb +45 -24
  144. data/lib/bundler/source/rubygems/remote.rb +1 -1
  145. data/lib/bundler/source_list.rb +31 -26
  146. data/lib/bundler/spec_set.rb +29 -17
  147. data/lib/bundler/stub_specification.rb +25 -7
  148. data/lib/bundler/templates/Gemfile +1 -1
  149. data/lib/bundler/templates/gems.rb +1 -1
  150. data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  151. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
  152. data/lib/bundler/templates/newgem/Gemfile.tt +9 -1
  153. data/lib/bundler/templates/newgem/README.md.tt +6 -5
  154. data/lib/bundler/templates/newgem/Rakefile.tt +19 -5
  155. data/lib/bundler/templates/newgem/bin/console.tt +1 -0
  156. data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
  157. data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
  158. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +16 -0
  159. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  160. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
  161. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
  162. data/lib/bundler/templates/newgem/newgem.gemspec.tt +15 -7
  163. data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
  164. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
  165. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
  166. data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
  167. data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
  168. data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  169. data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  170. data/lib/bundler/ui/shell.rb +5 -5
  171. data/lib/bundler/uri_credentials_filter.rb +3 -1
  172. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
  173. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
  174. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -2
  175. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
  176. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
  177. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +3 -3
  178. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  179. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +12 -1
  180. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +49 -47
  181. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
  182. data/lib/bundler/vendor/thor/lib/thor.rb +5 -13
  183. data/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -1
  184. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
  185. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +4 -2
  186. data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
  187. data/lib/bundler/vendor/thor/lib/thor/error.rb +1 -1
  188. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
  189. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +9 -8
  190. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +5 -2
  191. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
  192. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  193. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
  194. data/lib/bundler/vendored_persistent.rb +0 -7
  195. data/lib/bundler/vendored_tmpdir.rb +4 -0
  196. data/lib/bundler/version.rb +1 -1
  197. data/lib/bundler/worker.rb +1 -1
  198. data/lib/bundler/yaml_serializer.rb +1 -1
  199. metadata +71 -85
  200. data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
  201. data/man/bundle-add.1.txt +0 -58
  202. data/man/bundle-binstubs.1.txt +0 -48
  203. data/man/bundle-cache.1.txt +0 -78
  204. data/man/bundle-check.1.txt +0 -33
  205. data/man/bundle-clean.1.txt +0 -26
  206. data/man/bundle-config.1.txt +0 -528
  207. data/man/bundle-doctor.1.txt +0 -44
  208. data/man/bundle-exec.1.txt +0 -178
  209. data/man/bundle-gem.1.txt +0 -91
  210. data/man/bundle-info.1.txt +0 -21
  211. data/man/bundle-init.1.txt +0 -34
  212. data/man/bundle-inject.1.txt +0 -32
  213. data/man/bundle-install.1.txt +0 -401
  214. data/man/bundle-list.1.txt +0 -43
  215. data/man/bundle-lock.1.txt +0 -93
  216. data/man/bundle-open.1.txt +0 -29
  217. data/man/bundle-outdated.1.txt +0 -131
  218. data/man/bundle-platform.1.txt +0 -57
  219. data/man/bundle-pristine.1.txt +0 -44
  220. data/man/bundle-remove.1.txt +0 -34
  221. data/man/bundle-show.1.txt +0 -27
  222. data/man/bundle-update.1.txt +0 -390
  223. data/man/bundle-viz.1.txt +0 -39
  224. data/man/bundle.1.txt +0 -116
  225. data/man/gemfile.5.txt +0 -649
@@ -39,7 +39,7 @@ module Bundler
39
39
  "rubygems remote at #{anonymized_uri}"
40
40
  end
41
41
 
42
- private
42
+ private
43
43
 
44
44
  def apply_auth(uri, auth)
45
45
  if auth && uri.userinfo.nil?
@@ -1,30 +1,44 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "set"
4
-
5
3
  module Bundler
6
4
  class SourceList
7
5
  attr_reader :path_sources,
8
6
  :git_sources,
9
7
  :plugin_sources,
10
- :global_rubygems_source,
8
+ :global_path_source,
11
9
  :metadata_source
12
10
 
11
+ def global_rubygems_source
12
+ @global_rubygems_source ||= rubygems_aggregate_class.new("allow_local" => true)
13
+ end
14
+
13
15
  def initialize
14
16
  @path_sources = []
15
17
  @git_sources = []
16
18
  @plugin_sources = []
17
19
  @global_rubygems_source = nil
18
- @rubygems_aggregate = rubygems_aggregate_class.new
20
+ @global_path_source = nil
19
21
  @rubygems_sources = []
20
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
21
33
  end
22
34
 
23
35
  def add_path_source(options = {})
24
36
  if options["gemspec"]
25
37
  add_source_to_list Source::Gemspec.new(options), path_sources
26
38
  else
27
- 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
28
42
  end
29
43
  end
30
44
 
@@ -43,24 +57,20 @@ module Bundler
43
57
  end
44
58
 
45
59
  def global_rubygems_source=(uri)
46
- if Bundler.feature_flag.disable_multisource?
47
- @global_rubygems_source ||= rubygems_aggregate_class.new("remotes" => uri)
48
- end
49
- add_rubygems_remote(uri)
60
+ @global_rubygems_source ||= rubygems_aggregate_class.new("remotes" => uri, "allow_local" => true)
50
61
  end
51
62
 
52
63
  def add_rubygems_remote(uri)
53
- return if Bundler.feature_flag.disable_multisource?
54
- @rubygems_aggregate.add_remote(uri)
55
- @rubygems_aggregate
64
+ global_rubygems_source.add_remote(uri)
65
+ global_rubygems_source
56
66
  end
57
67
 
58
68
  def default_source
59
- global_rubygems_source || @rubygems_aggregate
69
+ global_path_source || global_rubygems_source
60
70
  end
61
71
 
62
72
  def rubygems_sources
63
- @rubygems_sources + [default_source]
73
+ @rubygems_sources + [global_rubygems_source]
64
74
  end
65
75
 
66
76
  def rubygems_remotes
@@ -77,8 +87,8 @@ module Bundler
77
87
 
78
88
  def lock_sources
79
89
  lock_sources = (path_sources + git_sources + plugin_sources).sort_by(&:to_s)
80
- if Bundler.feature_flag.disable_multisource?
81
- lock_sources + rubygems_sources.sort_by(&:to_s)
90
+ if disable_multisource?
91
+ lock_sources + rubygems_sources.sort_by(&:to_s).uniq
82
92
  else
83
93
  lock_sources << combine_rubygems_sources
84
94
  end
@@ -94,12 +104,11 @@ module Bundler
94
104
  end
95
105
  end
96
106
 
97
- replacement_rubygems = !Bundler.feature_flag.disable_multisource? &&
107
+ replacement_rubygems = !disable_multisource? &&
98
108
  replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
99
- @rubygems_aggregate = replacement_rubygems if replacement_rubygems
109
+ @global_rubygems_source = replacement_rubygems if replacement_rubygems
100
110
 
101
111
  return true if !equal_sources?(lock_sources, replacement_sources) && !equivalent_sources?(lock_sources, replacement_sources)
102
- return true if replacement_rubygems && rubygems_remotes.to_set != replacement_rubygems.remotes.to_set
103
112
 
104
113
  false
105
114
  end
@@ -112,11 +121,7 @@ module Bundler
112
121
  all_sources.each(&:remote!)
113
122
  end
114
123
 
115
- def rubygems_primary_remotes
116
- @rubygems_aggregate.remotes
117
- end
118
-
119
- private
124
+ private
120
125
 
121
126
  def rubygems_aggregate_class
122
127
  Source::Rubygems
@@ -147,13 +152,13 @@ module Bundler
147
152
  if source.uri =~ /^git\:/
148
153
  Bundler.ui.warn "The git source `#{source.uri}` uses the `git` protocol, " \
149
154
  "which transmits data without encryption. Disable this warning with " \
150
- "`bundle config set git.allow_insecure true`, or switch to the `https` " \
155
+ "`bundle config set --local git.allow_insecure true`, or switch to the `https` " \
151
156
  "protocol to keep your data secure."
152
157
  end
153
158
  end
154
159
 
155
160
  def equal_sources?(lock_sources, replacement_sources)
156
- lock_sources.to_set == replacement_sources.to_set
161
+ lock_sources.sort_by(&:to_s) == replacement_sources.sort_by(&:to_s)
157
162
  end
158
163
 
159
164
  def equal_source?(source, other_source)
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "tsort"
4
- require "set"
5
4
 
6
5
  module Bundler
7
6
  class SpecSet
@@ -13,21 +12,24 @@ module Bundler
13
12
  end
14
13
 
15
14
  def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
16
- handled = Set.new
15
+ handled = []
17
16
  deps = dependencies.dup
18
17
  specs = []
19
18
  skip += ["bundler"]
20
19
 
21
20
  loop do
22
21
  break unless dep = deps.shift
23
- next if !handled.add?(dep) || skip.include?(dep.name)
22
+ next if handled.include?(dep) || skip.include?(dep.name)
24
23
 
25
- if spec = spec_for_dependency(dep, match_current_platform)
26
- specs << spec
24
+ handled << dep
27
25
 
28
- spec.dependencies.each do |d|
26
+ specs_for_dep = spec_for_dependency(dep, match_current_platform)
27
+ if specs_for_dep.any?
28
+ specs += specs_for_dep
29
+
30
+ specs_for_dep.first.dependencies.each do |d|
29
31
  next if d.type == :development
30
- d = DepProxy.new(d, dep.__platform) unless match_current_platform
32
+ d = DepProxy.get_proxy(d, dep.__platform) unless match_current_platform
31
33
  deps << d
32
34
  end
33
35
  elsif check
@@ -76,10 +78,17 @@ module Bundler
76
78
 
77
79
  def materialize(deps, missing_specs = nil)
78
80
  materialized = self.for(deps, [], false, true, !missing_specs).to_a
79
- deps = materialized.map(&:name).uniq
81
+
82
+ materialized.group_by(&:source).each do |source, specs|
83
+ next unless specs.any?{|s| s.is_a?(LazySpecification) }
84
+
85
+ source.local!
86
+ names = -> { specs.map(&:name).uniq }
87
+ source.double_check_for(names)
88
+ end
89
+
80
90
  materialized.map! do |s|
81
91
  next s unless s.is_a?(LazySpecification)
82
- s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=)
83
92
  spec = s.__materialize__
84
93
  unless spec
85
94
  unless missing_specs
@@ -96,10 +105,17 @@ module Bundler
96
105
  # This is in contrast to how for does platform filtering (and specifically different from how `materialize` calls `for` only for the current platform)
97
106
  # @return [Array<Gem::Specification>]
98
107
  def materialized_for_all_platforms
99
- names = @specs.map(&:name).uniq
108
+ @specs.group_by(&:source).each do |source, specs|
109
+ next unless specs.any?{|s| s.is_a?(LazySpecification) }
110
+
111
+ source.local!
112
+ source.remote!
113
+ names = -> { specs.map(&:name).uniq }
114
+ source.double_check_for(names)
115
+ end
116
+
100
117
  @specs.map do |s|
101
118
  next s unless s.is_a?(LazySpecification)
102
- s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
103
119
  spec = s.__materialize__
104
120
  raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
105
121
  spec
@@ -147,7 +163,7 @@ module Bundler
147
163
  sorted.each(&b)
148
164
  end
149
165
 
150
- private
166
+ private
151
167
 
152
168
  def sorted
153
169
  rake = @specs.find {|s| s.name == "rake" }
@@ -183,11 +199,7 @@ module Bundler
183
199
  def spec_for_dependency(dep, match_current_platform)
184
200
  specs_for_platforms = lookup[dep.name]
185
201
  if match_current_platform
186
- Bundler.rubygems.platforms.reverse_each do |pl|
187
- match = GemHelpers.select_best_platform_match(specs_for_platforms, pl)
188
- return match if match
189
- end
190
- nil
202
+ GemHelpers.select_best_platform_match(specs_for_platforms, Bundler.local_platform)
191
203
  else
192
204
  GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
193
205
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "remote_specification"
4
-
5
3
  module Bundler
6
4
  class StubSpecification < RemoteSpecification
7
5
  def self.from_stub(stub)
@@ -28,9 +26,21 @@ module Bundler
28
26
 
29
27
  # @!group Stub Delegates
30
28
 
31
- # This is defined directly to avoid having to load every installed spec
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
+
36
+ # This is defined directly to avoid having to loading the full spec
32
37
  def missing_extensions?
33
- stub.missing_extensions?
38
+ return false if default_gem?
39
+ return false if extensions.empty?
40
+ return false if File.exist? gem_build_complete_path
41
+ return false if manually_installed?
42
+
43
+ true
34
44
  end
35
45
 
36
46
  def activated
@@ -41,8 +51,16 @@ module Bundler
41
51
  stub.instance_variable_set(:@activated, activated)
42
52
  end
43
53
 
44
- def default_gem
45
- stub.default_gem
54
+ def extensions
55
+ stub.extensions
56
+ end
57
+
58
+ def gem_build_complete_path
59
+ File.join(extension_dir, "gem.build_complete")
60
+ end
61
+
62
+ def default_gem?
63
+ stub.default_gem?
46
64
  end
47
65
 
48
66
  def full_gem_path
@@ -71,7 +89,7 @@ module Bundler
71
89
  stub.raw_require_paths
72
90
  end
73
91
 
74
- private
92
+ private
75
93
 
76
94
  def _remote_specification
77
95
  @_remote_specification ||= begin
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
7
  # gem "rails"
@@ -3,6 +3,6 @@
3
3
  # A sample gems.rb
4
4
  source "https://rubygems.org"
5
5
 
6
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
7
7
 
8
8
  # gem "rails"
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - <%= Time.now.strftime('%F') %>
4
+
5
+ - Initial release
@@ -2,73 +2,83 @@
2
2
 
3
3
  ## Our Pledge
4
4
 
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
11
8
 
12
9
  ## Our Standards
13
10
 
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
11
+ Examples of behavior that contributes to a positive environment for our community include:
16
12
 
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
22
18
 
23
- Examples of unacceptable behavior by participants include:
19
+ Examples of unacceptable behavior include:
24
20
 
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
28
24
  * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
31
27
  * Other conduct which could reasonably be considered inappropriate in a
32
28
  professional setting
33
29
 
34
- ## Our Responsibilities
30
+ ## Enforcement Responsibilities
35
31
 
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
39
33
 
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
45
35
 
46
36
  ## Scope
47
37
 
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
54
39
 
55
40
  ## Enforcement
56
41
 
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at <%= config[:email] %>. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at <%= config[:email] %>. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
63
59
 
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
67
73
 
68
74
  ## Attribution
69
75
 
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
72
82
 
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.