rubygems-update 3.2.26 → 3.2.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +60 -0
  3. data/Manifest.txt +12 -3
  4. data/bundler/CHANGELOG.md +50 -1
  5. data/bundler/README.md +1 -1
  6. data/bundler/lib/bundler/build_metadata.rb +2 -2
  7. data/bundler/lib/bundler/cli/check.rb +1 -1
  8. data/bundler/lib/bundler/cli/gem.rb +19 -2
  9. data/bundler/lib/bundler/cli/info.rb +11 -4
  10. data/bundler/lib/bundler/cli/issue.rb +4 -3
  11. data/bundler/lib/bundler/cli/remove.rb +1 -2
  12. data/bundler/lib/bundler/cli.rb +1 -0
  13. data/bundler/lib/bundler/compact_index_client.rb +2 -2
  14. data/bundler/lib/bundler/definition.rb +16 -6
  15. data/bundler/lib/bundler/digest.rb +71 -0
  16. data/bundler/lib/bundler/errors.rb +18 -2
  17. data/bundler/lib/bundler/fetcher.rb +2 -1
  18. data/bundler/lib/bundler/friendly_errors.rb +5 -30
  19. data/bundler/lib/bundler/gem_helper.rb +6 -17
  20. data/bundler/lib/bundler/installer.rb +0 -1
  21. data/bundler/lib/bundler/plugin/installer.rb +2 -0
  22. data/bundler/lib/bundler/plugin.rb +23 -6
  23. data/bundler/lib/bundler/rubygems_ext.rb +4 -0
  24. data/bundler/lib/bundler/rubygems_gem_installer.rb +20 -4
  25. data/bundler/lib/bundler/rubygems_integration.rb +28 -9
  26. data/bundler/lib/bundler/runtime.rb +1 -1
  27. data/bundler/lib/bundler/settings.rb +9 -1
  28. data/bundler/lib/bundler/source/git.rb +22 -4
  29. data/bundler/lib/bundler/source/rubygems.rb +43 -72
  30. data/bundler/lib/bundler/source.rb +2 -0
  31. data/bundler/lib/bundler/source_list.rb +4 -0
  32. data/bundler/lib/bundler/spec_set.rb +1 -1
  33. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -1
  34. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  35. data/bundler/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  36. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
  37. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  38. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
  39. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
  40. data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
  41. data/bundler/lib/bundler/vendor/molinillo/LICENSE +9 -0
  42. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  43. data/bundler/lib/bundler/vendor/thor/LICENSE.md +20 -0
  44. data/bundler/lib/bundler/vendor/uri/LICENSE.txt +22 -0
  45. data/bundler/lib/bundler/version.rb +1 -1
  46. data/bundler/lib/bundler/worker.rb +2 -2
  47. data/bundler/lib/bundler.rb +13 -18
  48. data/lib/rubygems/command_manager.rb +3 -3
  49. data/lib/rubygems/commands/build_command.rb +3 -3
  50. data/lib/rubygems/commands/cert_command.rb +15 -8
  51. data/lib/rubygems/commands/check_command.rb +4 -4
  52. data/lib/rubygems/commands/cleanup_command.rb +3 -3
  53. data/lib/rubygems/commands/contents_command.rb +2 -2
  54. data/lib/rubygems/commands/dependency_command.rb +3 -3
  55. data/lib/rubygems/commands/environment_command.rb +1 -1
  56. data/lib/rubygems/commands/fetch_command.rb +3 -3
  57. data/lib/rubygems/commands/generate_index_command.rb +2 -2
  58. data/lib/rubygems/commands/help_command.rb +1 -1
  59. data/lib/rubygems/commands/info_command.rb +2 -2
  60. data/lib/rubygems/commands/install_command.rb +12 -11
  61. data/lib/rubygems/commands/list_command.rb +2 -2
  62. data/lib/rubygems/commands/lock_command.rb +1 -1
  63. data/lib/rubygems/commands/mirror_command.rb +1 -1
  64. data/lib/rubygems/commands/open_command.rb +2 -2
  65. data/lib/rubygems/commands/outdated_command.rb +4 -4
  66. data/lib/rubygems/commands/owner_command.rb +4 -4
  67. data/lib/rubygems/commands/pristine_command.rb +5 -5
  68. data/lib/rubygems/commands/push_command.rb +4 -4
  69. data/lib/rubygems/commands/query_command.rb +3 -3
  70. data/lib/rubygems/commands/rdoc_command.rb +3 -3
  71. data/lib/rubygems/commands/search_command.rb +2 -2
  72. data/lib/rubygems/commands/server_command.rb +3 -3
  73. data/lib/rubygems/commands/setup_command.rb +6 -6
  74. data/lib/rubygems/commands/signin_command.rb +2 -2
  75. data/lib/rubygems/commands/signout_command.rb +1 -1
  76. data/lib/rubygems/commands/sources_command.rb +4 -4
  77. data/lib/rubygems/commands/specification_command.rb +4 -4
  78. data/lib/rubygems/commands/stale_command.rb +1 -1
  79. data/lib/rubygems/commands/uninstall_command.rb +3 -3
  80. data/lib/rubygems/commands/unpack_command.rb +5 -5
  81. data/lib/rubygems/commands/update_command.rb +9 -9
  82. data/lib/rubygems/commands/which_command.rb +1 -1
  83. data/lib/rubygems/commands/yank_command.rb +4 -4
  84. data/lib/rubygems/config_file.rb +1 -1
  85. data/lib/rubygems/core_ext/tcpsocket_init.rb +2 -2
  86. data/lib/rubygems/defaults.rb +1 -1
  87. data/lib/rubygems/dependency_installer.rb +8 -8
  88. data/lib/rubygems/dependency_list.rb +1 -1
  89. data/lib/rubygems/doctor.rb +2 -2
  90. data/lib/rubygems/errors.rb +1 -2
  91. data/lib/rubygems/exceptions.rb +1 -1
  92. data/lib/rubygems/gem_runner.rb +3 -3
  93. data/lib/rubygems/gemcutter_utilities.rb +2 -2
  94. data/lib/rubygems/indexer.rb +2 -2
  95. data/lib/rubygems/install_default_message.rb +2 -2
  96. data/lib/rubygems/install_message.rb +2 -2
  97. data/lib/rubygems/install_update_options.rb +2 -2
  98. data/lib/rubygems/installer.rb +8 -8
  99. data/lib/rubygems/local_remote_options.rb +1 -1
  100. data/lib/rubygems/mock_gem_ui.rb +1 -1
  101. data/lib/rubygems/package/tar_reader.rb +1 -1
  102. data/lib/rubygems/package.rb +36 -46
  103. data/lib/rubygems/package_task.rb +2 -2
  104. data/lib/rubygems/platform.rb +2 -1
  105. data/lib/rubygems/query_utils.rb +4 -4
  106. data/lib/rubygems/rdoc.rb +1 -1
  107. data/lib/rubygems/remote_fetcher.rb +16 -22
  108. data/lib/rubygems/request/connection_pools.rb +1 -1
  109. data/lib/rubygems/request/http_pool.rb +1 -1
  110. data/lib/rubygems/request.rb +7 -5
  111. data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
  112. data/lib/rubygems/request_set/lockfile.rb +1 -1
  113. data/lib/rubygems/request_set.rb +5 -5
  114. data/lib/rubygems/requirement.rb +1 -1
  115. data/lib/rubygems/resolver/git_specification.rb +1 -1
  116. data/lib/rubygems/resolver/installer_set.rb +3 -3
  117. data/lib/rubygems/resolver/molinillo/LICENSE +9 -0
  118. data/lib/rubygems/resolver/molinillo.rb +1 -1
  119. data/lib/rubygems/resolver/set.rb +0 -1
  120. data/lib/rubygems/resolver/specification.rb +1 -1
  121. data/lib/rubygems/resolver.rb +31 -31
  122. data/lib/rubygems/s3_uri_signer.rb +4 -5
  123. data/lib/rubygems/security/policy.rb +6 -4
  124. data/lib/rubygems/security/signer.rb +4 -5
  125. data/lib/rubygems/security.rb +54 -20
  126. data/lib/rubygems/security_option.rb +2 -2
  127. data/lib/rubygems/server.rb +2 -2
  128. data/lib/rubygems/source/git.rb +2 -2
  129. data/lib/rubygems/source.rb +7 -7
  130. data/lib/rubygems/spec_fetcher.rb +5 -5
  131. data/lib/rubygems/specification.rb +12 -12
  132. data/lib/rubygems/specification_policy.rb +2 -2
  133. data/lib/rubygems/uninstaller.rb +6 -6
  134. data/lib/rubygems/uri.rb +111 -0
  135. data/lib/rubygems/user_interaction.rb +3 -3
  136. data/lib/rubygems/util/licenses.rb +1 -1
  137. data/lib/rubygems/util.rb +1 -1
  138. data/lib/rubygems/validator.rb +2 -2
  139. data/lib/rubygems/version_option.rb +1 -1
  140. data/lib/rubygems.rb +16 -16
  141. data/rubygems-update.gemspec +1 -1
  142. data/test/rubygems/helper.rb +4 -12
  143. data/test/rubygems/private_ec_key.pem +9 -0
  144. data/test/rubygems/test_gem.rb +59 -71
  145. data/test/rubygems/test_gem_commands_cert_command.rb +63 -4
  146. data/test/rubygems/test_gem_commands_install_command.rb +25 -0
  147. data/test/rubygems/test_gem_package.rb +27 -26
  148. data/test/rubygems/test_gem_platform.rb +1 -0
  149. data/test/rubygems/test_gem_remote_fetcher.rb +30 -0
  150. data/test/rubygems/test_gem_request.rb +35 -9
  151. data/test/rubygems/test_gem_resolver_installer_set.rb +18 -0
  152. data/test/rubygems/test_gem_security.rb +32 -4
  153. data/test/rubygems/test_gem_source_fetch_problem.rb +10 -0
  154. data/test/rubygems/test_gem_specification.rb +228 -232
  155. data/test/rubygems/test_gem_uri.rb +39 -0
  156. metadata +18 -9
  157. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
  158. data/lib/rubygems/uri_parser.rb +0 -34
  159. data/lib/rubygems/uri_parsing.rb +0 -23
