bundler 2.5.5 → 2.5.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +171 -0
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/cli/binstubs.rb +1 -1
  5. data/lib/bundler/cli/fund.rb +1 -1
  6. data/lib/bundler/cli/gem.rb +8 -15
  7. data/lib/bundler/cli/install.rb +1 -1
  8. data/lib/bundler/cli/lock.rb +5 -4
  9. data/lib/bundler/cli/plugin.rb +3 -2
  10. data/lib/bundler/cli.rb +14 -31
  11. data/lib/bundler/compact_index_client/cache.rb +47 -72
  12. data/lib/bundler/compact_index_client/parser.rb +84 -0
  13. data/lib/bundler/compact_index_client.rb +51 -80
  14. data/lib/bundler/constants.rb +8 -1
  15. data/lib/bundler/definition.rb +168 -99
  16. data/lib/bundler/dependency.rb +2 -1
  17. data/lib/bundler/dsl.rb +16 -1
  18. data/lib/bundler/endpoint_specification.rb +11 -0
  19. data/lib/bundler/env.rb +1 -1
  20. data/lib/bundler/environment_preserver.rb +5 -23
  21. data/lib/bundler/errors.rb +14 -0
  22. data/lib/bundler/fetcher/compact_index.rb +15 -24
  23. data/lib/bundler/fetcher/downloader.rb +1 -1
  24. data/lib/bundler/fetcher.rb +2 -2
  25. data/lib/bundler/gem_helper.rb +1 -1
  26. data/lib/bundler/gem_helpers.rb +14 -7
  27. data/lib/bundler/gem_version_promoter.rb +42 -38
  28. data/lib/bundler/injector.rb +4 -6
  29. data/lib/bundler/installer/gem_installer.rb +0 -1
  30. data/lib/bundler/installer/standalone.rb +0 -3
  31. data/lib/bundler/installer.rb +11 -13
  32. data/lib/bundler/lazy_specification.rb +1 -0
  33. data/lib/bundler/man/bundle-add.1 +1 -1
  34. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  35. data/lib/bundler/man/bundle-cache.1 +1 -1
  36. data/lib/bundler/man/bundle-check.1 +3 -1
  37. data/lib/bundler/man/bundle-check.1.ronn +3 -0
  38. data/lib/bundler/man/bundle-clean.1 +1 -1
  39. data/lib/bundler/man/bundle-config.1 +2 -4
  40. data/lib/bundler/man/bundle-config.1.ronn +1 -4
  41. data/lib/bundler/man/bundle-console.1 +1 -1
  42. data/lib/bundler/man/bundle-doctor.1 +1 -1
  43. data/lib/bundler/man/bundle-exec.1 +1 -1
  44. data/lib/bundler/man/bundle-gem.1 +7 -1
  45. data/lib/bundler/man/bundle-gem.1.ronn +11 -0
  46. data/lib/bundler/man/bundle-help.1 +1 -1
  47. data/lib/bundler/man/bundle-info.1 +1 -1
  48. data/lib/bundler/man/bundle-init.1 +1 -1
  49. data/lib/bundler/man/bundle-inject.1 +1 -1
  50. data/lib/bundler/man/bundle-install.1 +3 -3
  51. data/lib/bundler/man/bundle-install.1.ronn +2 -2
  52. data/lib/bundler/man/bundle-list.1 +1 -1
  53. data/lib/bundler/man/bundle-lock.1 +1 -1
  54. data/lib/bundler/man/bundle-open.1 +1 -1
  55. data/lib/bundler/man/bundle-outdated.1 +1 -1
  56. data/lib/bundler/man/bundle-platform.1 +1 -1
  57. data/lib/bundler/man/bundle-plugin.1 +7 -4
  58. data/lib/bundler/man/bundle-plugin.1.ronn +7 -3
  59. data/lib/bundler/man/bundle-pristine.1 +1 -1
  60. data/lib/bundler/man/bundle-remove.1 +1 -1
  61. data/lib/bundler/man/bundle-show.1 +1 -1
  62. data/lib/bundler/man/bundle-update.1 +1 -1
  63. data/lib/bundler/man/bundle-version.1 +1 -1
  64. data/lib/bundler/man/bundle-viz.1 +1 -1
  65. data/lib/bundler/man/bundle.1 +1 -1
  66. data/lib/bundler/man/gemfile.5 +3 -3
  67. data/lib/bundler/man/gemfile.5.ronn +2 -2
  68. data/lib/bundler/mirror.rb +3 -3
  69. data/lib/bundler/plugin/api/source.rb +2 -2
  70. data/lib/bundler/plugin/installer/path.rb +18 -0
  71. data/lib/bundler/plugin/installer.rb +36 -16
  72. data/lib/bundler/plugin/source_list.rb +4 -4
  73. data/lib/bundler/resolver/base.rb +4 -0
  74. data/lib/bundler/resolver/candidate.rb +5 -17
  75. data/lib/bundler/resolver/package.rb +4 -0
  76. data/lib/bundler/resolver/spec_group.rb +20 -2
  77. data/lib/bundler/resolver.rb +72 -33
  78. data/lib/bundler/rubygems_ext.rb +98 -10
  79. data/lib/bundler/rubygems_gem_installer.rb +35 -2
  80. data/lib/bundler/rubygems_integration.rb +16 -2
  81. data/lib/bundler/runtime.rb +2 -2
  82. data/lib/bundler/self_manager.rb +22 -2
  83. data/lib/bundler/settings.rb +26 -20
  84. data/lib/bundler/setup.rb +6 -0
  85. data/lib/bundler/shared_helpers.rb +6 -4
  86. data/lib/bundler/source/git/git_proxy.rb +9 -1
  87. data/lib/bundler/source/git.rb +15 -1
  88. data/lib/bundler/source/metadata.rb +2 -0
  89. data/lib/bundler/source/path.rb +0 -13
  90. data/lib/bundler/source/rubygems/remote.rb +1 -1
  91. data/lib/bundler/source/rubygems.rb +33 -32
  92. data/lib/bundler/source_list.rb +26 -2
  93. data/lib/bundler/spec_set.rb +15 -13
  94. data/lib/bundler/stub_specification.rb +8 -0
  95. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  96. data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -3
  97. data/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
  98. data/lib/bundler/uri_credentials_filter.rb +2 -2
  99. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +22 -22
  100. data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +1 -0
  101. data/lib/bundler/vendored_net_http.rb +20 -5
  102. data/lib/bundler/vendored_timeout.rb +7 -3
  103. data/lib/bundler/vendored_uri.rb +18 -1
  104. data/lib/bundler/version.rb +1 -1
  105. data/lib/bundler/yaml_serializer.rb +11 -6
  106. data/lib/bundler.rb +29 -3
  107. metadata +5 -3
