bundler 2.7.1 → 4.0.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1001 -902
  3. data/README.md +4 -4
  4. data/bundler.gemspec +3 -3
  5. data/lib/bundler/build_metadata.rb +2 -2
  6. data/lib/bundler/capistrano.rb +1 -19
  7. data/lib/bundler/checksum.rb +6 -0
  8. data/lib/bundler/cli/cache.rb +1 -12
  9. data/lib/bundler/cli/common.rb +21 -4
  10. data/lib/bundler/cli/config.rb +1 -2
  11. data/lib/bundler/cli/console.rb +5 -0
  12. data/lib/bundler/cli/exec.rb +29 -4
  13. data/lib/bundler/cli/gem.rb +19 -33
  14. data/lib/bundler/cli/install.rb +7 -84
  15. data/lib/bundler/cli/issue.rb +2 -2
  16. data/lib/bundler/cli/list.rb +33 -2
  17. data/lib/bundler/cli/lock.rb +5 -5
  18. data/lib/bundler/cli/plugin.rb +5 -1
  19. data/lib/bundler/cli/show.rb +3 -7
  20. data/lib/bundler/cli/update.rb +3 -3
  21. data/lib/bundler/cli.rb +97 -95
  22. data/lib/bundler/compact_index_client.rb +0 -1
  23. data/lib/bundler/current_ruby.rb +3 -15
  24. data/lib/bundler/definition.rb +122 -95
  25. data/lib/bundler/deployment.rb +1 -64
  26. data/lib/bundler/digest.rb +1 -1
  27. data/lib/bundler/dsl.rb +14 -36
  28. data/lib/bundler/endpoint_specification.rb +0 -22
  29. data/lib/bundler/errors.rb +1 -5
  30. data/lib/bundler/feature_flag.rb +0 -33
  31. data/lib/bundler/fetcher/compact_index.rb +1 -1
  32. data/lib/bundler/friendly_errors.rb +2 -2
  33. data/lib/bundler/index.rb +0 -7
  34. data/lib/bundler/inline.rb +1 -1
  35. data/lib/bundler/installer/gem_installer.rb +0 -11
  36. data/lib/bundler/installer.rb +0 -6
  37. data/lib/bundler/lockfile_generator.rb +1 -1
  38. data/lib/bundler/lockfile_parser.rb +2 -12
  39. data/lib/bundler/man/bundle-add.1 +1 -1
  40. data/lib/bundler/man/bundle-binstubs.1 +3 -6
  41. data/lib/bundler/man/bundle-binstubs.1.ronn +4 -6
  42. data/lib/bundler/man/bundle-cache.1 +2 -14
  43. data/lib/bundler/man/bundle-cache.1.ronn +1 -14
  44. data/lib/bundler/man/bundle-check.1 +2 -5
  45. data/lib/bundler/man/bundle-check.1.ronn +0 -5
  46. data/lib/bundler/man/bundle-clean.1 +1 -1
  47. data/lib/bundler/man/bundle-config.1 +36 -46
  48. data/lib/bundler/man/bundle-config.1.ronn +69 -75
  49. data/lib/bundler/man/bundle-console.1 +1 -1
  50. data/lib/bundler/man/bundle-doctor.1 +4 -4
  51. data/lib/bundler/man/bundle-doctor.1.ronn +4 -4
  52. data/lib/bundler/man/bundle-env.1 +1 -1
  53. data/lib/bundler/man/bundle-exec.1 +2 -5
  54. data/lib/bundler/man/bundle-exec.1.ronn +1 -5
  55. data/lib/bundler/man/bundle-fund.1 +1 -1
  56. data/lib/bundler/man/bundle-gem.1 +3 -6
  57. data/lib/bundler/man/bundle-gem.1.ronn +2 -5
  58. data/lib/bundler/man/bundle-help.1 +1 -1
  59. data/lib/bundler/man/bundle-info.1 +1 -1
  60. data/lib/bundler/man/bundle-init.1 +1 -1
  61. data/lib/bundler/man/bundle-install.1 +8 -59
  62. data/lib/bundler/man/bundle-install.1.ronn +12 -107
  63. data/lib/bundler/man/bundle-issue.1 +1 -1
  64. data/lib/bundler/man/bundle-licenses.1 +1 -1
  65. data/lib/bundler/man/bundle-list.1 +6 -1
  66. data/lib/bundler/man/bundle-list.1.ronn +5 -0
  67. data/lib/bundler/man/bundle-lock.1 +1 -1
  68. data/lib/bundler/man/bundle-open.1 +1 -1
  69. data/lib/bundler/man/bundle-outdated.1 +1 -1
  70. data/lib/bundler/man/bundle-platform.1 +1 -1
  71. data/lib/bundler/man/bundle-plugin.1 +33 -15
  72. data/lib/bundler/man/bundle-plugin.1.ronn +36 -15
  73. data/lib/bundler/man/bundle-pristine.1 +1 -1
  74. data/lib/bundler/man/bundle-remove.1 +2 -8
  75. data/lib/bundler/man/bundle-remove.1.ronn +1 -8
  76. data/lib/bundler/man/bundle-show.1 +2 -5
  77. data/lib/bundler/man/bundle-show.1.ronn +0 -4
  78. data/lib/bundler/man/bundle-update.1 +1 -1
  79. data/lib/bundler/man/bundle-version.1 +1 -1
  80. data/lib/bundler/man/bundle.1 +1 -10
  81. data/lib/bundler/man/bundle.1.ronn +0 -9
  82. data/lib/bundler/man/gemfile.5 +1 -1
  83. data/lib/bundler/man/index.txt +0 -2
  84. data/lib/bundler/materialization.rb +1 -1
  85. data/lib/bundler/plugin/installer.rb +0 -10
  86. data/lib/bundler/plugin/source_list.rb +1 -1
  87. data/lib/bundler/plugin.rb +1 -1
  88. data/lib/bundler/resolver/package.rb +1 -0
  89. data/lib/bundler/resolver.rb +1 -1
  90. data/lib/bundler/ruby_dsl.rb +2 -0
  91. data/lib/bundler/ruby_version.rb +1 -3
  92. data/lib/bundler/rubygems_ext.rb +1 -1
  93. data/lib/bundler/rubygems_gem_installer.rb +1 -1
  94. data/lib/bundler/rubygems_integration.rb +1 -5
  95. data/lib/bundler/self_manager.rb +1 -1
  96. data/lib/bundler/settings.rb +8 -27
  97. data/lib/bundler/shared_helpers.rb +8 -20
  98. data/lib/bundler/source/gemspec.rb +4 -0
  99. data/lib/bundler/source/git/git_proxy.rb +3 -11
  100. data/lib/bundler/source/git.rb +2 -3
  101. data/lib/bundler/source/path.rb +5 -7
  102. data/lib/bundler/source/rubygems.rb +11 -17
  103. data/lib/bundler/source.rb +1 -1
  104. data/lib/bundler/source_list.rb +4 -45
  105. data/lib/bundler/source_map.rb +2 -5
  106. data/lib/bundler/spec_set.rb +6 -15
  107. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +7 -129
  108. data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  109. data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
  110. data/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
  111. data/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
  112. data/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
  113. data/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
  114. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +6 -0
  115. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  116. data/lib/bundler/templates/newgem/newgem.gemspec.tt +7 -4
  117. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +26 -23
  118. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  119. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +50 -6
  120. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +57 -52
  121. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +5 -2
  122. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +42 -6
  123. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +1 -1
  124. data/lib/bundler/vendor/thor/lib/thor/runner.rb +2 -2
  125. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +3 -7
  126. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  127. data/lib/bundler/vendor/uri/lib/uri/common.rb +57 -15
  128. data/lib/bundler/vendor/uri/lib/uri/file.rb +1 -1
  129. data/lib/bundler/vendor/uri/lib/uri/generic.rb +34 -21
  130. data/lib/bundler/vendor/uri/lib/uri/http.rb +12 -0
  131. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +9 -8
  132. data/lib/bundler/vendor/uri/lib/uri/version.rb +2 -2
  133. data/lib/bundler/version.rb +1 -1
  134. data/lib/bundler/vlad.rb +1 -14
  135. data/lib/bundler.rb +6 -28
  136. metadata +9 -13
  137. data/lib/bundler/cli/inject.rb +0 -60
  138. data/lib/bundler/cli/viz.rb +0 -31
  139. data/lib/bundler/graph.rb +0 -152
  140. data/lib/bundler/man/bundle-inject.1 +0 -31
  141. data/lib/bundler/man/bundle-inject.1.ronn +0 -32
  142. data/lib/bundler/man/bundle-viz.1 +0 -30
  143. data/lib/bundler/man/bundle-viz.1.ronn +0 -36
  144. data/lib/bundler/similarity_detector.rb +0 -63