@@ -1,13 +1,3 @@
1
- require 'thread'
2
- require 'timeout'
3
- require_relative 'monotonic_time'
4
-
5
- ##
6
- # Raised when you attempt to retrieve a connection from a pool that has been
7
- # shut down.
8
-
9
- class Bundler::ConnectionPool::PoolShuttingDownError < RuntimeError; end
10
-
11
1
  ##
12
2
  # The TimedStack manages a pool of homogeneous connections (or any resource
13
3
  # you wish to manage). Connections are created lazily up to a given maximum
@@ -25,7 +15,7 @@ class Bundler::ConnectionPool::PoolShuttingDownError < RuntimeError; end
25
15
  #
26
16
  # conn = ts.pop
27
17
  # ts.pop timeout: 5
28
- # #=> raises Timeout::Error after 5 seconds
18
+ # #=> raises Bundler::ConnectionPool::TimeoutError after 5 seconds
29
19
 
30
20
  class Bundler::ConnectionPool::TimedStack
31
21
  attr_reader :max
@@ -39,8 +29,8 @@ class Bundler::ConnectionPool::TimedStack
39
29
  @created = 0
40
30
  @que = []
41
31
  @max = size
42
- @mutex = Mutex.new
43
- @resource = ConditionVariable.new
32
+ @mutex = Thread::Mutex.new
33
+ @resource = Thread::ConditionVariable.new
44
34
  @shutdown_block = nil
