Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-faraday for openSUSE:Factory 
checked in at 2022-10-12 18:24:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-faraday (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-faraday.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-faraday"

Wed Oct 12 18:24:44 2022 rev:31 rq:1010054 version:2.6.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-faraday/rubygem-faraday.changes  
2022-08-27 11:50:10.557854142 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-faraday.new.2275/rubygem-faraday.changes    
    2022-10-12 18:26:23.533914478 +0200
@@ -1,0 +2,7 @@
+Mon Oct 10 13:04:34 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 2.6.0
+ see installed CHANGELOG.md
+
+
+-------------------------------------------------------------------

Old:
----
  faraday-2.5.2.gem

New:
----
  faraday-2.6.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-faraday.spec ++++++
--- /var/tmp/diff_new_pack.La0vsc/_old  2022-10-12 18:26:24.017915544 +0200
+++ /var/tmp/diff_new_pack.La0vsc/_new  2022-10-12 18:26:24.021915553 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-faraday
-Version:        2.5.2
+Version:        2.6.0
 Release:        0
 %define mod_name faraday
 %define mod_full_name %{mod_name}-%{version}

++++++ faraday-2.5.2.gem -> faraday-2.6.0.gem ++++++
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/faraday/connection.rb 
new/lib/faraday/connection.rb
--- old/lib/faraday/connection.rb       2022-08-11 17:02:21.000000000 +0200
+++ new/lib/faraday/connection.rb       2022-10-03 18:29:46.000000000 +0200
@@ -130,10 +130,10 @@
     # Makes a GET HTTP request without a body.
     # @!scope class
     #
-    # @param url [String] The optional String base URL to use as a prefix for
+    # @param url [String, URI, nil] The optional String base URL to use as a 
prefix for
     #            all requests.  Can also be the options Hash.
-    # @param params [Hash] Hash of URI query unencoded key/value pairs.
-    # @param headers [Hash] unencoded HTTP header key/value pairs.
+    # @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+    # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
     #
     # @example
     #   conn.get '/items', { page: 1 }, :accept => 'application/json'
@@ -152,10 +152,10 @@
     # Makes a HEAD HTTP request without a body.
     # @!scope class
     #
-    # @param url [String] The optional String base URL to use as a prefix for
+    # @param url [String, URI, nil] The optional String base URL to use as a 
prefix for
     #            all requests.  Can also be the options Hash.
-    # @param params [Hash] Hash of URI query unencoded key/value pairs.
-    # @param headers [Hash] unencoded HTTP header key/value pairs.
+    # @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+    # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
     #
     # @example
     #   conn.head '/items/1'
@@ -167,10 +167,10 @@
     # Makes a DELETE HTTP request without a body.
     # @!scope class
     #
-    # @param url [String] The optional String base URL to use as a prefix for
+    # @param url [String, URI, nil] The optional String base URL to use as a 
prefix for
     #            all requests.  Can also be the options Hash.
-    # @param params [Hash] Hash of URI query unencoded key/value pairs.
-    # @param headers [Hash] unencoded HTTP header key/value pairs.
+    # @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+    # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
     #
     # @example
     #   conn.delete '/items/1'
@@ -182,10 +182,10 @@
     # Makes a TRACE HTTP request without a body.
     # @!scope class
     #
-    # @param url [String] The optional String base URL to use as a prefix for
+    # @param url [String, URI, nil] The optional String base URL to use as a 
prefix for
     #            all requests.  Can also be the options Hash.
-    # @param params [Hash] Hash of URI query unencoded key/value pairs.
-    # @param headers [Hash] unencoded HTTP header key/value pairs.
+    # @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+    # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
     #
     # @example
     #   conn.connect '/items/1'
@@ -210,9 +210,9 @@
     #
     # @overload options(url, params = nil, headers = nil)
     #   Makes an OPTIONS HTTP request to the given URL.
-    #   @param url [String] String base URL to sue as a prefix for all 
requests.
-    #   @param params [Hash] Hash of URI query unencoded key/value pairs.
-    #   @param headers [Hash] unencoded HTTP header key/value pairs.
+    #   @param url [String, URI, nil] String base URL to sue as a prefix for 
all requests.
+    #   @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+    #   @param headers [Hash, nil] unencoded HTTP header key/value pairs.
     #
     # @example
     #   conn.options '/items/1'
@@ -233,10 +233,10 @@
     # Makes a POST HTTP request with a body.
     # @!scope class
     #
-    # @param url [String] The optional String base URL to use as a prefix for
+    # @param url [String, URI, nil] The optional String base URL to use as a 
prefix for
     #            all requests.  Can also be the options Hash.
-    # @param body [String] body for the request.
-    # @param headers [Hash] unencoded HTTP header key/value pairs.
+    # @param body [String, nil] body for the request.
+    # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
     #
     # @example
     #   conn.post '/items', data, content_type: 'application/json'
@@ -255,10 +255,10 @@
     # Makes a PUT HTTP request with a body.
     # @!scope class
     #
-    # @param url [String] The optional String base URL to use as a prefix for
+    # @param url [String, URI, nil] The optional String base URL to use as a 
prefix for
     #            all requests.  Can also be the options Hash.
-    # @param body [String] body for the request.
-    # @param headers [Hash] unencoded HTTP header key/value pairs.
+    # @param body [String, nil] body for the request.
+    # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
     #
     # @example
     #   # TODO: Make it a PUT example
@@ -390,7 +390,7 @@
     # Takes a relative url for a request and combines it with the defaults
     # set on the connection instance.
     #
-    # @param url [String]
+    # @param url [String, URI, nil]
     # @param extra_params [Hash]
     #
     # @example
@@ -423,10 +423,10 @@
     # Builds and runs the Faraday::Request.
     #
     # @param method [Symbol] HTTP method.
-    # @param url [String, URI] String or URI to access.
-    # @param body [Object] The request body that will eventually be converted 
to
+    # @param url [String, URI, nil] String or URI to access.
+    # @param body [String, nil] The request body that will eventually be 
converted to
     #             a string.
-    # @param headers [Hash] unencoded HTTP header key/value pairs.
+    # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
     #
     # @return [Faraday::Response]
     def run_request(method, url, body, headers)
@@ -462,7 +462,7 @@
 
     # Build an absolute URL based on url_prefix.
     #
-    # @param url [String, URI]
+    # @param url [String, URI, nil]
     # @param params [Faraday::Utils::ParamsHash] A Faraday::Utils::ParamsHash 
to
     #               replace the query values
     #          of the resulting url (default: nil).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/faraday/request/authorization.rb 
new/lib/faraday/request/authorization.rb
--- old/lib/faraday/request/authorization.rb    2022-08-11 17:02:21.000000000 
+0200
+++ new/lib/faraday/request/authorization.rb    2022-10-03 18:29:46.000000000 
+0200
@@ -23,22 +23,27 @@
       def on_request(env)
         return if env.request_headers[KEY]
 
-        env.request_headers[KEY] = header_from(@type, *@params)
+        env.request_headers[KEY] = header_from(@type, env, *@params)
       end
 
       private
 
       # @param type [String, Symbol]
+      # @param env [Faraday::Env]
       # @param params [Array]
       # @return [String] a header value
-      def header_from(type, *params)
+      def header_from(type, env, *params)
         if type.to_s.casecmp('basic').zero? && params.size == 2
           Utils.basic_header_from(*params)
         elsif params.size != 1
           raise ArgumentError, "Unexpected params received (got #{params.size} 
instead of 1)"
         else
           value = params.first