@@ -73,7 +73,7 @@ module Bundler::URI
73
73
  #
74
74
  # At first, tries to create a new Bundler::URI::Generic instance using
75
75
  # Bundler::URI::Generic::build. But, if exception Bundler::URI::InvalidComponentError is raised,
76
- # then it does Bundler::URI::Escape.escape all Bundler::URI components and tries again.
76
+ # then it does Bundler::URI::RFC2396_PARSER.escape all Bundler::URI components and tries again.
77
77
  #
78
78
  def self.build2(args)
79
79
  begin
@@ -126,9 +126,9 @@ module Bundler::URI
126
126
  end
127
127
  end
128
128
  else
129
- component = self.class.component rescue ::Bundler::URI::Generic::COMPONENT
129
+ component = self.component rescue ::Bundler::URI::Generic::COMPONENT
130
130
  raise ArgumentError,
131
- "expected Array of or Hash of components of #{self.class} (#{component.join(', ')})"
131
+ "expected Array of or Hash of components of #{self} (#{component.join(', ')})"
132
132
  end
133
133
 
134
134
  tmp << nil
@@ -186,18 +186,18 @@ module Bundler::URI
186
186
 
187
187
  if arg_check
188
188
  self.scheme = scheme
189
- self.userinfo = userinfo
190
189
  self.hostname = host