45
35
  end
46
36
 
@@ -59,12 +49,12 @@ class Bundler::ConnectionPool::TimedStack
59
49
  @resource.broadcast
60
50
  end
61
51
  end
62
- alias_method :<<, :push
52
+ alias << push
63
53
 
64
54
  ##
65
55
  # Retrieves a connection from the stack. If a connection is available it is
66
56
  # immediately returned. If no connection is available within the given
67
- # timeout a Timeout::Error is raised.
57
+ # timeout a Bundler::ConnectionPool::TimeoutError is raised.
68
58
  #
69
59
  # +:timeout+ is the only checked entry in +options+ and is preferred over
70
60
  # the +timeout+ argument (which will be removed in a future release). Other
@@ -74,7 +64,7 @@ class Bundler::ConnectionPool::TimedStack
74
64
  options, timeout = timeout, 0.5 if Hash === timeout
75
65
  timeout = options.fetch :timeout, timeout
76
66
 
77
- deadline = Bundler::ConnectionPool.monotonic_time + timeout
67
+ deadline = current_time + timeout
78
68
  @mutex.synchronize do
79
69
  loop do
80
70
  raise Bundler::ConnectionPool::PoolShuttingDownError if @shutdown_block
@@ -83,18 +73,20 @@ class Bundler::ConnectionPool::TimedStack
83
73
  connection = try_create(options)
