File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,11 @@ def caching?
4040 # Exposes middleware builder to facilitate custom stacks and easy
4141 # addition of new extensions such as cache adapter.
4242 #
43- def stack ( options = { } , &block )
43+ # @api public
44+ def stack ( options = { } )
4445 @stack ||= begin
4546 builder_class = defined? ( Faraday ::RackBuilder ) ? Faraday ::RackBuilder : Faraday ::Builder
46-
47- if block_given?
48- builder_class . new ( &block )
49- else
50- builder_class . new ( &Github . default_middleware ( options ) )
51- end
47+ builder_class . new ( &Github . default_middleware ( options ) )
5248 end
5349 end
5450
@@ -58,7 +54,8 @@ def stack(options = {}, &block)
5854 def connection ( api , options = { } )
5955 connection_options = default_options ( options )
6056 clear_cache unless options . empty?
61- connection_options . merge! ( builder : stack ( options . merge! ( api : api ) ) )
57+ builder = api . stack ? api . stack : stack ( options . merge! ( api : api ) )
58+ connection_options . merge! ( builder : builder )
6259 if ENV [ 'DEBUG' ]
6360 p "Connection options : \n "
6461 pp connection_options
You can’t perform that action at this time.
0 commit comments