bundler 2.2.0.rc.1 → 2.2.3

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 (181) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +786 -690
  3. data/lib/bundler.rb +17 -3
  4. data/lib/bundler/build_metadata.rb +3 -11
  5. data/lib/bundler/cli.rb +31 -15
  6. data/lib/bundler/cli/add.rb +1 -1
  7. data/lib/bundler/cli/binstubs.rb +6 -2
  8. data/lib/bundler/cli/cache.rb +1 -7
  9. data/lib/bundler/cli/clean.rb +1 -1
  10. data/lib/bundler/cli/common.rb +14 -0
  11. data/lib/bundler/cli/doctor.rb +1 -1
  12. data/lib/bundler/cli/exec.rb +4 -4
  13. data/lib/bundler/cli/fund.rb +36 -0
  14. data/lib/bundler/cli/gem.rb +1 -1
  15. data/lib/bundler/cli/info.rb +2 -1
  16. data/lib/bundler/cli/init.rb +1 -1
  17. data/lib/bundler/cli/inject.rb +1 -1
  18. data/lib/bundler/cli/install.rb +18 -7
  19. data/lib/bundler/cli/list.rb +1 -1
  20. data/lib/bundler/cli/outdated.rb +1 -3
  21. data/lib/bundler/cli/pristine.rb +1 -1
  22. data/lib/bundler/cli/show.rb +1 -1
  23. data/lib/bundler/cli/update.rb +3 -1
  24. data/lib/bundler/compact_index_client.rb +1 -1
  25. data/lib/bundler/compact_index_client/cache.rb +6 -14
  26. data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  27. data/lib/bundler/compact_index_client/updater.rb +5 -5
  28. data/lib/bundler/definition.rb +49 -60
  29. data/lib/bundler/dep_proxy.rb +1 -1
  30. data/lib/bundler/dependency.rb +3 -1
  31. data/lib/bundler/dsl.rb +4 -4
  32. data/lib/bundler/endpoint_specification.rb +1 -1
  33. data/lib/bundler/env.rb +1 -1
  34. data/lib/bundler/feature_flag.rb +0 -1
  35. data/lib/bundler/fetcher.rb +3 -3
  36. data/lib/bundler/fetcher/base.rb +1 -1
  37. data/lib/bundler/fetcher/compact_index.rb +1 -1
  38. data/lib/bundler/fetcher/downloader.rb +1 -1
  39. data/lib/bundler/fetcher/index.rb +3 -4
  40. data/lib/bundler/friendly_errors.rb +18 -3
  41. data/lib/bundler/gem_helper.rb +17 -9
  42. data/lib/bundler/gem_helpers.rb +36 -25
  43. data/lib/bundler/gem_version_promoter.rb +1 -1
  44. data/lib/bundler/graph.rb +1 -1
  45. data/lib/bundler/index.rb +6 -2
  46. data/lib/bundler/injector.rb +10 -3
  47. data/lib/bundler/installer.rb +8 -6
  48. data/lib/bundler/installer/gem_installer.rb +1 -1
  49. data/lib/bundler/installer/parallel_installer.rb +1 -1
  50. data/lib/bundler/installer/standalone.rb +2 -2
  51. data/lib/bundler/lazy_specification.rb +22 -11
  52. data/lib/bundler/lockfile_generator.rb +1 -1
  53. data/lib/bundler/lockfile_parser.rb +1 -1
  54. data/lib/bundler/man/.document +1 -0
  55. data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +0 -0
  56. data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
  57. data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +0 -0
  58. data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
  59. data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
  60. data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +14 -21
  61. data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
  62. data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +0 -0
  63. data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +0 -0
  64. data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
  65. data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
  66. data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
  67. data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +25 -3
  68. data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +0 -0
  69. data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
  70. data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
  71. data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
  72. data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
  73. data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
  74. data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
  75. data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
  76. data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +0 -0
  77. data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
  78. data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +0 -0
  79. data/{man → lib/bundler/man}/gemfile.5.ronn +4 -4
  80. data/lib/bundler/mirror.rb +2 -2
  81. data/lib/bundler/plugin.rb +5 -6
  82. data/lib/bundler/plugin/api/source.rb +1 -1
  83. data/lib/bundler/plugin/dsl.rb +1 -1
  84. data/lib/bundler/plugin/index.rb +1 -1
  85. data/lib/bundler/plugin/installer.rb +1 -1
  86. data/lib/bundler/plugin/installer/rubygems.rb +1 -1
  87. data/lib/bundler/plugin/source_list.rb +1 -1
  88. data/lib/bundler/remote_specification.rb +1 -1
  89. data/lib/bundler/resolver.rb +26 -30
  90. data/lib/bundler/resolver/spec_group.rb +21 -27
  91. data/lib/bundler/retry.rb +1 -1
  92. data/lib/bundler/ruby_version.rb +1 -1
  93. data/lib/bundler/rubygems_ext.rb +46 -1
  94. data/lib/bundler/rubygems_gem_installer.rb +2 -2
  95. data/lib/bundler/rubygems_integration.rb +22 -12
  96. data/lib/bundler/runtime.rb +2 -2
  97. data/lib/bundler/settings.rb +49 -43
  98. data/lib/bundler/shared_helpers.rb +1 -1
  99. data/lib/bundler/similarity_detector.rb +1 -1
  100. data/lib/bundler/source.rb +1 -1
  101. data/lib/bundler/source/git.rb +1 -1
  102. data/lib/bundler/source/git/git_proxy.rb +5 -3
  103. data/lib/bundler/source/path.rb +2 -2
  104. data/lib/bundler/source/path/installer.rb +1 -1
  105. data/lib/bundler/source/rubygems.rb +2 -2
  106. data/lib/bundler/source/rubygems/remote.rb +1 -1
  107. data/lib/bundler/source_list.rb +2 -2
  108. data/lib/bundler/spec_set.rb +7 -9
  109. data/lib/bundler/stub_specification.rb +1 -3
  110. data/lib/bundler/templates/newgem/README.md.tt +1 -2
  111. data/lib/bundler/templates/newgem/bin/console.tt +1 -2
  112. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -2
  113. data/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
  114. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +0 -1
  115. data/lib/bundler/ui/shell.rb +5 -5
  116. data/lib/bundler/uri_credentials_filter.rb +3 -1
  117. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
  118. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -1
  119. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
  120. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
  121. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  122. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +38 -40
  123. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +8 -1
  124. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
  125. data/lib/bundler/vendored_persistent.rb +0 -7
  126. data/lib/bundler/vendored_tmpdir.rb +4 -0
  127. data/lib/bundler/version.rb +1 -1
  128. data/lib/bundler/worker.rb +1 -1
  129. data/lib/bundler/yaml_serializer.rb +1 -1
  130. data/man/bundle-add.1 +1 -1
  131. data/man/bundle-binstubs.1 +5 -3
  132. data/man/bundle-cache.1 +1 -1
  133. data/man/bundle-check.1 +1 -1
  134. data/man/bundle-clean.1 +1 -1
  135. data/man/bundle-config.1 +14 -17
  136. data/man/bundle-doctor.1 +1 -1
  137. data/man/bundle-exec.1 +1 -1
  138. data/man/bundle-gem.1 +1 -1
  139. data/man/bundle-info.1 +1 -1
  140. data/man/bundle-init.1 +1 -1
  141. data/man/bundle-inject.1 +1 -1
  142. data/man/bundle-install.1 +30 -3
  143. data/man/bundle-list.1 +1 -1
  144. data/man/bundle-lock.1 +1 -1
  145. data/man/bundle-open.1 +1 -1
  146. data/man/bundle-outdated.1 +1 -1
  147. data/man/bundle-platform.1 +1 -1
  148. data/man/bundle-pristine.1 +1 -1
  149. data/man/bundle-remove.1 +1 -1
  150. data/man/bundle-show.1 +1 -1
  151. data/man/bundle-update.1 +1 -1
  152. data/man/bundle-viz.1 +1 -1
  153. data/man/bundle.1 +1 -1
  154. data/man/gemfile.5 +4 -4
  155. metadata +33 -54
  156. data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
  157. data/man/bundle-add.1.txt +0 -58
  158. data/man/bundle-binstubs.1.txt +0 -48
  159. data/man/bundle-cache.1.txt +0 -78
  160. data/man/bundle-check.1.txt +0 -33
  161. data/man/bundle-clean.1.txt +0 -26
  162. data/man/bundle-config.1.txt +0 -527
  163. data/man/bundle-doctor.1.txt +0 -44
  164. data/man/bundle-exec.1.txt +0 -181
  165. data/man/bundle-gem.1.txt +0 -117
  166. data/man/bundle-info.1.txt +0 -21
  167. data/man/bundle-init.1.txt +0 -34
  168. data/man/bundle-inject.1.txt +0 -32
  169. data/man/bundle-install.1.txt +0 -401
  170. data/man/bundle-list.1.txt +0 -44
  171. data/man/bundle-lock.1.txt +0 -93
  172. data/man/bundle-open.1.txt +0 -29
  173. data/man/bundle-outdated.1.txt +0 -131
  174. data/man/bundle-platform.1.txt +0 -57
  175. data/man/bundle-pristine.1.txt +0 -44
  176. data/man/bundle-remove.1.txt +0 -34
  177. data/man/bundle-show.1.txt +0 -27
  178. data/man/bundle-update.1.txt +0 -391
  179. data/man/bundle-viz.1.txt +0 -39
  180. data/man/bundle.1.txt +0 -116
  181. data/man/gemfile.5.txt +0 -651
