rubygems-update 2.6.8 → 2.6.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +9 -6
- data/CODE_OF_CONDUCT.md +36 -33
- data/History.txt +16 -0
- data/Manifest.txt +5 -3
- data/Rakefile +5 -0
- data/bundler/CHANGELOG.md +72 -0
- data/bundler/DEVELOPMENT.md +2 -2
- data/bundler/README.md +5 -0
- data/bundler/lib/bundler.rb +1 -1
- data/bundler/lib/bundler/cli.rb +42 -29
- data/bundler/lib/bundler/cli/common.rb +17 -0
- data/bundler/lib/bundler/cli/exec.rb +6 -0
- data/bundler/lib/bundler/cli/gem.rb +16 -3
- data/bundler/lib/bundler/cli/install.rb +7 -20
- data/bundler/lib/bundler/cli/lock.rb +1 -1
- data/bundler/lib/bundler/cli/open.rb +2 -1
- data/bundler/lib/bundler/cli/outdated.rb +91 -43
- data/bundler/lib/bundler/cli/update.rb +3 -10
- data/bundler/lib/bundler/compact_index_client.rb +7 -1
- data/bundler/lib/bundler/current_ruby.rb +1 -0
- data/bundler/lib/bundler/definition.rb +9 -5
- data/bundler/lib/bundler/dependency.rb +12 -0
- data/bundler/lib/bundler/env.rb +25 -20
- data/bundler/lib/bundler/errors.rb +21 -0
- data/bundler/lib/bundler/fetcher.rb +2 -2
- data/bundler/lib/bundler/fetcher/compact_index.rb +15 -3
- data/bundler/lib/bundler/friendly_errors.rb +23 -7
- data/bundler/lib/bundler/index.rb +9 -4
- data/bundler/lib/bundler/inline.rb +1 -1
- data/bundler/lib/bundler/installer.rb +1 -1
- data/bundler/lib/bundler/installer/gem_installer.rb +2 -2
- data/bundler/lib/bundler/installer/parallel_installer.rb +40 -9
- data/bundler/lib/bundler/lockfile_parser.rb +0 -1
- data/bundler/lib/bundler/match_platform.rb +12 -4
- data/bundler/lib/bundler/plugin/api.rb +2 -1
- data/bundler/lib/bundler/plugin/api/source.rb +1 -1
- data/bundler/lib/bundler/postit_trampoline.rb +3 -3
- data/bundler/lib/bundler/resolver.rb +6 -1
- data/bundler/lib/bundler/retry.rb +4 -1
- data/bundler/lib/bundler/rubygems_gem_installer.rb +18 -6
- data/bundler/lib/bundler/rubygems_integration.rb +16 -3
- data/bundler/lib/bundler/settings.rb +8 -3
- data/bundler/lib/bundler/shared_helpers.rb +15 -12
- data/bundler/lib/bundler/source.rb +4 -0
- data/bundler/lib/bundler/source/git/git_proxy.rb +2 -1
- data/bundler/lib/bundler/source/rubygems.rb +9 -0
- data/bundler/lib/bundler/spec_set.rb +4 -0
- data/bundler/lib/bundler/templates/newgem/gitignore.tt +5 -0
- data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +10 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +10 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -2
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -2
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +10 -3
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +12 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -2
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +2 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +27 -19
- data/bundler/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/faster.rb +1 -0
- data/bundler/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +24 -23
- data/bundler/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb +2 -1
- data/bundler/lib/bundler/vendored_persistent.rb +9 -4
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler/worker.rb +27 -5
- data/bundler/man/bundle-config.ronn +28 -1
- data/bundler/man/bundle-install.ronn +1 -1
- data/bundler/man/bundle-lock.ronn +47 -0
- data/bundler/man/bundle-outdated.ronn +107 -0
- data/bundler/man/bundle-update.ronn +152 -3
- data/bundler/man/bundle.ronn +22 -4
- data/bundler/man/gemfile.5.ronn +16 -0
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +5 -3
- data/lib/rubygems/ext/rake_builder.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +3 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +9 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +2 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +17 -17
- data/lib/rubygems/server.rb +11 -4
- data/lib/rubygems/stub_specification.rb +6 -1
- data/lib/rubygems/version.rb +6 -2
- data/test/rubygems/test_gem.rb +2 -0
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +23 -0
- data/test/rubygems/test_gem_ext_rake_builder.rb +34 -17
- data/test/rubygems/test_gem_server.rb +16 -0
- data/test/rubygems/test_gem_specification.rb +1 -1
- data/test/rubygems/test_gem_stub_specification.rb +61 -0
- data/test/rubygems/test_gem_version.rb +6 -0
- data/util/ci +5 -5
- metadata +31 -29
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular'
|
3
3
|
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex'
|
4
|
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge'
|
4
5
|
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named'
|
5
6
|
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload'
|
6
7
|
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag'
|
@@ -40,6 +41,16 @@ module Bundler::Molinillo
|
|
40
41
|
push_action(graph, AddEdgeNoCircular.new(origin, destination, requirement))
|
41
42
|
end
|
42
43
|
|
44
|
+
# {include:DependencyGraph#delete_edge}
|
45
|
+
# @param [Graph] graph the graph to perform the action on
|
46
|
+
# @param [String] origin_name
|
47
|
+
# @param [String] destination_name
|
48
|
+
# @param [Object] requirement
|
49
|
+
# @return (see DependencyGraph#delete_edge)
|
50
|
+
def delete_edge(graph, origin_name, destination_name, requirement)
|
51
|
+
push_action(graph, DeleteEdge.new(origin_name, destination_name, requirement))
|
52
|
+
end
|
53
|
+
|
43
54
|
# @macro action
|
44
55
|
def set_payload(graph, name, payload)
|
45
56
|
push_action(graph, SetPayload.new(name, payload))
|
@@ -92,7 +103,7 @@ module Bundler::Molinillo
|
|
92
103
|
loop do
|
93
104
|
action = pop!(graph)
|
94
105
|
raise "No tag #{tag.inspect} found" unless action
|
95
|
-
break if action.class.
|
106
|
+
break if action.class.action_name == :tag && action.tag == tag
|
96
107
|
end
|
97
108
|
end
|
98
109
|
|
@@ -81,6 +81,7 @@ module Bundler::Molinillo
|
|
81
81
|
# @return [Boolean] whether the two vertices are equal, determined
|
82
82
|
# by a recursive traversal of each {Vertex#successors}
|
83
83
|
def ==(other)
|
84
|
+
return true if equal?(other)
|
84
85
|
shallow_eql?(other) &&
|
85
86
|
successors.to_set == other.successors.to_set
|
86
87
|
end
|
@@ -89,6 +90,7 @@ module Bundler::Molinillo
|
|
89
90
|
# @return [Boolean] whether the two vertices are equal, determined
|
90
91
|
# solely by {#name} and {#payload} equality
|
91
92
|
def shallow_eql?(other)
|
93
|
+
return true if equal?(other)
|
92
94
|
other &&
|
93
95
|
name == other.name &&
|
94
96
|
payload == other.payload
|
@@ -194,18 +194,20 @@ module Bundler::Molinillo
|
|
194
194
|
def state_index_for_unwind
|
195
195
|
current_requirement = requirement
|
196
196
|
existing_requirement = requirement_for_existing_name(name)
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
197
|
+
index = -1
|
198
|
+
[current_requirement, existing_requirement].each do |r|
|
199
|
+
until r.nil?
|
200
|
+
current_state = find_state_for(r)
|
201
|
+
if state_any?(current_state)
|
202
|
+
current_index = states.index(current_state)
|
203
|
+
index = current_index if current_index > index
|
204
|
+
break
|
205
|
+
end
|
206
|
+
r = parent_of(r)
|
207
|
+
end
|
201
208
|
end
|
202
209
|
|
203
|
-
|
204
|
-
existing_state = find_state_for(existing_requirement)
|
205
|
-
return states.index(existing_state) if state_any?(existing_state)
|
206
|
-
existing_requirement = parent_of(existing_requirement)
|
207
|
-
end
|
208
|
-
-1
|
210
|
+
index
|
209
211
|
end
|
210
212
|
|
211
213
|
# @return [Object] the requirement that led to `requirement` being added
|
@@ -356,18 +358,24 @@ module Bundler::Molinillo
|
|
356
358
|
# @return [void]
|
357
359
|
def fixup_swapped_children(vertex)
|
358
360
|
payload = vertex.payload
|
359
|
-
|
360
|
-
vertex.
|
361
|
-
|
361
|
+
deps = dependencies_for(payload).group_by(&method(:name_for))
|
362
|
+
vertex.outgoing_edges.each do |outgoing_edge|
|
363
|
+
@parent_of[outgoing_edge.requirement] = states.size - 1
|
364
|
+
succ = outgoing_edge.destination
|
365
|
+
matching_deps = Array(deps[succ.name])
|
366
|
+
if matching_deps.empty? && !succ.root? && succ.predecessors.to_a == [vertex]
|
362
367
|
debug(depth) { "Removing orphaned spec #{succ.name} after swapping #{name}" }
|
363
|
-
|
364
|
-
|
365
|
-
all_successor_names = succ.recursive_successors.map(&:name)
|
368
|
+
succ.requirements.each { |r| @parent_of.delete(r) }
|
366
369
|
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
+
removed_names = activated.detach_vertex_named(succ.name).map(&:name)
|
371
|
+
requirements.delete_if do |r|
|
372
|
+
# the only removed vertices are those with no other requirements,
|
373
|
+
# so it's safe to delete only based upon name here
|
374
|
+
removed_names.include?(name_for(r))
|
370
375
|
end
|
376
|
+
elsif !matching_deps.include?(outgoing_edge.requirement)
|
377
|
+
activated.delete_edge(outgoing_edge)
|
378
|
+
requirements.delete(outgoing_edge.requirement)
|
371
379
|
end
|
372
380
|
end
|
373
381
|
end
|
@@ -4,7 +4,7 @@ begin
|
|
4
4
|
rescue LoadError
|
5
5
|
# net/https or openssl
|
6
6
|
end if RUBY_VERSION < '1.9' # but only for 1.8
|
7
|
-
require 'net/http/faster'
|
7
|
+
require 'bundler/vendor/net-http-persistent/lib/net/http/faster'
|
8
8
|
require 'uri'
|
9
9
|
require 'cgi' # for escaping
|
10
10
|
|
@@ -18,27 +18,27 @@ autoload :OpenSSL, 'openssl'
|
|
18
18
|
##
|
19
19
|
# Persistent connections for Net::HTTP
|
20
20
|
#
|
21
|
-
# Net::HTTP::Persistent maintains persistent connections across all the
|
21
|
+
# Bundler::Persistent::Net::HTTP::Persistent maintains persistent connections across all the
|
22
22
|
# servers you wish to talk to. For each host:port you communicate with a
|
23
23
|
# single persistent connection is created.
|
24
24
|
#
|
25
|
-
# Multiple Net::HTTP::Persistent objects will share the same set of
|
25
|
+
# Multiple Bundler::Persistent::Net::HTTP::Persistent objects will share the same set of
|
26
26
|
# connections.
|
27
27
|
#
|
28
28
|
# For each thread you start a new connection will be created. A
|
29
|
-
# Net::HTTP::Persistent connection will not be shared across threads.
|
29
|
+
# Bundler::Persistent::Net::HTTP::Persistent connection will not be shared across threads.
|
30
30
|
#
|
31
31
|
# You can shut down the HTTP connections when done by calling #shutdown. You
|
32
|
-
# should name your Net::HTTP::Persistent object if you intend to call this
|
32
|
+
# should name your Bundler::Persistent::Net::HTTP::Persistent object if you intend to call this
|
33
33
|
# method.
|
34
34
|
#
|
35
35
|
# Example:
|
36
36
|
#
|
37
|
-
# require 'net/http/persistent'
|
37
|
+
# require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
|
38
38
|
#
|
39
39
|
# uri = URI 'http://example.com/awesome/web/service'
|
40
40
|
#
|
41
|
-
# http = Net::HTTP::Persistent.new 'my_app_name'
|
41
|
+
# http = Bundler::Persistent::Net::HTTP::Persistent.new 'my_app_name'
|
42
42
|
#
|
43
43
|
# # perform a GET
|
44
44
|
# response = http.request uri
|
@@ -149,19 +149,19 @@ autoload :OpenSSL, 'openssl'
|
|
149
149
|
#
|
150
150
|
# The recommended way to handle non-idempotent requests is the following:
|
151
151
|
#
|
152
|
-
# require 'net/http/persistent'
|
152
|
+
# require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
|
153
153
|
#
|
154
154
|
# uri = URI 'http://example.com/awesome/web/service'
|
155
155
|
# post_uri = uri + 'create'
|
156
156
|
#
|
157
|
-
# http = Net::HTTP::Persistent.new 'my_app_name'
|
157
|
+
# http = Bundler::Persistent::Net::HTTP::Persistent.new 'my_app_name'
|
158
158
|
#
|
159
159
|
# post = Net::HTTP::Post.new post_uri.path
|
160
160
|
# # ... fill in POST request
|
161
161
|
#
|
162
162
|
# begin
|
163
163
|
# response = http.request post_uri, post
|
164
|
-
# rescue Net::HTTP::Persistent::Error
|
164
|
+
# rescue Bundler::Persistent::Net::HTTP::Persistent::Error
|
165
165
|
#
|
166
166
|
# # POST failed, make a new request to verify the server did not process
|
167
167
|
# # the request
|
@@ -178,7 +178,7 @@ autoload :OpenSSL, 'openssl'
|
|
178
178
|
#
|
179
179
|
# === Connection Termination
|
180
180
|
#
|
181
|
-
# If you are done using the Net::HTTP::Persistent instance you may shut down
|
181
|
+
# If you are done using the Bundler::Persistent::Net::HTTP::Persistent instance you may shut down
|
182
182
|
# all the connections in the current thread with #shutdown. This is not
|
183
183
|
# recommended for normal use, it should only be used when it will be several
|
184
184
|
# minutes before you make another HTTP request.
|
@@ -188,7 +188,7 @@ autoload :OpenSSL, 'openssl'
|
|
188
188
|
# Ruby will automatically garbage collect and shutdown your HTTP connections
|
189
189
|
# when the thread terminates.
|
190
190
|
|
191
|
-
class Net::HTTP::Persistent
|
191
|
+
class Bundler::Persistent::Net::HTTP::Persistent
|
192
192
|
|
193
193
|
##
|
194
194
|
# The beginning of Time
|
@@ -201,9 +201,9 @@ class Net::HTTP::Persistent
|
|
201
201
|
HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:
|
202
202
|
|
203
203
|
##
|
204
|
-
# The version of Net::HTTP::Persistent you are using
|
204
|
+
# The version of Bundler::Persistent::Net::HTTP::Persistent you are using
|
205
205
|
|
206
|
-
VERSION = '2.9.
|
206
|
+
VERSION = '2.9.4'
|
207
207
|
|
208
208
|
##
|
209
209
|
# Exceptions rescued for automatic retry on ruby 2.0.0. This overlaps with
|
@@ -221,7 +221,7 @@ class Net::HTTP::Persistent
|
|
221
221
|
].compact
|
222
222
|
|
223
223
|
##
|
224
|
-
# Error class for errors raised by Net::HTTP::Persistent. Various
|
224
|
+
# Error class for errors raised by Bundler::Persistent::Net::HTTP::Persistent. Various
|
225
225
|
# SystemCallErrors are re-raised with a human-readable message under this
|
226
226
|
# class.
|
227
227
|
|
@@ -241,7 +241,7 @@ class Net::HTTP::Persistent
|
|
241
241
|
# NOTE: This may not work on ruby > 1.9.
|
242
242
|
|
243
243
|
def self.detect_idle_timeout uri, max = 10
|
244
|
-
uri = URI uri unless
|
244
|
+
uri = URI uri unless URI::Generic === uri
|
245
245
|
uri += '/'
|
246
246
|
|
247
247
|
req = Net::HTTP::Head.new uri.request_uri
|
@@ -257,7 +257,7 @@ class Net::HTTP::Persistent
|
|
257
257
|
|
258
258
|
$stderr.puts "HEAD #{uri} => #{response.code}" if $DEBUG
|
259
259
|
|
260
|
-
unless
|
260
|
+
unless Net::HTTPOK === response then
|
261
261
|
raise Error, "bad response code #{response.code} detecting idle timeout"
|
262
262
|
end
|
263
263
|
|
@@ -463,7 +463,7 @@ class Net::HTTP::Persistent
|
|
463
463
|
attr_accessor :retry_change_requests
|
464
464
|
|
465
465
|
##
|
466
|
-
# Creates a new Net::HTTP::Persistent.
|
466
|
+
# Creates a new Bundler::Persistent::Net::HTTP::Persistent.
|
467
467
|
#
|
468
468
|
# Set +name+ to keep your connections apart from everybody else's. Not
|
469
469
|
# required currently, but highly recommended. Your library name should be
|
@@ -594,7 +594,7 @@ class Net::HTTP::Persistent
|
|
594
594
|
use_ssl = uri.scheme.downcase == 'https'
|
595
595
|
|
596
596
|
if use_ssl then
|
597
|
-
raise Net::HTTP::Persistent::Error, 'OpenSSL is not available' unless
|
597
|
+
raise Bundler::Persistent::Net::HTTP::Persistent::Error, 'OpenSSL is not available' unless
|
598
598
|
HAVE_OPENSSL
|
599
599
|
|
600
600
|
ssl_generation = @ssl_generation
|
@@ -728,7 +728,7 @@ class Net::HTTP::Persistent
|
|
728
728
|
} or not @reuse_ssl_sessions then
|
729
729
|
Net::HTTP
|
730
730
|
else
|
731
|
-
Net::HTTP::Persistent::SSLReuse
|
731
|
+
Bundler::Persistent::Net::HTTP::Persistent::SSLReuse
|
732
732
|
end
|
733
733
|
end
|
734
734
|
|
@@ -1065,7 +1065,7 @@ class Net::HTTP::Persistent
|
|
1065
1065
|
# Returns the request.
|
1066
1066
|
|
1067
1067
|
def request_setup req_or_uri # :nodoc:
|
1068
|
-
req = if
|
1068
|
+
req = if URI === req_or_uri then
|
1069
1069
|
Net::HTTP::Get.new req_or_uri.request_uri
|
1070
1070
|
else
|
1071
1071
|
req_or_uri
|
@@ -1092,7 +1092,7 @@ class Net::HTTP::Persistent
|
|
1092
1092
|
#
|
1093
1093
|
# Uses the current thread by default.
|
1094
1094
|
#
|
1095
|
-
# If you've used Net::HTTP::Persistent across multiple threads you should
|
1095
|
+
# If you've used Bundler::Persistent::Net::HTTP::Persistent across multiple threads you should
|
1096
1096
|
# call this in each thread when you're done making HTTP requests.
|
1097
1097
|
#
|
1098
1098
|
# *NOTE*: Calling shutdown for another thread can be dangerous!
|
@@ -1227,4 +1227,5 @@ application:
|
|
1227
1227
|
|
1228
1228
|
end
|
1229
1229
|
|
1230
|
-
require 'net/http/persistent/ssl_reuse'
|
1230
|
+
require 'bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse'
|
1231
|
+
|
data/bundler/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb
RENAMED
@@ -7,7 +7,7 @@
|
|
7
7
|
# This class is an implementation detail and is subject to change or removal
|
8
8
|
# at any time.
|
9
9
|
|
10
|
-
class Net::HTTP::Persistent::SSLReuse < Net::HTTP
|
10
|
+
class Bundler::Persistent::Net::HTTP::Persistent::SSLReuse < Net::HTTP
|
11
11
|
|
12
12
|
@is_proxy_class = false
|
13
13
|
@proxy_addr = nil
|
@@ -126,3 +126,4 @@ class Net::HTTP::Persistent::SSLReuse < Net::HTTP
|
|
126
126
|
private :connect
|
127
127
|
|
128
128
|
end
|
129
|
+
|
@@ -6,7 +6,12 @@ begin
|
|
6
6
|
rescue LoadError
|
7
7
|
# some Ruby builds don't have OpenSSL
|
8
8
|
end
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
module Bundler
|
10
|
+
module Persistent
|
11
|
+
module Net
|
12
|
+
module HTTP
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
require "bundler/vendor/net-http-persistent/lib/net/http/persistent"
|
@@ -7,5 +7,5 @@ module Bundler
|
|
7
7
|
# We're doing this because we might write tests that deal
|
8
8
|
# with other versions of bundler and we are unsure how to
|
9
9
|
# handle this better.
|
10
|
-
VERSION = "1.
|
10
|
+
VERSION = "1.14.0.pre.2" unless defined?(::Bundler::VERSION)
|
11
11
|
end
|
@@ -25,11 +25,8 @@ module Bundler
|
|
25
25
|
@request_queue = Queue.new
|
26
26
|
@response_queue = Queue.new
|
27
27
|
@func = func
|
28
|
-
@
|
29
|
-
|
30
|
-
thread.name = "#{name} Worker ##{i}" if thread.respond_to?(:name=)
|
31
|
-
end
|
32
|
-
end
|
28
|
+
@size = size
|
29
|
+
@threads = nil
|
33
30
|
trap("INT") { abort_threads }
|
34
31
|
end
|
35
32
|
|
@@ -37,6 +34,7 @@ module Bundler
|
|
37
34
|
#
|
38
35
|
# @param obj [String] mostly it is name of spec that should be downloaded
|
39
36
|
def enq(obj)
|
37
|
+
create_threads unless @threads
|
40
38
|
@request_queue.enq obj
|
41
39
|
end
|
42
40
|
|
@@ -70,13 +68,37 @@ module Bundler
|
|
70
68
|
# Stop the worker threads by sending a poison object down the request queue
|
71
69
|
# so as worker threads after retrieving it, shut themselves down
|
72
70
|
def stop_threads
|
71
|
+
return unless @threads
|
73
72
|
@threads.each { @request_queue.enq POISON }
|
74
73
|
@threads.each(&:join)
|
74
|
+
@threads = nil
|
75
75
|
end
|
76
76
|
|
77
77
|
def abort_threads
|
78
|
+
return unless @threads
|
78
79
|
@threads.each(&:exit)
|
79
80
|
exit 1
|
80
81
|
end
|
82
|
+
|
83
|
+
def create_threads
|
84
|
+
creation_errors = []
|
85
|
+
|
86
|
+
@threads = Array.new(@size) do |i|
|
87
|
+
begin
|
88
|
+
Thread.start { process_queue(i) }.tap do |thread|
|
89
|
+
thread.name = "#{name} Worker ##{i}" if thread.respond_to?(:name=)
|
90
|
+
end
|
91
|
+
rescue ThreadError => e
|
92
|
+
creation_errors << e
|
93
|
+
nil
|
94
|
+
end
|
95
|
+
end.compact
|
96
|
+
|
97
|
+
return if creation_errors.empty?
|
98
|
+
|
99
|
+
message = "Failed to create threads for the #{name} worker: #{creation_errors.map(&:to_s).uniq.join(", ")}"
|
100
|
+
raise ThreadCreationError, message if @threads.empty?
|
101
|
+
Bundler.ui.info message
|
102
|
+
end
|
81
103
|
end
|
82
104
|
end
|
@@ -65,7 +65,7 @@ The options that can be configured are:
|
|
65
65
|
The location to install the specified gems to. This defaults to Rubygems'
|
66
66
|
setting. Bundler shares this location with Rubygems, `gem install ...` will
|
67
67
|
have gem installed there, too. Therefore, gems installed without a
|
68
|
-
`--path ...` setting will show up by calling `gem list`.
|
68
|
+
`--path ...` setting will show up by calling `gem list`. Accordingly, gems
|
69
69
|
installed to other locations will not get listed.
|
70
70
|
|
71
71
|
* `without`:
|
@@ -155,6 +155,20 @@ learn more about their operation in [bundle install(1)][bundle-install].
|
|
155
155
|
The number of redirects allowed for network requests. Defaults to `5`.
|
156
156
|
* `timeout` (`BUNDLE_TIMEOUT`):
|
157
157
|
The seconds allowed before timing out for network requests. Defaults to `10`.
|
158
|
+
* `force_ruby_platform` (`BUNDLE_FORCE_RUBY_PLATFORM`):
|
159
|
+
Ignore the current machine's platform and install only `ruby` platform gems.
|
160
|
+
As a result, gems with native extensions will be compiled from source.
|
161
|
+
* `specific_platform` (`BUNDLE_SPECIFIC_PLATFORM`):
|
162
|
+
Allow bundler to resolve for the specific running platform and store it in
|
163
|
+
the lockfile, instead of only using a generic platform.
|
164
|
+
A specific platform is the exact platform triple reported by
|
165
|
+
`Gem::Platform.local`, such as `x86_64-darwin-16` or `universal-java-1.8`.
|
166
|
+
On the other hand, generic platforms are those such as `ruby`, `mswin`, or
|
167
|
+
`java`. In this example, `x86_64-darwin-16` would map to `ruby` and
|
168
|
+
`universal-java-1.8` to `java`.
|
169
|
+
* `disable_checksum_validation` (`BUNDLE_DISABLE_CHECKSUM_VALIDATION`):
|
170
|
+
Allow installing gems even if they do not match the checksum provided by
|
171
|
+
RubyGems.
|
158
172
|
|
159
173
|
In general, you should set these settings per-application by using the applicable
|
160
174
|
flag to the [bundle install(1)][bundle-install] or [bundle package(1)][bundle-package] command.
|
@@ -223,3 +237,16 @@ For example, to save the credentials of user `claudette` for the gem source at
|
|
223
237
|
Or you can set the credentials as an environment variable like this:
|
224
238
|
|
225
239
|
export BUNDLE_GEMS__LONGEROUS__COM="claudette:s00pers3krit"
|
240
|
+
|
241
|
+
For gems with a git source with HTTP(S) URL you can specify credentials like so:
|
242
|
+
|
243
|
+
bundle config https://github.com/bundler/bundler.git username:password
|
244
|
+
|
245
|
+
Or you can set the credentials as an environment variable like so:
|
246
|
+
|
247
|
+
export BUNDLE_GITHUB__COM=username:password
|
248
|
+
|
249
|
+
This is especially useful for private repositories on hosts such as Github,
|
250
|
+
where you can use personal OAuth tokens:
|
251
|
+
|
252
|
+
export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic
|