@@ -182,6 +182,14 @@ module Bundler
182
182
  if err.include?("Could not find remote branch")
183
183
  raise MissingGitRevisionError.new(command_with_no_credentials, nil, explicit_ref, credential_filtered_uri)
184
184
  else
185
+ idx = command.index("--depth")
186
+ if idx
187
+ command.delete_at(idx)
188
+ command.delete_at(idx)
189
+ command_with_no_credentials = check_allowed(command)
190
+
191
+ err += "Retrying without --depth argument."
192
+ end
185
193
  raise GitCommandError.new(command_with_no_credentials, path, err)
186
194
  end
187
195
  end
@@ -320,7 +328,7 @@ module Bundler
320
328
  # Adds credentials to the URI
321
329
  def configured_uri
322
330
  if /https?:/.match?(uri)
323
- remote = Bundler::URI(uri)
331
+ remote = Gem::URI(uri)
324
332
  config_auth = Bundler.settings[remote.to_s] || Bundler.settings[remote.host]
325
333
  remote.userinfo ||= config_auth
326
334
  remote.to_s
@@ -32,6 +32,20 @@ module Bundler
32
32
  @local = false
33
33
  end
34
34
 
35
+ def remote!
36
+ return if @allow_remote
37
+
38
+ @local_specs = nil
39
+ @allow_remote = true
40
+ end
41
+
42
+ def cached!
43
+ return if @allow_cached
44
+
45
+ @local_specs = nil
46
+ @allow_cached = true
47
+ end
48
+
35
49
  def self.from_lock(options)
36
50
  new(options.merge("uri" => options.delete("remote")))
37
51
  end