@@ -155,7 +155,7 @@ module Bundler
155
155
  spec_cache_paths = []
156
156
  spec_gemspec_paths = []
157
157
  spec_extension_paths = []
158
- specs.each do |spec|
158
+ Bundler.rubygems.add_default_gems_to(specs).values.each do |spec|
159
159
  spec_gem_paths << spec.full_gem_path
160
160
  # need to check here in case gems are nested like for the rails git repo
161
161
  md = %r{(.+bundler/gems/.+-[a-f0-9]{7,12})}.match(spec.full_gem_path)
@@ -203,7 +203,7 @@ module Bundler
203
203
  output
204
204
  end
205
205
 
206
- private
206
+ private
207
207
 
208
208
  def prune_gem_cache(resolve, cache_path)
209
209
  cached = Dir["#{cache_path}/*.gem"]
@@ -42,7 +42,6 @@ module Bundler
42
42
  setup_makes_kernel_gem_public
43
43
  silence_deprecations
44
44
  silence_root_warning
45
- specific_platform
46
45
  suppress_install_using_messages
47
46
  unlock_source_unlocks_spec
48
47
  update_requires_all_flag
@@ -63,30 +62,25 @@ module Bundler
63
62
  ].freeze
64
63
 
65
64
  DEFAULT_CONFIG = {
66
- :silence_deprecations => false,
67
- :disable_version_check => true,
68
- :prefer_patch => false,
69
- :redirect => 5,
70
- :retry => 3,
71
- :timeout => 10,
65
+ "BUNDLE_SILENCE_DEPRECATIONS" => false,
66
+ "BUNDLE_DISABLE_VERSION_CHECK" => true,
67
+ "BUNDLE_PREFER_PATCH" => false,
68
+ "BUNDLE_REDIRECT" => 5,
69
+ "BUNDLE_RETRY" => 3,
70
+ "BUNDLE_TIMEOUT" => 10,
72
71
  }.freeze
