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-06-15 00:32:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-faraday (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-faraday.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-faraday"

Wed Jun 15 00:32:16 2022 rev:28 rq:982528 version:2.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-faraday/rubygem-faraday.changes  
2022-02-25 21:25:40.223644718 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-faraday.new.1548/rubygem-faraday.changes    
    2022-06-15 00:32:23.390534459 +0200
@@ -1,0 +2,23 @@
+Mon Jun 13 16:57:35 UTC 2022 - Manuel Schnitzer <[email protected]>
+
+- updated to version 2.3.0
+
+  # Features
+
+  * Add indices when arrays are encoded by @daedric in #1399
+
+  # Fixes
+
+  * Allow application/x-www-form-url_encoded POST requests to use file objects 
as the request body by @catlee in #1415
+
+  # Misc
+
+  * CHANGELOG: add 2.2.0 section by @olleolleolle in #1394
+  * docs: UPGRADE Note #dependency removed in 2.0 by @olleolleolle in #1398
+  * docs: Add one more require to the quickstart to make this whole thing work 
immediately by @joshuabremerdexcom in #1401
+  * Update custom middleware documentation by @AlexWayfer in #1404
+  * Doc: Added raise_error middleware configuration by @nicosvirjt in #1412
+  * docs: Correct default default_adapter value by @kuahyeow in #1414
+  * CI: Update GitHub Action "checkout" to v3 by @olleolleolle in #1416
+
+-------------------------------------------------------------------

Old:
----
  faraday-2.2.0.gem

New:
----
  faraday-2.3.0.gem

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

Other differences:
------------------
++++++ rubygem-faraday.spec ++++++
--- /var/tmp/diff_new_pack.gug2K2/_old  2022-06-15 00:32:24.618536264 +0200
+++ /var/tmp/diff_new_pack.gug2K2/_new  2022-06-15 00:32:24.622536270 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-faraday
-Version:        2.2.0
+Version:        2.3.0
 Release:        0
 %define mod_name faraday
 %define mod_full_name %{mod_name}-%{version}

++++++ faraday-2.2.0.gem -> faraday-2.3.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2022-02-03 10:37:28.000000000 +0100
+++ new/CHANGELOG.md    2022-05-06 17:31:01.000000000 +0200
@@ -4,6 +4,10 @@
 
 This file is not being updated anymore. Instead, please check the 
[Releases](https://github.com/lostisland/faraday/releases) page.
 
+## [2.2.0](https://github.com/lostisland/faraday/compare/v2.1.0...v2.2.0) 
(2022-02-03)
+
+* Reintroduce the possibility to register middleware with symbols, strings or 
procs in [#1391](https://github.com/lostisland/faraday/pull/1391)
+
 ## [2.1.0](https://github.com/lostisland/faraday/compare/v2.0.1...v2.1.0) 
(2022-01-15)
 
 * Fix test adapter thread safety by @iMacTia in 
[#1380](https://github.com/lostisland/faraday/pull/1380)
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/encoders/nested_params_encoder.rb 
new/lib/faraday/encoders/nested_params_encoder.rb
--- old/lib/faraday/encoders/nested_params_encoder.rb   2022-02-03 
10:37:28.000000000 +0100
+++ new/lib/faraday/encoders/nested_params_encoder.rb   2022-05-06 
17:31:01.000000000 +0200
@@ -62,11 +62,17 @@
     end
 
     def encode_array(parent, value)
-      new_parent = "#{parent}%5B%5D"
-      return new_parent if value.empty?
+      return "#{parent}%5B%5D" if value.empty?
 
       buffer = +''
-      value.each { |val| buffer << "#{encode_pair(new_parent, val)}&" }
+      value.each_with_index do |val, index|
+        new_parent = if @array_indices
+                       "#{parent}%5B#{index}%5D"
+                     else
+                       "#{parent}%5B%5D"
+                     end
+        buffer << "#{encode_pair(new_parent, val)}&"
+      end
       buffer.chop
     end
   end
@@ -161,7 +167,7 @@
   # for your requests.
   module NestedParamsEncoder
     class << self
-      attr_accessor :sort_params
+      attr_accessor :sort_params, :array_indices
 
       extend Forwardable
       def_delegators :'Faraday::Utils', :escape, :unescape
@@ -169,6 +175,7 @@
 
     # Useful default for OAuth and caching.
     @sort_params = true
+    @array_indices = false
 
     extend EncodeMethods
     extend DecodeMethods
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/faraday/request/url_encoded.rb 
new/lib/faraday/request/url_encoded.rb
--- old/lib/faraday/request/url_encoded.rb      2022-02-03 10:37:28.000000000 
+0100
+++ new/lib/faraday/request/url_encoded.rb      2022-05-06 17:31:01.000000000 
+0200
@@ -31,7 +31,9 @@
         return unless process_request?(env)
 
         env.request_headers[CONTENT_TYPE] ||= self.class.mime_type
-        yield(env.body) unless env.body.respond_to?(:to_str)
+        return if env.body.respond_to?(:to_str) || env.body.respond_to?(:read)
+
+        yield(env.body)
       end
 
       # @param env [Faraday::Env]
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-02-03 10:37:28.000000000 +0100
+++ new/lib/faraday/version.rb  2022-05-06 17:31:01.000000000 +0200
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module Faraday
-  VERSION = '2.2.0'
+  VERSION = '2.3.0'
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/faraday.rb new/lib/faraday.rb
--- old/lib/faraday.rb  2022-02-03 10:37:28.000000000 +0100
+++ new/lib/faraday.rb  2022-05-06 17:31:01.000000000 +0200
@@ -47,7 +47,7 @@
 
     # @overload default_adapter
     #   Gets the Symbol key identifying a default Adapter to use
-    #   for the default {Faraday::Connection}. Defaults to `:test`.
+    #   for the default {Faraday::Connection}. Defaults to `:net_http`.
     #   @return [Symbol] the default adapter
     # @overload default_adapter=(adapter)
     #   Updates default adapter while resetting {.default_connection}.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2022-02-03 10:37:28.000000000 +0100
+++ new/metadata        2022-05-06 17:31:01.000000000 +0200
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: faraday
 version: !ruby/object:Gem::Version
-  version: 2.2.0
+  version: 2.3.0
 platform: ruby
 authors:
 - "@technoweenie"
@@ -10,7 +10,7 @@
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2022-02-03 00:00:00.000000000 Z
+date: 2022-05-06 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: faraday-net_http
@@ -125,7 +125,7 @@
 - MIT
 metadata:
   homepage_uri: https://lostisland.github.io/faraday
-  changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.2.0
+  changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.3.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/params_encoders/nested_spec.rb 
new/spec/faraday/params_encoders/nested_spec.rb
--- old/spec/faraday/params_encoders/nested_spec.rb     2022-02-03 
10:37:28.000000000 +0100
+++ new/spec/faraday/params_encoders/nested_spec.rb     2022-05-06 
17:31:01.000000000 +0200
@@ -102,6 +102,14 @@
     Faraday::NestedParamsEncoder.sort_params = true
   end
 
+  it 'encodes arrays indices when asked' do
+    params = { a: [0, 1, 2] }
+    expect(subject.encode(params)).to eq('a%5B%5D=0&a%5B%5D=1&a%5B%5D=2')
+    Faraday::NestedParamsEncoder.array_indices = true
+    expect(subject.encode(params)).to eq('a%5B0%5D=0&a%5B1%5D=1&a%5B2%5D=2')
+    Faraday::NestedParamsEncoder.array_indices = false
+  end
+
   shared_examples 'a wrong decoding' do
     it do
       expect { subject.decode(query) }.to raise_error(TypeError) do |e|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/faraday/request/url_encoded_spec.rb 
new/spec/faraday/request/url_encoded_spec.rb
--- old/spec/faraday/request/url_encoded_spec.rb        2022-02-03 
10:37:28.000000000 +0100
+++ new/spec/faraday/request/url_encoded_spec.rb        2022-05-06 
17:31:01.000000000 +0200
@@ -1,5 +1,7 @@
 # frozen_string_literal: true
 
+require 'stringio'
+
 RSpec.describe Faraday::Request::UrlEncoded do
   let(:conn) do
     Faraday.new do |b|
@@ -7,7 +9,11 @@
       b.adapter :test do |stub|
         stub.post('/echo') do |env|
           posted_as = env[:request_headers]['Content-Type']
-          [200, { 'Content-Type' => posted_as }, env[:body]]
+          body = env[:body]
+          if body.respond_to?(:read)
+            body = body.read
+          end
+          [200, { 'Content-Type' => posted_as }, body]
         end
       end
     end
@@ -67,6 +73,11 @@
     expect(response.body).to eq('a%5Bb%5D%5Bc%5D%5B%5D=d')
   end
 
+  it 'works with files' do
+    response = conn.post('/echo', StringIO.new('str=apple'))
+    expect(response.body).to eq('str=apple')
+  end
+
   context 'customising default_space_encoding' do
     around do |example|
       Faraday::Utils.default_space_encoding = '%20'

Reply via email to