@@ -326,7 +340,7 @@ module Bundler
326
340
  if %r{^\w+://(\w+@)?}.match?(uri)
327
341
  # Downcase the domain component of the URI
328
342
  # and strip off a trailing slash, if one is present
329
- input = Bundler::URI.parse(uri).normalize.to_s.sub(%r{/$}, "")
343
+ input = Gem::URI.parse(uri).normalize.to_s.sub(%r{/$}, "")
330
344
  else
331
345
  # If there is no URI scheme, assume it is an ssh/git URI
332
346
  input = uri
@@ -11,6 +11,8 @@ module Bundler
11
11
  end
12
12
 
13
13
  if local_spec = Gem.loaded_specs["bundler"]
14
+ raise CorruptBundlerInstallError.new(local_spec) if local_spec.version.to_s != Bundler::VERSION
15
+
14
16
  idx << local_spec
15
17
  else
16
18
  idx << Gem::Specification.new do |s|
@@ -18,9 +18,6 @@ module Bundler
18
18
  @options = options.dup
19
19
  @glob = options["glob"] || DEFAULT_GLOB
20
20
 
21
- @allow_cached = false
22
- @allow_remote = false
23
-
24
21
  @root_path = options["root_path"] || root
25
22
 
26
23
  if options["path"]
@@ -41,16 +38,6 @@ module Bundler
41
38
  @original_path = @path
42
39
  end
43
40
 
44
- def remote!
45
- @local_specs = nil
46
- @allow_remote = true
47
- end
48
-
49
- def cached!
50
- @local_specs = nil
51
- @allow_cached = true
52
- end
53
-
54
41
  def self.from_lock(options)
55
42
  new(options.merge("path" => options.delete("remote")))
56
43
  end
@@ -48,7 +48,7 @@ module Bundler
48
48
  end
49
49
 
50
50
  uri
51
- rescue Bundler::URI::InvalidComponentError
51
+ rescue Gem::URI::InvalidComponentError
52
52
  error_message = "Please CGI escape your usernames and passwords before " \
53
53
  "setting them for authentication."
54
54
  raise HTTPError.new(error_message)
@@ -10,7 +10,7 @@ module Bundler
10
10
  # Ask for X gems per API request
11
11
  API_REQUEST_SIZE = 50
12
12
 
13
- attr_reader :remotes
13
+ attr_accessor :remotes
14
14
 
15
15
  def initialize(options = {})
16
16
  @options = options
@@ -22,6 +22,8 @@ module Bundler
22
22
  @checksum_store = Checksum::Store.new
23
23
 
24
24
  Array(options["remotes"]).reverse_each {|r| add_remote(r) }
25
+
26
+ @lockfile_remotes = @remotes if options["from_lockfile"]
25
27
  end
26
28
 
27
29
  def caches
@@ -50,10 +52,11 @@ module Bundler
50
52
  end
51
53
 
52
54
  def cached!
55
+ return unless File.exist?(cache_path)
56
+
53
57
  return if @allow_cached
54
58
 
55
59
  @specs = nil
56
- @allow_local = true
57
60
  @allow_cached = true
58
61
  end
59
62
 
@@ -90,13 +93,13 @@ module Bundler
90
93
 
91
94
  def self.from_lock(options)
92
95
  options["remotes"] = Array(options.delete("remote")).reverse
93
- new(options)
96
+ new(options.merge("from_lockfile" => true))
94
97
  end
95
98
 
96
99
  def to_lock
97
100
  out = String.new("GEM\n")
98
- remotes.reverse_each do |remote|
99
- out << " remote: #{suppress_configured_credentials remote}\n"
101
+ lockfile_remotes.reverse_each do |remote|
102
+ out << " remote: #{remote}\n"
100
103
  end
101
104
  out << " specs:\n"
102
105
  end
@@ -133,22 +136,19 @@ module Bundler
133
136
  # sources, and large_idx.merge! small_idx is way faster than
134
137
  # small_idx.merge! large_idx.
135
138
  index = @allow_remote ? remote_specs.dup : Index.new
136
- index.merge!(cached_specs) if @allow_cached || @allow_remote
139
+ index.merge!(cached_specs) if @allow_cached
137
140
  index.merge!(installed_specs) if @allow_local
141
+
142
+ # complete with default specs, only if not already available in the
143
+ # index through remote, cached, or installed specs
144
+ index.use(default_specs) if @allow_local
145
+
138
146
  index
139
147
  end
140
148
  end
141
149
 
142
150
  def install(spec, options = {})
143
- force = options[:force]
144
- ensure_builtin_gems_cached = options[:ensure_builtin_gems_cached]
145
-
146
- if ensure_builtin_gems_cached && spec.default_gem? && !cached_path(spec)
147
- cached_built_in_gem(spec) unless spec.remote
148
- force = true
149
- end
150
-
151
- if installed?(spec) && !force
151
+ if (spec.default_gem? && !cached_built_in_gem(spec)) || (installed?(spec) && !options[:force])
152
152
  print_using_message "Using #{version_message(spec, options[:previous_spec])}"
153
153
  return nil # no post-install message
154
154
  end
@@ -206,6 +206,7 @@ module Bundler
206
206
 
207
207
  spec.full_gem_path = installed_spec.full_gem_path
208
208
  spec.loaded_from = installed_spec.loaded_from
209
+ spec.base_dir = installed_spec.base_dir
209
210
 
210
211
  spec.post_install_message
211
212
  end
@@ -312,11 +313,7 @@ module Bundler
312
313
  end
313
314
 
314
315
  def credless_remotes
315
- if Bundler.settings[:allow_deployment_source_credential_changes]
316
- remotes.map(&method(:remove_auth))
317
- else
318
- remotes.map(&method(:suppress_configured_credentials))
319
- end
316
+ remotes.map(&method(:remove_auth))
320
317
  end
321
318
 
322
319
  def remotes_for_spec(spec)
@@ -349,21 +346,12 @@ module Bundler
349
346
  def normalize_uri(uri)
350
347
  uri = URINormalizer.normalize_suffix(uri.to_s)
351
348
  require_relative "../vendored_uri"
352
- uri = Bundler::URI(uri)
349
+ uri = Gem::URI(uri)
353
350
  raise ArgumentError, "The source must be an absolute URI. For example:\n" \
354
- "source 'https://rubygems.org'" if !uri.absolute? || (uri.is_a?(Bundler::URI::HTTP) && uri.host.nil?)
351
+ "source 'https://rubygems.org'" if !uri.absolute? || (uri.is_a?(Gem::URI::HTTP) && uri.host.nil?)
355
352
  uri
356
353
  end
357
354
 
358
- def suppress_configured_credentials(remote)
359
- remote_nouser = remove_auth(remote)
360
- if remote.userinfo && remote.userinfo == Bundler.settings[remote_nouser]
361
- remote_nouser
362
- else
363
- remote
364
- end
365
- end
366
-
367
355
  def remove_auth(remote)
368
356
  if remote.user || remote.password
369
357
  remote.dup.tap {|uri| uri.user = uri.password = nil }.to_s
@@ -374,7 +362,7 @@ module Bundler
374
362
 
375
363
  def installed_specs
376
364
  @installed_specs ||= Index.build do |idx|
377
- Bundler.rubygems.all_specs.reverse_each do |spec|
365
+ Bundler.rubygems.installed_specs.reverse_each do |spec|
378
366
  spec.source = self
379
367
  if Bundler.rubygems.spec_missing_extensions?(spec, false)
380
368
  Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
@@ -385,6 +373,15 @@ module Bundler
385
373
  end
386
374
  end
387
375
 
376
+ def default_specs
377
+ @default_specs ||= Index.build do |idx|
378
+ Bundler.rubygems.default_specs.each do |spec|
379
+ spec.source = self
380
+ idx << spec
381
+ end
382
+ end
383
+ end
384
+
388
385
  def cached_specs
389
386
  @cached_specs ||= begin
390
387
  idx = Index.new
@@ -469,6 +466,10 @@ module Bundler
469
466
 
470
467
  private
471
468
 
469
+ def lockfile_remotes
470
+ @lockfile_remotes || credless_remotes
471
+ end
472
+
472
473
  # Checks if the requested spec exists in the global cache. If it does,
473
474
  # we copy it to the download path, and if it does not, we download it.
474
475
  #
@@ -22,6 +22,7 @@ module Bundler
22
22
  @metadata_source = Source::Metadata.new
23
23
 
24
24
  @merged_gem_lockfile_sections = false
25
+ @local_mode = true
25
26
  end
26
27
 
27
28
  def merged_gem_lockfile_sections?
@@ -73,6 +74,10 @@ module Bundler
73
74
  global_rubygems_source
74
75
  end
75
76
 
77
+ def local_mode?
78
+ @local_mode
79
+ end
80
+
76
81
  def default_source
77
82
  global_path_source || global_rubygems_source
78
83
  end
@@ -140,11 +145,17 @@ module Bundler
140
145
  all_sources.each(&:local_only!)
141
146
  end
142
147
 
148
+ def local!
149
+ all_sources.each(&:local!)
150
+ end
151
+
143
152
  def cached!
144
153
  all_sources.each(&:cached!)
145
154
  end
146
155
 
147
156
  def remote!
157
+ @local_mode = false
158
+
148
159
  all_sources.each(&:remote!)
149
160
  end
150
161
 
@@ -157,7 +168,11 @@ module Bundler
157
168
  end
158
169
 
159
170
  def map_sources(replacement_sources)
160
- rubygems, git, plugin = [@rubygems_sources, @git_sources, @plugin_sources].map do |sources|
171
+ rubygems = @rubygems_sources.map do |source|
172
+ replace_rubygems_source(replacement_sources, source) || source
173
+ end
174
+
175
+ git, plugin = [@git_sources, @plugin_sources].map do |sources|
161
176
  sources.map do |source|
162
177
  replacement_sources.find {|s| s == source } || source
163
178
  end
@@ -171,13 +186,22 @@ module Bundler
171
186
  end
172
187
 
173
188
  def global_replacement_source(replacement_sources)
174
- replacement_source = replacement_sources.find {|s| s == global_rubygems_source }
189
+ replacement_source = replace_rubygems_source(replacement_sources, global_rubygems_source)
175
190
  return global_rubygems_source unless replacement_source
176
191
 
177
192
  replacement_source.local!
178
193
  replacement_source
179
194
  end
180
195
 
196
+ def replace_rubygems_source(replacement_sources, gemfile_source)
197
+ replacement_source = replacement_sources.find {|s| s == gemfile_source }
198
+ return unless replacement_source
199
+
200
+ # locked sources never include credentials so always prefer remotes from the gemfile
201
+ replacement_source.remotes = gemfile_source.remotes
202
+ replacement_source
203
+ end
204
+
181
205
  def different_sources?(lock_sources, replacement_sources)
182
206
  !equivalent_sources?(lock_sources, replacement_sources)
183
207
  end
@@ -65,18 +65,12 @@ module Bundler
65
65
 
66
66
  platforms.concat(new_platforms)
67
67
 
68
- less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && platform === Bundler.local_platform }
68
+ less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform }
69
69
  platforms.delete(Bundler.local_platform) if less_specific_platform