73
72
 
74
73
  def initialize(root = nil)
75
74
  @root = root
76
75
  @local_config = load_config(local_config_file)
76
+ @env_config = ENV.to_h.select {|key, _value| key =~ /\ABUNDLE_.+/ }
77
77
  @global_config = load_config(global_config_file)
78
78
  @temporary = {}
79
79
  end
80
80
 
81
81
  def [](name)
82
82
  key = key_for(name)
83
- value = @temporary.fetch(key) do
84
- @local_config.fetch(key) do
85
- ENV.fetch(key) do
86
- @global_config.fetch(key) do
87
- DEFAULT_CONFIG.fetch(name) do
88
- nil
89
- end end end end end
83
+ value = configs.values.map {|config| config[key] }.compact.first
90
84
 
91
85
  converted_value(value, name)
92
86
  end
@@ -129,9 +123,7 @@ module Bundler
129
123
  end
130
124
 
131
125
  def all
132
- env_keys = ENV.keys.grep(/\ABUNDLE_.+/)
133
-
134
- keys = @temporary.keys | @global_config.keys | @local_config.keys | env_keys
126
+ keys = @temporary.keys | @global_config.keys | @local_config.keys | @env_config.keys
135
127
 
136
128
  keys.map do |key|
137
129
  key.sub(/^BUNDLE_/, "").gsub(/__/, ".").downcase
@@ -168,13 +160,11 @@ module Bundler
168
160
 
169
161
  def locations(key)
170
162
  key = key_for(key)