-          value = value.call if value.is_a?(Proc) || value.respond_to?(:call)
+          if (value.is_a?(Proc) && value.arity == 1) || 
(value.respond_to?(:call) && value.method(:call).arity == 1)
+            value = value.call(env)
+          elsif value.is_a?(Proc) || value.respond_to?(:call)
+            value = value.call
+          end
           "#{type} #{value}"
         end
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/faraday/request.rb new/lib/faraday/request.rb
--- old/lib/faraday/request.rb  2022-08-11 17:02:21.000000000 +0200
+++ new/lib/faraday/request.rb  2022-10-03 18:29:46.000000000 +0200
@@ -21,7 +21,7 @@
   # @!attribute headers
   #   @return [Faraday::Utils::Headers] headers
   # @!attribute body
-  #   @return [Hash] body
+  #   @return [String] body
   # @!attribute options
   #   @return [RequestOptions] options
   #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/faraday/version.rb new/lib/faraday/version.rb
--- old/lib/faraday/version.rb  2022-08-11 17:02:21.000000000 +0200
+++ new/lib/faraday/version.rb  2022-10-03 18:29:46.000000000 +0200
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module Faraday
-  VERSION = '2.5.2'
+  VERSION = '2.6.0'
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2022-08-11 17:02:21.000000000 +0200
+++ new/metadata        2022-10-03 18:29:46.000000000 +0200
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: faraday
 version: !ruby/object:Gem::Version
-  version: 2.5.2
+  version: 2.6.0
 platform: ruby
 authors:
 - "@technoweenie"
@@ -10,7 +10,7 @@
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2022-08-11 00:00:00.000000000 Z
+date: 2022-10-03 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: faraday-net_http
@@ -131,7 +131,7 @@
 - MIT
 metadata:
   homepage_uri: https://lostisland.github.io/faraday
-  changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.5.2
+  changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.6.0
   source_code_uri: https://github.com/lostisland/faraday
   bug_tracker_uri: https://github.com/lostisland/faraday/issues
 post_install_message: 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/faraday/request/authorization_spec.rb 
new/spec/faraday/request/authorization_spec.rb
--- old/spec/faraday/request/authorization_spec.rb      2022-08-11 
17:02:21.000000000 +0200
+++ new/spec/faraday/request/authorization_spec.rb      2022-10-03 
18:29:46.000000000 +0200
@@ -72,6 +72,41 @@
       include_examples 'does not interfere with existing authentication'
     end
 
+    context 'with an argument' do
+      let(:response) { conn.get('/auth-echo', nil, 'middle' => 'crunchy 
surprise') }
+
+      context 'when passed a proc' do
+        let(:auth_config) { [proc { |env| "proc 
#{env.request_headers['middle']}" }] }
+
+        it { expect(response.body).to eq('Bearer proc crunchy surprise') }
+
+        include_examples 'does not interfere with existing authentication'
+      end
+
+      context 'when passed a lambda' do
+        let(:auth_config) { [->(env) { "lambda 
#{env.request_headers['middle']}" }] }
+
+        it { expect(response.body).to eq('Bearer lambda crunchy surprise') }
+
+        include_examples 'does not interfere with existing authentication'
+      end
+
+      context 'when passed a callable with an argument' do
+        let(:callable) do
+          Class.new do
+            def call(env)
+              "callable #{env.request_headers['middle']}"
+            end
+          end.new
+        end
+        let(:auth_config) { [callable] }
+
+        it { expect(response.body).to eq('Bearer callable crunchy surprise') }
+
+        include_examples 'does not interfere with existing authentication'
+      end
+    end
+
     context 'when passed too many arguments' do
       let(:auth_config) { %w[baz foo] }
 

Reply via email to