70
70
 
71
71
  platforms
72
72
  end
73
73
 
74
- def complete_platforms!(platforms)
75
- platforms.each do |platform|
76
- complete_platform(platform)
77
- end
78
- end
79
-
80
74
  def validate_deps(s)
81
75
  s.runtime_dependencies.each do |dep|
82
76
  next if dep.name == "bundler"
@@ -158,6 +152,12 @@ module Bundler
158
152
  @specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
159
153
  end
160
154
 
155
+ def specs_compatible_with(other)
156
+ select do |spec|
157
+ other.valid?(spec)
158
+ end
159
+ end
160
+
161
161
  def delete_by_name(name)
162
162
  @specs.reject! {|spec| spec.name == name }
163
163
 
@@ -195,6 +195,10 @@ module Bundler
195
195
  lookup.keys
196
196
  end
197
197
 
198
+ def valid?(s)
199
+ s.matches_current_metadata? && valid_dependencies?(s)
200
+ end
201
+
198
202
  private
199
203
 
200
204
  def reset!
@@ -209,7 +213,7 @@ module Bundler
209
213
  spec = specs.first
210
214
  matching_specs = spec.source.specs.search([spec.name, spec.version])
211
215
  platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
212
- s.matches_current_metadata? && valid_dependencies?(s)
216
+ valid?(s)
213
217
  end