171
- locations = {}
172
- locations[:temporary] = @temporary[key] if @temporary.key?(key)
173
- locations[:local] = @local_config[key] if @local_config.key?(key)
174
- locations[:env] = ENV[key] if ENV[key]
175
- locations[:global] = @global_config[key] if @global_config.key?(key)
176
- locations[:default] = DEFAULT_CONFIG[key] if DEFAULT_CONFIG.key?(key)
177
- locations
163
+ configs.keys.inject({}) do |partial_locations, level|
164
+ value_on_level = configs[level][key]
165
+ partial_locations[level] = value_on_level unless value_on_level.nil?
166
+ partial_locations
167
+ end
178
168
  end
179
169
 
180
170
  def pretty_values_for(exposed_key)
@@ -182,20 +172,20 @@ module Bundler
182
172
 
183
173
  locations = []
184
174
 
185
- if @temporary.key?(key)
186
- locations << "Set for the current command: #{converted_value(@temporary[key], exposed_key).inspect}"
175
+ if value = @temporary[key]
176
+ locations << "Set for the current command: #{converted_value(value, exposed_key).inspect}"
187
177
  end
188
178
 
189
- if @local_config.key?(key)
190
- locations << "Set for your local app (#{local_config_file}): #{converted_value(@local_config[key], exposed_key).inspect}"
179
+ if value = @local_config[key]
180
+ locations << "Set for your local app (#{local_config_file}): #{converted_value(value, exposed_key).inspect}"
191
181
  end
192
182
 
193
- if value = ENV[key]
183
+ if value = @env_config[key]
194
184
  locations << "Set via #{key}: #{converted_value(value, exposed_key).inspect}"
195
185
  end
196
186
 
197
- if @global_config.key?(key)
198
- locations << "Set for the current user (#{global_config_file}): #{converted_value(@global_config[key], exposed_key).inspect}"
187
+ if value = @global_config[key]
188
+ locations << "Set for the current user (#{global_config_file}): #{converted_value(value, exposed_key).inspect}"
199
189
  end
200
190
 
201
191
  return ["You have not configured a value for `#{exposed_key}`"] if locations.empty?
@@ -204,17 +194,19 @@ module Bundler
204
194
 
205
195
  # for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
206
196
  def path
207
- key = key_for(:path)
208
- path = ENV[key] || @global_config[key]
209
- if path && !@temporary.key?(key) && !@local_config.key?(key)
210
- return Path.new(path, false, false)
197
+ configs.each do |_level, settings|
198
+ path = value_for("path", settings)
199
+ path_system = value_for("path.system", settings)
200
+ disabled_shared_gems = value_for("disable_shared_gems", settings)
201
+ next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
202
+ system_path = path_system || (disabled_shared_gems == false)
203
+ return Path.new(path, system_path)
211
204
  end
212
205
 
213
- system_path = self["path.system"] || (self[:disable_shared_gems] == false)
214
- Path.new(self[:path], system_path, Bundler.feature_flag.default_install_uses_path?)
206
+ Path.new(nil, false)
215
207
  end
216
208
 
217
- Path = Struct.new(:explicit_path, :system_path, :default_install_uses_path) do
209
+ Path = Struct.new(:explicit_path, :system_path) do
218
210
  def path
219
211
  path = base_path
220
212
  path = File.join(path, Bundler.ruby_scope) unless use_system_gems?
@@ -224,7 +216,7 @@ module Bundler
224
216
  def use_system_gems?
225
217
  return true if system_path
226
218
  return false if explicit_path
227
- !default_install_uses_path
219
+ !Bundler.feature_flag.default_install_uses_path?
228
220
  end
229
221
 
230
222
  def base_path
@@ -277,9 +269,9 @@ module Bundler
277
269
 
278
270
  def validate!
279
271
  all.each do |raw_key|
280
- [@local_config, ENV, @global_config].each do |settings|
281
- value = converted_value(settings[key_for(raw_key)], raw_key)
282
- Validator.validate!(raw_key, value, settings.to_hash.dup)
272
+ [@local_config, @env_config, @global_config].each do |settings|
273
+ value = value_for(raw_key, settings)
274
+ Validator.validate!(raw_key, value, settings.dup)
283
275
  end
284
276
  end
285
277
  end
@@ -290,7 +282,21 @@ module Bundler
290
282
  "BUNDLE_#{key}"
291
283
  end
292
284
 