84
74
  return connection if connection
85
75
 
86
- to_wait = deadline - Bundler::ConnectionPool.monotonic_time
87
- raise Timeout::Error, "Waited #{timeout} sec" if to_wait <= 0
76
+ to_wait = deadline - current_time
77
+ raise Bundler::ConnectionPool::TimeoutError, "Waited #{timeout} sec" if to_wait <= 0
88
78
  @resource.wait(@mutex, to_wait)
89
79
  end
90
80
  end
91
81
  end
92
82
 
93
83
  ##
94
- # Shuts down the TimedStack which prevents connections from being checked
95
- # out. The +block+ is called once for each connection on the stack.
84
+ # Shuts down the TimedStack by passing each connection to +block+ and then
85
+ # removing it from the pool. Attempting to checkout a connection after
86
+ # shutdown will raise +Bundler::ConnectionPool::PoolShuttingDownError+ unless
87
+ # +:reload+ is +true+.
96
88
 
97
- def shutdown(&block)
89
+ def shutdown(reload: false, &block)
98
90
  raise ArgumentError, "shutdown must receive a block" unless block_given?
99
91
 
100
92
  @mutex.synchronize do
@@ -102,6 +94,7 @@ class Bundler::ConnectionPool::TimedStack
102
94
  @resource.broadcast
103
95
 
104
96
  shutdown_connections
97
+ @shutdown_block = nil if reload
105
98
  end
106
99
  end
107
100
 
@@ -121,6 +114,10 @@ class Bundler::ConnectionPool::TimedStack
121
114
 
122
115
  private
123
116
 
117
+ def current_time
118
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
119
+ end
120
+
124
121
  ##
125
122
  # This is an extension point for TimedStack and is called with a mutex.
126
123
  #
@@ -149,6 +146,7 @@ class Bundler::ConnectionPool::TimedStack
149
146
  conn = fetch_connection(options)
150
147
  @shutdown_block.call(conn)
151
148
  end
149
+ @created = 0
152
150
  end
153
151
 
154
152
  ##
@@ -1,3 +1,3 @@
1
1
  class Bundler::ConnectionPool
2
- VERSION = "2.2.2"
2
+ VERSION = "2.3.0"
3
3
  end
@@ -0,0 +1,57 @@
1
+ class Bundler::ConnectionPool
2
+ class Wrapper < ::BasicObject
3
+ METHODS = [:with, :pool_shutdown, :wrapped_pool]
4
+
5
+ def initialize(options = {}, &block)
6
+ @pool = options.fetch(:pool) { ::Bundler::ConnectionPool.new(options, &block) }
7
+ end
8
+
9
+ def wrapped_pool
10
+ @pool
11
+ end
12
+
13
+ def with(&block)
14
+ @pool.with(&block)
15
+ end
16
+
17
+ def pool_shutdown(&block)
18
+ @pool.shutdown(&block)
19
+ end
20
+
21
+ def pool_size
22
+ @pool.size
23
+ end
24
+
25
+ def pool_available
26
+ @pool.available
27
+ end
28
+
29
+ def respond_to?(id, *args)
30
+ METHODS.include?(id) || with { |c| c.respond_to?(id, *args) }
31
+ end
32
+
33
+ # rubocop:disable Style/MethodMissingSuper
34
+ # rubocop:disable Style/MissingRespondToMissing
35
+ if ::RUBY_VERSION >= "3.0.0"
36
+ def method_missing(name, *args, **kwargs, &block)
37
+ with do |connection|
38
+ connection.send(name, *args, **kwargs, &block)
39
+ end
40
+ end
41
+ elsif ::RUBY_VERSION >= "2.7.0"
42
+ ruby2_keywords def method_missing(name, *args, &block)
43
+ with do |connection|
44
+ connection.send(name, *args, &block)
45
+ end
46
+ end
47
+ else
48
+ def method_missing(name, *args, &block)
49
+ with do |connection|
50
+ connection.send(name, *args, &block)
51
+ end
52
+ end
53
+ end
54
+ # rubocop:enable Style/MethodMissingSuper
55
+ # rubocop:enable Style/MissingRespondToMissing
56
+ end
57
+ end
@@ -1,14 +1,18 @@
1
- require_relative 'connection_pool/version'
2
- require_relative 'connection_pool/timed_stack'
1
+ require "timeout"
2
+ require_relative "connection_pool/version"
3
3
 