191
190
  self.port = port
191
+ self.userinfo = userinfo
192
192
  self.path = path
193
193
  self.query = query
194
194
  self.opaque = opaque
195
195
  self.fragment = fragment
196
196
  else
197
197
  self.set_scheme(scheme)
198
- self.set_userinfo(userinfo)
199
198
  self.set_host(host)
200
199
  self.set_port(port)
200
+ self.set_userinfo(userinfo)
201
201
  self.set_path(path)
202
202
  self.query = query
203
203
  self.set_opaque(opaque)
@@ -284,7 +284,7 @@ module Bundler::URI
284
284
 
285
285
  # Returns the parser to be used.
286
286
  #
287
- # Unless a Bundler::URI::Parser is defined, DEFAULT_PARSER is used.
287
+ # Unless the +parser+ is defined, DEFAULT_PARSER is used.
288
288
  #
289
289
  def parser
290
290
  if !defined?(@parser) || !@parser
@@ -315,7 +315,7 @@ module Bundler::URI
315
315
  end
316
316
 
317
317
  #
318
- # Checks the scheme +v+ component against the Bundler::URI::Parser Regexp for :SCHEME.
318
+ # Checks the scheme +v+ component against the +parser+ Regexp for :SCHEME.
319
319
  #
320
320
  def check_scheme(v)
321
321
  if v && parser.regexp[:SCHEME] !~ v
@@ -385,7 +385,7 @@ module Bundler::URI
385
385
 
386
386
  #
387
387
  # Checks the user +v+ component for RFC2396 compliance
388
- # and against the Bundler::URI::Parser Regexp for :USERINFO.
388
+ # and against the +parser+ Regexp for :USERINFO.
389
389
  #
390
390
  # Can not have a registry or opaque component defined,
391
391
  # with a user component defined.
@@ -409,7 +409,7 @@ module Bundler::URI
409
409
 
410
410
  #
411
411
  # Checks the password +v+ component for RFC2396 compliance
412
- # and against the Bundler::URI::Parser Regexp for :USERINFO.
412
+ # and against the +parser+ Regexp for :USERINFO.
413
413
  #
414
414
  # Can not have a registry or opaque component defined,
415
415
  # with a user component defined.
@@ -511,7 +511,7 @@ module Bundler::URI
511
511
  user, password = split_userinfo(user)
512
512
  end
513
513
  @user = user
514
- @password = password if password
514
+ @password = password
515
515
 
516
516
  [@user, @password]
517
517
  end
@@ -522,7 +522,7 @@ module Bundler::URI
522
522
  # See also Bundler::URI::Generic.user=.
523
523
  #
524
524
  def set_user(v)
525
- set_userinfo(v, @password)
525
+ set_userinfo(v, nil)
526
526
  v
527
527
  end
528
528
  protected :set_user
@@ -574,6 +574,12 @@ module Bundler::URI
574
574
  @password