293
- private
285
+ private
286
+
287
+ def configs
288
+ {
289
+ :temporary => @temporary,
290
+ :local => @local_config,
291
+ :env => @env_config,
292
+ :global => @global_config,
293
+ :default => DEFAULT_CONFIG,
294
+ }
295
+ end
296
+
297
+ def value_for(name, config)
298
+ converted_value(config[key_for(name)], name)
299
+ end
294
300
 
295
301
  def parent_setting_for(name)
296
302
  split_specific_setting_for(name)[0]
@@ -212,7 +212,7 @@ module Bundler
212
212
  filesystem_access(gemfile_path) {|g| File.open(g, "w") {|file| file.puts contents } }
213
213
  end
214
214
 
215
- private
215
+ private
216
216
 
217
217
  def validate_bundle_path
218
218
  path_separator = Bundler.rubygems.path_separator
@@ -26,7 +26,7 @@ module Bundler
26
26
  end
27
27
  end
28
28
 
29
- protected
29
+ protected
30
30
 
31
31
  # https://www.informit.com/articles/article.aspx?p=683059&seqNum=36
32
32
  def levenshtein_distance(this, that, ins = 2, del = 2, sub = 1)
@@ -63,7 +63,7 @@ module Bundler
63
63
  )
64
64
  end
65
65
 
66
- private
66
+ private
67
67
 
68
68
  def version_color(spec_version, locked_spec_version)
69
69
  if Gem::Version.correct?(spec_version) && Gem::Version.correct?(locked_spec_version)
@@ -234,7 +234,7 @@ module Bundler
234
234
  @local
235
235
  end
236
236
 
237
- private
237
+ private
238
238
 
239
239
  def serialize_gemspecs_in(destination)
240
240
  destination = destination.expand_path(Bundler.root) if destination.relative?
@@ -118,7 +118,7 @@ module Bundler
118
118
  git_retry %(clone --no-checkout --quiet "#{path}" "#{destination}")
119
119
  File.chmod(((File.stat(destination).mode | 0o777) & ~File.umask), destination)
120
120
  rescue Errno::EEXIST => e
121
- file_path = e.message[%r{.*?(/.*)}, 1]
121
+ file_path = e.message[%r{.*?((?:[a-zA-Z]:)?/.*)}, 1]
122
122
  raise GitError, "Bundler could not install a gem because it needs to " \
123
123
  "create a directory, but a file exists - #{file_path}. Please delete " \
124
124
  "this file and try again."
@@ -136,11 +136,13 @@ module Bundler
136
136
  if submodules
137
137
  git_retry "submodule update --init --recursive", :dir => destination
138
138
  elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0")
139
- git_retry "submodule deinit --all --force", :dir => destination
139
+ inner_command = "git -C $toplevel submodule deinit --force $sm_path"
140
+ inner_command = inner_command.gsub("$") { '\$' } unless Bundler::WINDOWS
141
+ git_retry "submodule foreach --quiet \"#{inner_command}\"", :dir => destination
140
142
  end
141
143
  end
142
144
 
143
- private
145
+ private
144
146
 
145
147
  def git_null(command, dir: SharedHelpers.pwd)
146
148
  check_allowed(command)
@@ -125,7 +125,7 @@ module Bundler
125
125
  @expanded_original_path ||= expand(original_path)
126
126
  end
127
127
 
128
- private
128
+ private
129
129
 
130
130
  def expanded_path
131
131
  @expanded_path ||= expand(path)
@@ -171,7 +171,7 @@ module Bundler
171
171
 
172
172
  if File.directory?(expanded_path)
173
173
  # We sort depth-first since `<<` will override the earlier-found specs
174
- Dir["#{expanded_path}/#{@glob}"].sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
174
+ Gem::Util.glob_files_in_dir(@glob, expanded_path).sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
175
175
  next unless spec = load_gemspec(file)
176
176
  spec.source = self
177
177
 
@@ -40,7 +40,7 @@ module Bundler
40
40
  Bundler.rm_rf(@tmp_dir) if Bundler.requires_sudo?
41
41
  end
42
42
 
43
- private
43
+ private
44
44
 
45
45
  def generate_bin
46
46
  super
@@ -291,7 +291,7 @@ module Bundler
291
291
  names
292
292
  end
293
293
 
294
- protected
294
+ protected
295
295
 
296
296
  def credless_remotes
297
297
  remotes.map(&method(:suppress_configured_credentials))
@@ -465,7 +465,7 @@ module Bundler
465
465
  Bundler.app_cache
466
466
  end