4
+ class Bundler::ConnectionPool
5
+ class Error < ::RuntimeError; end
6
+ class PoolShuttingDownError < ::Bundler::ConnectionPool::Error; end
7
+ class TimeoutError < ::Timeout::Error; end
8
+ end
4
9
 
5
- # Generic connection pool class for e.g. sharing a limited number of network connections
6
- # among many threads. Note: Connections are lazily created.
10
+ # Generic connection pool class for sharing a limited number of objects or network connections
11
+ # among many threads. Note: pool elements are lazily created.
7
12
  #
8
13
  # Example usage with block (faster):
9
14
  #
10
15
  # @pool = Bundler::ConnectionPool.new { Redis.new }
11
- #
12
16
  # @pool.with do |redis|
13
17
  # redis.lpop('my-list') if redis.llen('my-list') > 0
14
18
  # end
@@ -34,29 +38,23 @@ require_relative 'connection_pool/timed_stack'
34
38
  class Bundler::ConnectionPool
35
39
  DEFAULTS = {size: 5, timeout: 5}
36
40
 
37
- class Error < RuntimeError
38
- end
39
-
40
41
  def self.wrap(options, &block)
41
42
  Wrapper.new(options, &block)
42
43
  end
43
44
 
44
45
  def initialize(options = {}, &block)
45
- raise ArgumentError, 'Connection pool requires a block' unless block
46
+ raise ArgumentError, "Connection pool requires a block" unless block
46
47
 
47
48
  options = DEFAULTS.merge(options)
48
49
 
49
- @size = options.fetch(:size)
50
+ @size = Integer(options.fetch(:size))
50
51
  @timeout = options.fetch(:timeout)
51
52
 
52
53
  @available = TimedStack.new(@size, &block)
53
- @key = :"current-#{@available.object_id}"
54
- @key_count = :"current-#{@available.object_id}-count"
54
+ @key = :"pool-#{@available.object_id}"
55
+ @key_count = :"pool-#{@available.object_id}-count"
55
56
  end
56
57
 
57
- if Thread.respond_to?(:handle_interrupt)
58
-
59
- # MRI
60
58
  def with(options = {})
61
59
  Thread.handle_interrupt(Exception => :never) do
62
60
  conn = checkout(options)
@@ -69,28 +67,15 @@ if Thread.respond_to?(:handle_interrupt)
69
67
  end
70
68
  end
71
69
  end
72
-
73
- else
74
-
75
- # jruby 1.7.x
76
- def with(options = {})
77
- conn = checkout(options)
78
- begin
79
- yield conn
80
- ensure
81
- checkin
82
- end
83
- end
84
-
85
- end
70
+ alias then with
86
71
 
87
72
  def checkout(options = {})
88
73
  if ::Thread.current[@key]
89
- ::Thread.current[@key_count]+= 1
74
+ ::Thread.current[@key_count] += 1
90
75
  ::Thread.current[@key]
91
76
  else
92
- ::Thread.current[@key_count]= 1
93
- ::Thread.current[@key]= @available.pop(options[:timeout] || @timeout)
77
+ ::Thread.current[@key_count] = 1
78
+ ::Thread.current[@key] = @available.pop(options[:timeout] || @timeout)
94
79
  end
95
80
  end
96
81
 
@@ -98,64 +83,44 @@ end
98
83
  if ::Thread.current[@key]
99
84
  if ::Thread.current[@key_count] == 1
100
85
  @available.push(::Thread.current[@key])
101
- ::Thread.current[@key]= nil
86
+ ::Thread.current[@key] = nil
87
+ ::Thread.current[@key_count] = nil
102
88
  else
103
- ::Thread.current[@key_count]-= 1
89
+ ::Thread.current[@key_count] -= 1
104
90
  end
105
91
  else
106
- raise Bundler::ConnectionPool::Error, 'no connections are checked out'
92
+ raise Bundler::ConnectionPool::Error, "no connections are checked out"
107
93
  end
108
94
 
109
95
  nil
110
96
  end
111
97
 
98
+ ##
99
+ # Shuts down the Bundler::ConnectionPool by passing each connection to +block+ and
100
+ # then removing it from the pool. Attempting to checkout a connection after
101
+ # shutdown will raise +Bundler::ConnectionPool::PoolShuttingDownError+.
102
+
112
103
  def shutdown(&block)