575
575
  end
576
576
 
577
+ # Returns the authority info (array of user, password, host and
578
+ # port), if any is set. Or returns +nil+.
579
+ def authority
580
+ return @user, @password, @host, @port if @user || @password || @host || @port
581
+ end
582
+
577
583
  # Returns the user component after Bundler::URI decoding.
578
584
  def decoded_user
579
585
  Bundler::URI.decode_uri_component(@user) if @user
@@ -586,7 +592,7 @@ module Bundler::URI
586
592
 
587
593
  #
588
594
  # Checks the host +v+ component for RFC2396 compliance
589
- # and against the Bundler::URI::Parser Regexp for :HOST.
595
+ # and against the +parser+ Regexp for :HOST.
590
596
  #
591
597
  # Can not have a registry or opaque component defined,
592
598
  # with a host component defined.
@@ -615,6 +621,13 @@ module Bundler::URI
615
621
  end
616
622
  protected :set_host
617
623
 
624
+ # Protected setter for the authority info (+user+, +password+, +host+
625
+ # and +port+). If +port+ is +nil+, +default_port+ will be set.
626
+ #
627
+ protected def set_authority(user, password, host, port = nil)
628
+ @user, @password, @host, @port = user, password, host, port || self.default_port
629
+ end
630
+
618
631
  #
619
632
  # == Args
620
633
  #
@@ -639,6 +652,7 @@ module Bundler::URI
639
652
  def host=(v)
640
653
  check_host(v)
641
654
  set_host(v)
655
+ set_userinfo(nil)
642
656
  v
643
657
  end
644
658
 
@@ -675,7 +689,7 @@ module Bundler::URI
675
689
 
676
690
  #
677
691
  # Checks the port +v+ component for RFC2396 compliance
678
- # and against the Bundler::URI::Parser Regexp for :PORT.
692
+ # and against the +parser+ Regexp for :PORT.
679
693
  #
680
694
  # Can not have a registry or opaque component defined,
681
695
  # with a port component defined.
@@ -729,6 +743,7 @@ module Bundler::URI
729
743
  def port=(v)
730
744
  check_port(v)
731
745
  set_port(v)
746
+ set_userinfo(nil)
732
747
  port
733
748
  end
734
749
 
@@ -748,7 +763,7 @@ module Bundler::URI
748
763
 
749
764
  #
750
765
  # Checks the path +v+ component for RFC2396 compliance
751
- # and against the Bundler::URI::Parser Regexp
766
+ # and against the +parser+ Regexp
752
767
  # for :ABS_PATH and :REL_PATH.
753
768
  #
754
769
  # Can not have a opaque component defined,
@@ -853,7 +868,7 @@ module Bundler::URI
853
868
 
854
869
  #
855
870
  # Checks the opaque +v+ component for RFC2396 compliance and
856
- # against the Bundler::URI::Parser Regexp for :OPAQUE.
871
+ # against the +parser+ Regexp for :OPAQUE.
857
872
  #
858
873
  # Can not have a host, port, user, or path component defined,
859
874
  # with an opaque component defined.
@@ -905,7 +920,7 @@ module Bundler::URI
905
920
  end
906
921
 
907
922
  #
908
- # Checks the fragment +v+ component against the Bundler::URI::Parser Regexp for :FRAGMENT.
923
+ # Checks the fragment +v+ component against the +parser+ Regexp for :FRAGMENT.
909
924
  #
910
925
  #
911
926
  # == Args
@@ -1121,7 +1136,7 @@ module Bundler::URI
1121
1136
 
1122
1137
  base = self.dup
1123
1138
 
1124
- authority = rel.userinfo || rel.host || rel.port
1139
+ authority = rel.authority
1125
1140
 
1126
1141
  # RFC2396, Section 5.2, 2)
1127
1142
  if (rel.path.nil? || rel.path.empty?) && !authority && !rel.query
@@ -1134,9 +1149,7 @@ module Bundler::URI
1134
1149
 
1135
1150
  # RFC2396, Section 5.2, 4)
1136
1151
  if authority
1137
- base.set_userinfo(rel.userinfo)
1138
- base.set_host(rel.host)
1139
- base.set_port(rel.port || base.default_port)
1152
+ base.set_authority(*authority)
1140
1153
  base.set_path(rel.path)
1141
1154
  elsif base.path && rel.path