467
467
 
468
- private
468
+ private
469
469
 
470
470
  # Checks if the requested spec exists in the global cache. If it does,
471
471
  # we copy it to the download path, and if it does not, we download it.
@@ -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?
@@ -116,7 +116,7 @@ module Bundler
116
116
  @rubygems_aggregate.remotes
117
117
  end
118
118
 
119
- private
119
+ private
120
120
 
121
121
  def rubygems_aggregate_class
122
122
  Source::Rubygems
@@ -147,7 +147,7 @@ module Bundler
147
147
  if source.uri =~ /^git\:/
148
148
  Bundler.ui.warn "The git source `#{source.uri}` uses the `git` protocol, " \
149
149
  "which transmits data without encryption. Disable this warning with " \
150
- "`bundle config set git.allow_insecure true`, or switch to the `https` " \
150
+ "`bundle config set --local git.allow_insecure true`, or switch to the `https` " \
151
151
  "protocol to keep your data secure."
152
152
  end
153
153
  end
@@ -22,10 +22,11 @@ module Bundler
22
22
  break unless dep = deps.shift
23
23
  next if !handled.add?(dep) || skip.include?(dep.name)
24
24
 
25
- if spec = spec_for_dependency(dep, match_current_platform)
26
- specs << spec
25
+ specs_for_dep = spec_for_dependency(dep, match_current_platform)
26
+ if specs_for_dep.any?
27
+ specs += specs_for_dep
27
28
 
28
- spec.dependencies.each do |d|
29
+ specs_for_dep.first.dependencies.each do |d|
29
30
  next if d.type == :development
30
31
  d = DepProxy.new(d, dep.__platform) unless match_current_platform
31
32
  deps << d
@@ -100,6 +101,7 @@ module Bundler
100
101
  @specs.map do |s|
101
102
  next s unless s.is_a?(LazySpecification)
102
103
  s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
104
+ s.source.remote!
103
105
  spec = s.__materialize__
104
106
  raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
105
107
  spec
@@ -147,7 +149,7 @@ module Bundler
147
149
  sorted.each(&b)
148
150
  end
149
151
 
150
- private
152
+ private
151
153
 
152
154
  def sorted
153
155
  rake = @specs.find {|s| s.name == "rake" }
@@ -183,11 +185,7 @@ module Bundler
183
185
  def spec_for_dependency(dep, match_current_platform)
184
186
  specs_for_platforms = lookup[dep.name]
185
187
  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
188
+ GemHelpers.select_best_platform_match(specs_for_platforms, Bundler.local_platform)
191
189
  else
192
190
  GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
193
191
  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)
@@ -83,7 +81,7 @@ module Bundler
83
81
  stub.raw_require_paths
84
82
  end
85
83
 
86
- private
84
+ private
87
85
 
88
86
  def _remote_specification
89
87
  @_remote_specification ||= begin
@@ -28,12 +28,11 @@ TODO: Write usage instructions here
28
28
 
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
- 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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
32
 
33
33
  ## Contributing
34
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
-
37
36
  <% if config[:mit] -%>
38
37
 
39
38
  ## License
@@ -1,6 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
4
3
 
5
4
  require "bundler/setup"
6
5
  require "<%= config[:namespaced_path] %>"
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "<%= config[:namespaced_path] %>/version"
3
+ require_relative "<%= File.basename(config[:namespaced_path]) %>/version"
4
4
  <%- if config[:ext] -%>
5
- require "<%= config[:namespaced_path] %>/<%= config[:underscored_name] %>"
5
+ require_relative "<%= File.basename(config[:namespaced_path]) %>/<%= config[:underscored_name] %>"
6
6
  <%- end -%>
7
7
 
8
8
  <%- config[:constant_array].each_with_index do |c, i| -%>
@@ -25,12 +25,18 @@ Gem::Specification.new do |spec|
25
25
  # Specify which files should be added to the gem when it is released.
26
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
27
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
28
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
29
29
  end
30
30
  spec.bindir = "exe"
31
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ["lib"]
33
33
  <%- if config[:ext] -%>
34
34
  spec.extensions = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
35
35
  <%- end -%>
36
+
37
+ # Uncomment to register a new dependency of your gem
38
+ # spec.add_dependency "example-gem", "~> 1.0"
39
+
40
+ # For more information and examples about making a new gem, checkout our
41
+ # guide at: https://bundler.io/guides/creating_gem.html
36
42
  end