113
104
  @available.shutdown(&block)
114
105
  end
115
106
 
116
- # Size of this connection pool
117
- def size
118
- @size
107
+ ##
108
+ # Reloads the Bundler::ConnectionPool by passing each connection to +block+ and then
109
+ # removing it the pool. Subsequent checkouts will create new connections as
110
+ # needed.
111
+
112
+ def reload(&block)
113
+ @available.shutdown(reload: true, &block)
119
114
  end
120
115
 
116
+ # Size of this connection pool
117
+ attr_reader :size
118
+
121
119
  # Number of pool entries available for checkout at this instant.
122
120
  def available
123
121
  @available.length
124
122
  end
125
-
126
- private
127
-
128
- class Wrapper < ::BasicObject
129
- METHODS = [:with, :pool_shutdown]
130
-
131
- def initialize(options = {}, &block)
132
- @pool = options.fetch(:pool) { ::Bundler::ConnectionPool.new(options, &block) }
133
- end
134
-
135
- def with(&block)
136
- @pool.with(&block)
137
- end
138
-
139
- def pool_shutdown(&block)
140
- @pool.shutdown(&block)
141
- end
142
-
143
- def pool_size
144
- @pool.size
145
- end
146
-
147
- def pool_available
148
- @pool.available
149
- end
150
-
151
- def respond_to?(id, *args)
152
- METHODS.include?(id) || with { |c| c.respond_to?(id, *args) }
153
- end
154
-
155
- def method_missing(name, *args, &block)
156
- with do |connection|
157
- connection.send(name, *args, &block)
158
- end
159
- end
160
- end
161
123
  end
124
+
125
+ require_relative "connection_pool/timed_stack"
126
+ require_relative "connection_pool/wrapper"
@@ -0,0 +1,22 @@
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.
@@ -0,0 +1,9 @@
1
+ This project is licensed under the MIT license.
2
+
3
+ Copyright (c) 2014 Samuel E. Giddins segiddins@segiddins.me
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,82 @@
1
+ = net-http-persistent
2
+
3
+ home :: https://github.com/drbrain/net-http-persistent
4
+ rdoc :: http://docs.seattlerb.org/net-http-persistent
5
+
6
+ == DESCRIPTION:
7
+
8
+ Manages persistent connections using Net::HTTP including a thread pool for
9
+ connecting to multiple hosts.
10
+
11
+ Using persistent HTTP connections can dramatically increase the speed of HTTP.
12
+ Creating a new HTTP connection for every request involves an extra TCP
13
+ round-trip and causes TCP congestion avoidance negotiation to start over.
14
+
15
+ Net::HTTP supports persistent connections with some API methods but does not
16
+ make setting up a single persistent connection or managing multiple
17
+ connections easy. Net::HTTP::Persistent wraps Net::HTTP and allows you to
18
+ focus on how to make HTTP requests.
19
+
20
+ == FEATURES/PROBLEMS:
21
+
22
+ * Supports TLS with secure defaults
23
+ * Thread-safe
24
+ * Pure ruby
25
+
26
+ == SYNOPSIS
27
+
28
+ The following example will make two requests to the same server. The
29
+ connection is kept alive between requests:
30
+
31
+ require 'net/http/persistent'
32
+
33
+ uri = URI 'http://example.com/awesome/web/service'
34
+
35
+ http = Net::HTTP::Persistent.new name: 'my_app_name'
36
+
37
+ # perform a GET
38
+ response = http.request uri
39
+
40
+ # create a POST
41
+ post_uri = uri + 'create'
42
+ post = Net::HTTP::Post.new post_uri.path
43
+ post.set_form_data 'some' => 'cool data'
44
+
45
+ # perform the POST, the URI is always required
46
+ response = http.request post_uri, post
47
+
48
+ # if you are done making http requests, or won't make requests for several
49
+ # minutes
50
+ http.shutdown
51
+
52
+ Please see the documentation on Net::HTTP::Persistent for more information,
53
+ including SSL connection verification, header handling and tunable options.
54
+
55
+ == INSTALL:
56
+
57
+ gem install net-http-persistent
58
+
59
+ == LICENSE:
60
+
61
+ (The MIT License)
62
+
63
+ Copyright (c) Eric Hodel, Aaron Patterson
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining
66
+ a copy of this software and associated documentation files (the
67
+ 'Software'), to deal in the Software without restriction, including
68
+ without limitation the rights to use, copy, modify, merge, publish,
69
+ distribute, sublicense, and/or sell copies of the Software, and to
70
+ permit persons to whom the Software is furnished to do so, subject to
71
+ the following conditions:
72
+
73
+ The above copyright notice and this permission notice shall be
74
+ included in all copies or substantial portions of the Software.
75
+
76
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
77
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
78
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
79
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
80
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
81
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
82
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Yehuda Katz, Eric Hodel, et al.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.26".freeze
4
+ VERSION = "2.2.30".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -21,8 +21,8 @@ module Bundler
21
21
  # @param func [Proc] job to run in inside the worker pool