1142
1155
  base.set_path(merge_path(base.path, rel.path))
@@ -1527,7 +1540,7 @@ module Bundler::URI
1527
1540
  else
1528
1541
  unless proxy_uri = env[name]
1529
1542
  if proxy_uri = env[name.upcase]
1530
- warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.', uplevel: 1
1543
+ warn 'The environment variable HTTP_PROXY is discouraged. Please use http_proxy instead.', uplevel: 1
1531
1544
  end
1532
1545
  end
1533
1546
  end
@@ -61,6 +61,18 @@ module Bundler::URI
61
61
  super(tmp)
62
62
  end
63
63
 
64
+ # Do not allow empty host names, as they are not allowed by RFC 3986.
65
+ def check_host(v)
66
+ ret = super
67
+
68
+ if ret && v.empty?
69
+ raise InvalidComponentError,
70
+ "bad component(expected host component): #{v}"
71
+ end
72
+
73
+ ret
74
+ end
75
+
64
76
  #
65
77
  # == Description
66
78
  #
@@ -67,7 +67,7 @@ module Bundler::URI
67
67
  #
68
68
  # == Synopsis
69
69
  #
70
- # Bundler::URI::Parser.new([opts])
70
+ # Bundler::URI::RFC2396_Parser.new([opts])
71
71
  #
72
72
  # == Args
73
73
  #
@@ -86,7 +86,7 @@ module Bundler::URI
86
86
  #
87
87
  # == Examples
88
88
  #
89
- # p = Bundler::URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
89
+ # p = Bundler::URI::RFC2396_Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
90
90
  # u = p.parse("http://example.jp/%uABCD") #=> #<Bundler::URI::HTTP http://example.jp/%uABCD>
91
91
  # Bundler::URI.parse(u.to_s) #=> raises Bundler::URI::InvalidURIError
92
92
  #
@@ -108,12 +108,12 @@ module Bundler::URI
108
108
 
109
109
  # The Hash of patterns.
110
110
  #
111
- # See also Bundler::URI::Parser.initialize_pattern.
111
+ # See also #initialize_pattern.
112
112
  attr_reader :pattern
113
113
 
114
114
  # The Hash of Regexp.
115
115
  #
116
- # See also Bundler::URI::Parser.initialize_regexp.
116
+ # See also #initialize_regexp.
117
117
  attr_reader :regexp
118
118
 
119
119
  # Returns a split Bundler::URI against +regexp[:ABS_URI]+.
@@ -202,8 +202,7 @@ module Bundler::URI
202
202
  #
203
203
  # == Usage
204
204
  #
205
- # p = Bundler::URI::Parser.new
206
- # p.parse("ldap://ldap.example.com/dc=example?user=john")
205
+ # Bundler::URI::RFC2396_PARSER.parse("ldap://ldap.example.com/dc=example?user=john")
207
206
  # #=> #<Bundler::URI::LDAP ldap://ldap.example.com/dc=example?user=john>
208
207
  #
209
208
  def parse(uri)
@@ -244,7 +243,7 @@ module Bundler::URI
244
243
  # If no +block+ given, then returns the result,
245
244
  # else it calls +block+ for each element in result.
246
245
  #
247
- # See also Bundler::URI::Parser.make_regexp.
246
+ # See also #make_regexp.
248
247
  #
249
248
  def extract(str, schemes = nil)
250
249
  if block_given?
@@ -263,7 +262,7 @@ module Bundler::URI
263
262
  unless schemes
264
263
  @regexp[:ABS_URI_REF]
265
264
  else