214
218
 
215
219
  if platform_spec
@@ -273,13 +277,11 @@ module Bundler
273
277
  specs_for_name = lookup[dep.name]
274
278
  return [] unless specs_for_name
275
279
 
276
- matching_specs = if dep.force_ruby_platform
277
- GemHelpers.force_ruby_platform(specs_for_name)
280
+ if platform
281
+ GemHelpers.select_best_platform_match(specs_for_name, platform, force_ruby: dep.force_ruby_platform)
278
282
  else
279
- GemHelpers.select_best_platform_match(specs_for_name, platform || Bundler.local_platform)
283
+ GemHelpers.select_best_local_platform_match(specs_for_name, force_ruby: dep.force_ruby_platform)
280
284
  end
281
- matching_specs.map!(&:materialize_for_installation).compact! if platform.nil?
282
- matching_specs
283
285
  end
284
286
 
285
287
  def tsort_each_child(s)
@@ -77,6 +77,14 @@ module Bundler
77
77
  stub.full_require_paths
78
78
  end
79
79
 
80
+ def require_paths
81
+ stub.require_paths
82
+ end
83
+
84
+ def base_dir=(path)
85
+ stub.base_dir = path
86
+ end
87
+
80
88
  def load_paths
81
89
  full_require_paths
82
90
  end