22
22
  def initialize(size, name, func)
23
23
  @name = name
24
- @request_queue = Queue.new
25
- @response_queue = Queue.new
24
+ @request_queue = Thread::Queue.new
25
+ @response_queue = Thread::Queue.new
26
26
  @func = func
27
27
  @size = size
28
28
  @threads = nil
@@ -37,12 +37,13 @@ module Bundler
37
37
  environment_preserver = EnvironmentPreserver.from_env
38
38
  ORIGINAL_ENV = environment_preserver.restore
39
39
  environment_preserver.replace_with_backup
40
- SUDO_MUTEX = Mutex.new
40
+ SUDO_MUTEX = Thread::Mutex.new
41
41
 
42
42
  autoload :Definition, File.expand_path("bundler/definition", __dir__)
43
43
  autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
44
44
  autoload :DepProxy, File.expand_path("bundler/dep_proxy", __dir__)
45
45
  autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
46
+ autoload :Digest, File.expand_path("bundler/digest", __dir__)
46
47
  autoload :Dsl, File.expand_path("bundler/dsl", __dir__)
47
48
  autoload :EndpointSpecification, File.expand_path("bundler/endpoint_specification", __dir__)
48
49
  autoload :Env, File.expand_path("bundler/env", __dir__)
@@ -636,6 +637,12 @@ EOF
636
637
  @rubygems = nil
637
638
  end
638
639
 
640
+ def configure_gem_home_and_path(path = bundle_path)
641
+ configure_gem_path
642
+ configure_gem_home(path)
643
+ Bundler.rubygems.clear_paths
644
+ end
645
+
639
646
  private
640
647
 
641
648
  def eval_yaml_gemspec(path, contents)
@@ -656,29 +663,17 @@ EOF
656
663
  raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
657
664
  end
658
665
 
659
- def configure_gem_home_and_path
660
- configure_gem_path
661
- configure_gem_home
662
- bundle_path
663
- end
664
-
665
- def configure_gem_path(env = ENV)
666
- blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
667
- if !use_system_gems?
666
+ def configure_gem_path
667
+ unless use_system_gems?
668
668
  # this needs to be empty string to cause
669
669
  # PathSupport.split_gem_path to only load up the
670
670
  # Bundler --path setting as the GEM_PATH.
671
- env["GEM_PATH"] = ""
672
- elsif blank_home
673
- possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
674
- paths = possibles.flatten.compact.uniq.reject(&:empty?)
675
- env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
671
+ Bundler::SharedHelpers.set_env "GEM_PATH", ""
676
672
  end
677
673
  end
678
674
 
679
- def configure_gem_home
680
- Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root)
681
- Bundler.rubygems.clear_paths
675
+ def configure_gem_home(path)
676
+ Bundler::SharedHelpers.set_env "GEM_HOME", path.to_s
682
677
  end
683
678
 
684
679
  def tmp_home_path
@@ -5,9 +5,9 @@
5
5
  # See LICENSE.txt for permissions.
6
6
  #++
7
7
 
8
- require 'rubygems/command'
9
- require 'rubygems/user_interaction'
10
- require 'rubygems/text'
8
+ require_relative 'command'
9
+ require_relative 'user_interaction'
10
+ require_relative 'text'
11
11
 
12
12
  ##
13
13
  # The command manager registers and installs all the individual sub-commands
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
- require 'rubygems/command'
3
- require 'rubygems/package'
4
- require 'rubygems/version_option'
2
+ require_relative '../command'
3
+ require_relative '../package'
4
+ require_relative '../version_option'
5
5
 
6
6
  class Gem::Commands::BuildCommand < Gem::Command
7
7
  include Gem::VersionOption