266
- /(?=#{Regexp.union(*schemes)}:)#{@pattern[:X_ABS_URI]}/x
265
+ /(?=(?i:#{Regexp.union(*schemes).source}):)#{@pattern[:X_ABS_URI]}/x
267
266
  end
268
267
  end
269
268
 
@@ -524,6 +523,8 @@ module Bundler::URI
524
523
  ret
525
524
  end
526
525
 
526
+ # Returns +uri+ as-is if it is Bundler::URI, or convert it to Bundler::URI if it is
527
+ # a String.
527
528
  def convert_to_uri(uri)
528
529
  if uri.is_a?(Bundler::URI::Generic)
529
530
  uri
@@ -1,6 +1,6 @@
1
1
  module Bundler::URI
2
2
  # :stopdoc:
3
- VERSION_CODE = '010003'.freeze
4
- VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
3
+ VERSION = '1.1.1'.freeze
4
+ VERSION_CODE = VERSION.split('.').map{|s| s.rjust(2, '0')}.join.freeze
5
5
  # :startdoc:
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.7.1".freeze
4
+ VERSION = "4.0.0.beta1".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= gem_version.segments.first
data/lib/bundler/vlad.rb CHANGED
@@ -1,17 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "shared_helpers"
4
- Bundler::SharedHelpers.major_deprecation 2,
5
- "The Bundler task for Vlad"
6
-
7
- # Vlad task for Bundler.
8
- #
9
- # Add "require 'bundler/vlad'" in your Vlad deploy.rb, and
10
- # include the vlad:bundle:install task in your vlad:deploy task.
11
- require_relative "deployment"
12
-
13
- include Rake::DSL if defined? Rake::DSL
14
-
15
- namespace :vlad do
16
- Bundler::Deployment.define_task(Rake::RemoteTask, :remote_task, roles: :app)
17
- end
4
+ Bundler::SharedHelpers.feature_removed! "The Bundler task for Vlad"
data/lib/bundler.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative "bundler/rubygems_ext"
4
4
  require_relative "bundler/vendored_fileutils"
5
- require "pathname"
5
+ autoload :Pathname, "pathname" unless defined?(Pathname)
6
6
  require "rbconfig"
7
7
 
8
8
  require_relative "bundler/errors"
@@ -54,7 +54,6 @@ module Bundler
54
54
  autoload :FREEBSD, File.expand_path("bundler/constants", __dir__)
55
55
  autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
56
56
  autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
57
- autoload :Graph, File.expand_path("bundler/graph", __dir__)
58
57
  autoload :Index, File.expand_path("bundler/index", __dir__)
59
58
  autoload :Injector, File.expand_path("bundler/injector", __dir__)
60
59
  autoload :Installer, File.expand_path("bundler/installer", __dir__)
@@ -219,8 +218,7 @@ module Bundler
219
218
  end
220
219
 
221
220
  def environment
222
- SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load", print_caller_location: true
223
- load
221
+ SharedHelpers.feature_removed! "Bundler.environment has been removed in favor of Bundler.load"
224
222
  end
225
223
 
226
224
  # Returns an instance of Bundler::Definition for given Gemfile and lockfile
@@ -365,16 +363,11 @@ module Bundler
365
363
  ORIGINAL_ENV.clone
366
364
  end
367
365
 
368
- # @deprecated Use `unbundled_env` instead
369
366
  def clean_env
370
- message =
371
- "`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
372
- "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
373
367
  removed_message =
374
368
  "`Bundler.clean_env` has been removed in favor of `Bundler.unbundled_env`. " \
375
369
  "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
376
- Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
377
- unbundled_env
370
+ Bundler::SharedHelpers.feature_removed!(removed_message)
378
371
  end
379
372
 
380
373
  # @return [Hash] Environment with all bundler-related variables removed
@@ -392,16 +385,11 @@ module Bundler
392
385
  with_env(original_env) { yield }
393
386
  end
394
387
 
395
- # @deprecated Use `with_unbundled_env` instead
396
388
  def with_clean_env
397
- message =
398
- "`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
399
- "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`"
400
389
  removed_message =
401
390
  "`Bundler.with_clean_env` has been removed in favor of `Bundler.with_unbundled_env`. " \
402
391
  "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`"
403
- Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
404
- with_env(unbundled_env) { yield }
392
+ Bundler::SharedHelpers.feature_removed!(removed_message)
405
393
  end
406
394
 
407
395
  # Run block with all bundler-related variables removed
@@ -414,16 +402,11 @@ module Bundler
414
402
  with_original_env { Kernel.system(*args) }
415
403
  end
416
404
 
417
- # @deprecated Use `unbundled_system` instead
418
405
  def clean_system(*args)
419
- message =
420
- "`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \
421
- "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`"
422
406
  removed_message =
423
407
  "`Bundler.clean_system` has been removed in favor of `Bundler.unbundled_system`. " \
424
408
  "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`"
425
- Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
426
- with_env(unbundled_env) { Kernel.system(*args) }
409
+ Bundler::SharedHelpers.feature_removed!(removed_message)
427
410
  end
428
411
 
429
412
  # Run subcommand in an environment with all bundler related variables removed
@@ -436,16 +419,11 @@ module Bundler
436
419
  with_original_env { Kernel.exec(*args) }
437
420
  end
438
421
 
439
- # @deprecated Use `unbundled_exec` instead
440
422
  def clean_exec(*args)
441
- message =
442
- "`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \
443
- "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`"
444
423
  removed_message =
445
424
  "`Bundler.clean_exec` has been removed in favor of `Bundler.unbundled_exec`. " \
446
425
  "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`"
447
- Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
448
- with_env(unbundled_env) { Kernel.exec(*args) }
426
+ Bundler::SharedHelpers.feature_removed!(removed_message)
449
427
  end
450
428
 
451
429
  # Run a `Kernel.exec` to a subcommand in an environment with all bundler related variables removed
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.7.1
4
+ version: 4.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -62,7 +62,6 @@ files:
62
62
  - lib/bundler/cli/gem.rb
63
63
  - lib/bundler/cli/info.rb
64
64
  - lib/bundler/cli/init.rb
65
- - lib/bundler/cli/inject.rb
66
65
  - lib/bundler/cli/install.rb
67
66
  - lib/bundler/cli/issue.rb
68
67
  - lib/bundler/cli/list.rb
@@ -75,7 +74,6 @@ files:
75
74
  - lib/bundler/cli/remove.rb
76
75
  - lib/bundler/cli/show.rb
77
76
  - lib/bundler/cli/update.rb
78
- - lib/bundler/cli/viz.rb
79
77
  - lib/bundler/compact_index_client.rb
80
78
  - lib/bundler/compact_index_client/cache.rb
81
79
  - lib/bundler/compact_index_client/cache_file.rb
@@ -106,7 +104,6 @@ files:
106
104
  - lib/bundler/gem_helper.rb
107
105
  - lib/bundler/gem_tasks.rb
108
106
  - lib/bundler/gem_version_promoter.rb
109
- - lib/bundler/graph.rb
110
107
  - lib/bundler/index.rb
111
108
  - lib/bundler/injector.rb
112
109
  - lib/bundler/inline.rb
@@ -148,8 +145,6 @@ files:
148
145
  - lib/bundler/man/bundle-info.1.ronn
149
146
  - lib/bundler/man/bundle-init.1
150
147
  - lib/bundler/man/bundle-init.1.ronn
151
- - lib/bundler/man/bundle-inject.1
152
- - lib/bundler/man/bundle-inject.1.ronn
153
148
  - lib/bundler/man/bundle-install.1
154
149
  - lib/bundler/man/bundle-install.1.ronn
155
150
  - lib/bundler/man/bundle-issue.1
@@ -178,8 +173,6 @@ files:
178
173
  - lib/bundler/man/bundle-update.1.ronn
179
174
  - lib/bundler/man/bundle-version.1
180
175
  - lib/bundler/man/bundle-version.1.ronn
181
- - lib/bundler/man/bundle-viz.1
182
- - lib/bundler/man/bundle-viz.1.ronn
183
176
  - lib/bundler/man/bundle.1
184
177
  - lib/bundler/man/bundle.1.ronn
185
178
  - lib/bundler/man/gemfile.5
@@ -224,7 +217,6 @@ files:
224
217
  - lib/bundler/settings/validator.rb
225
218
  - lib/bundler/setup.rb
226
219
  - lib/bundler/shared_helpers.rb
227
- - lib/bundler/similarity_detector.rb
228
220
  - lib/bundler/source.rb
229
221
  - lib/bundler/source/gemspec.rb
230
222
  - lib/bundler/source/git.rb
@@ -256,8 +248,12 @@ files:
256
248
  - lib/bundler/templates/newgem/exe/newgem.tt
257
249
  - lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt
258
250
  - lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt
251
+ - lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt
259
252
  - lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt
253
+ - lib/bundler/templates/newgem/ext/newgem/go.mod.tt
254
+ - lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt
260
255
  - lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
256
+ - lib/bundler/templates/newgem/ext/newgem/newgem.go.tt
261
257
  - lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
262
258
  - lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt
263
259
  - lib/bundler/templates/newgem/github/workflows/main.yml.tt
@@ -386,10 +382,10 @@ homepage: https://bundler.io
386
382
  licenses:
387
383
  - MIT
388
384
  metadata:
389
- bug_tracker_uri: https://github.com/rubygems/rubygems/issues?q=is%3Aopen+is%3Aissue+label%3ABundler
390
- changelog_uri: https://github.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md
385
+ bug_tracker_uri: https://github.com/ruby/rubygems/issues?q=is%3Aopen+is%3Aissue+label%3ABundler
386
+ changelog_uri: https://github.com/ruby/rubygems/blob/master/bundler/CHANGELOG.md
391
387
  homepage_uri: https://bundler.io/
392
- source_code_uri: https://github.com/rubygems/rubygems/tree/master/bundler
388
+ source_code_uri: https://github.com/ruby/rubygems/tree/master/bundler
393
389
  rdoc_options: []
394
390
  require_paths:
395
391
  - lib
@@ -404,7 +400,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
400
  - !ruby/object:Gem::Version
405
401
  version: 3.4.1
406
402
  requirements: []
407
- rubygems_version: 3.7.1
403
+ rubygems_version: 3.6.9
408
404
  specification_version: 4
409
405
  summary: The best way to manage your application's dependencies
410
406
  test_files: []
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bundler
4
- class CLI::Inject
5
- attr_reader :options, :name, :version, :group, :source, :gems
6
- def initialize(options, name, version)
7
- @options = options
8
- @name = name
9
- @version = version || last_version_number
10
- @group = options[:group].split(",") unless options[:group].nil?
11
- @source = options[:source]
12
- @gems = []
13
- end
14
-
15
- def run
16
- # The required arguments allow Thor to give useful feedback when the arguments
17
- # are incorrect. This adds those first two arguments onto the list as a whole.
18
- gems.unshift(source).unshift(group).unshift(version).unshift(name)
19
-
20
- # Build an array of Dependency objects out of the arguments
21
- deps = []
22
- # when `inject` support addition of more than one gem, then this loop will
23
- # help. Currently this loop is running once.
24
- gems.each_slice(4) do |gem_name, gem_version, gem_group, gem_source|
25
- ops = Gem::Requirement::OPS.map {|key, _val| key }
26
- has_op = ops.any? {|op| gem_version.start_with? op }
27
- gem_version = "~> #{gem_version}" unless has_op
28
- deps << Bundler::Dependency.new(gem_name, gem_version, "group" => gem_group, "source" => gem_source)
29
- end
30
-
31
- added = Injector.inject(deps, options)
32
-
33
- if added.any?
34
- Bundler.ui.confirm "Added to Gemfile:"
35
- Bundler.ui.confirm(added.map do |d|
36
- name = "'#{d.name}'"
37
- requirement = ", '#{d.requirement}'"
38
- group = ", group: #{d.groups.inspect}" if d.groups != Array(:default)
39
- source = ", source: '#{d.source}'" unless d.source.nil?
40
- %(gem #{name}#{requirement}#{group}#{source})
41
- end.join("\n"))
42
- else
43
- Bundler.ui.confirm "All gems were already present in the Gemfile"
44
- end
45
- end
46
-
47
- private
48
-
49
- def last_version_number
50
- definition = Bundler.definition(true)
51
- definition.remotely!
52
- specs = definition.index[name].sort_by(&:version)
53
- unless options[:pre]
54
- specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
55
- end
56
- spec = specs.last
57
- spec.version.to_s
58
- end
59
- end
60
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bundler
4
- class CLI::Viz
5
- attr_reader :options, :gem_name
6
- def initialize(options)
7
- @options = options
8
- end
9
-
10
- def run
11
- # make sure we get the right `graphviz`. There is also a `graphviz`
12
- # gem we're not built to support
13
- gem "ruby-graphviz"
14
- require "graphviz"
15
-
16
- options[:without] = options[:without].join(":").tr(" ", ":").split(":")
17
- output_file = File.expand_path(options[:file])
18
-
19
- graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without])
20
- graph.viz
21
- rescue LoadError => e
22
- Bundler.ui.error e.inspect
23
- Bundler.ui.warn "Make sure you have the graphviz ruby gem. You can install it with:"
24
- Bundler.ui.warn "`gem install ruby-graphviz`"
25
- rescue StandardError => e
26
- raise unless e.message.to_s.include?("GraphViz not installed or dot not in PATH")
27
- Bundler.ui.error e.message
28
- Bundler.ui.warn "Please install GraphViz. On a Mac with Homebrew, you can run `brew install graphviz`."
29
- end
30
- end
31
- end