@@ -2,83 +2,131 @@
2
2
 
3
3
  ## Our Pledge
4
4
 
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.
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
6
11
 
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
8
14
 
9
15
  ## Our Standards
10
16
 
11
- Examples of behavior that contributes to a positive environment for our community include:
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
12
19
 
13
20
  * Demonstrating empathy and kindness toward other people
14
21
  * Being respectful of differing opinions, viewpoints, and experiences
15
22
  * 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
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
18
27
 
19
28
  Examples of unacceptable behavior include:
20
29
 
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
23
32
  * Trolling, insulting or derogatory comments, and personal or political attacks
24
33
  * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
27
36
  * Other conduct which could reasonably be considered inappropriate in a
28
37
  professional setting
29
38
 
30
39
  ## Enforcement Responsibilities
31
40
 
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.
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
33
45
 
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.
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
35
50
 
36
51
  ## Scope
37
52
 
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.
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
39
58
 
40
59
  ## Enforcement
41
60
 
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.
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
43
65
 
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
45
68
 
46
69
  ## Enforcement Guidelines
47
70
 
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:
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
49
73
 
50
74
  ### 1. Correction
51
75
 
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
53
78
 
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.
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
55
82
 
56
83
  ### 2. Warning
57
84
 
58
- **Community Impact**: A violation through a single incident or series of actions.
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
59
87
 
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.
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
61
94
 
62
95
  ### 3. Temporary Ban
63
96
 
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
65
99
 
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.
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
67
105
 
68
106
  ### 4. Permanent Ban
69
107
 
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.
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
71
111
 
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
73
114
 
74
115
  ## Attribution
75
116
 
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.
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
78
120
 
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
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
82
123
 
83
124
  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.
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -27,9 +27,10 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  # Specify which files should be added to the gem when it is released.
29
29
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
- spec.files = Dir.chdir(__dir__) do
31
- `git ls-files -z`.split("\x0").reject do |f|
32
- (File.expand_path(f) == __FILE__) ||
30
+ gemspec = File.basename(__FILE__)
31
+ spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
32
+ ls.readlines("\x0", chomp: true).reject do |f|
33
+ (f == gemspec) ||
33
34
  f.start_with?(*%w[bin/ test/ spec/ features/ .git <%= config[:ci_config_path] %>appveyor Gemfile])
34
35
  end
35
36
  end
@@ -2,12 +2,7 @@ AllCops:
2
2
  TargetRubyVersion: <%= ::Gem::Version.new(config[:required_ruby_version]).segments[0..1].join(".") %>
3
3
 
4
4
  Style/StringLiterals:
5
- Enabled: true
6
5
  EnforcedStyle: double_quotes
7
6
 
8
7
  Style/StringLiteralsInInterpolation:
9
- Enabled: true
10
8
  EnforcedStyle: double_quotes
11
-
12
- Layout/LineLength:
13
- Max: 120
@@ -11,7 +11,7 @@ module Bundler
11
11
  return uri if File.exist?(uri)
12
12
 
13
13
  require_relative "vendored_uri"
14
- uri = Bundler::URI(uri)
14
+ uri = Gem::URI(uri)
15
15
  end
16
16
 
17
17
  if uri.userinfo
@@ -25,7 +25,7 @@ module Bundler
25
25
  end
26
26
  return uri.to_s if uri_to_anonymize.is_a?(String)
27
27
  uri
28
- rescue Bundler::URI::InvalidURIError # uri is not canonical uri scheme
28
+ rescue Gem::URI::InvalidURIError # uri is not canonical uri scheme
29
29
  uri
30
30
  end
31
31