From e6a838b2a0d415dbb57475c0a3139a4d00daf566 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 4 Feb 2016 22:41:37 +0000 Subject: [PATCH 01/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 067b1bc..8bd9936 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 0.9.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: HTTP/REST API client library Group: Development/Languages License: MIT @@ -89,6 +89,9 @@ popd %{gem_instdir}/test %changelog +* Thu Feb 04 2016 Fedora Release Engineering - 0.9.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Thu Jun 18 2015 Fedora Release Engineering - 0.9.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From 3279d5a8cc1a3731a5ce17a1f3426794fc74dd4e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 12:13:03 +0000 Subject: [PATCH 02/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 8bd9936..5a6f96c 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 0.9.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: HTTP/REST API client library Group: Development/Languages License: MIT @@ -89,6 +89,9 @@ popd %{gem_instdir}/test %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 0.9.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Thu Feb 04 2016 Fedora Release Engineering - 0.9.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From e04e42e262660febcc6494006879bbfdd92052cd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 17:08:13 +0000 Subject: [PATCH 03/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 5a6f96c..4a707b5 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 0.9.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: HTTP/REST API client library Group: Development/Languages License: MIT @@ -89,6 +89,9 @@ popd %{gem_instdir}/test %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 0.9.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Sat Feb 11 2017 Fedora Release Engineering - 0.9.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From de04df2c541fd1d5363ec02a71c2e27486960d07 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 13:54:36 +0000 Subject: [PATCH 04/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 4a707b5..f977b69 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 0.9.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: HTTP/REST API client library Group: Development/Languages License: MIT @@ -89,6 +89,9 @@ popd %{gem_instdir}/test %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 0.9.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Thu Jul 27 2017 Fedora Release Engineering - 0.9.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 53658c6279bfade21272ca4b68d42988cf193a9e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 04:08:52 +0000 Subject: [PATCH 05/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index f977b69..581c131 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 0.9.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: HTTP/REST API client library Group: Development/Languages License: MIT @@ -89,6 +89,9 @@ popd %{gem_instdir}/test %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 0.9.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Fri Feb 09 2018 Fedora Release Engineering - 0.9.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From f7f2e509bd3c8351e83c69a2d53077fe49c84a6e Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:18:22 +0100 Subject: [PATCH 06/29] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- rubygem-faraday.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 581c131..e43bc3f 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -5,7 +5,6 @@ Name: rubygem-%{gem_name} Version: 0.9.0 Release: 7%{?dist} Summary: HTTP/REST API client library -Group: Development/Languages License: MIT URL: https://github.com/lostisland/faraday Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem @@ -29,7 +28,6 @@ HTTP/REST API client library %package doc Summary: Documentation for %{name} -Group: Documentation Requires: %{name} = %{version}-%{release} BuildArch: noarch From 361199b86ff4d38f36af75d714418bcc8be52f8b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 2 Feb 2019 12:09:59 +0000 Subject: [PATCH 07/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index e43bc3f..6ea67da 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 0.9.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://github.com/lostisland/faraday @@ -87,6 +87,9 @@ popd %{gem_instdir}/test %changelog +* Sat Feb 02 2019 Fedora Release Engineering - 0.9.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Sat Jul 14 2018 Fedora Release Engineering - 0.9.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 8162145c5f516d5ced95cf5f327f105b0d94a297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Mon, 4 Mar 2019 11:08:27 +0100 Subject: [PATCH 08/29] Update to Faraday 0.15.4. --- .gitignore | 2 + rubygem-faraday.spec | 96 +++++++++++++++++++++++++------------------- sources | 3 +- 3 files changed, 58 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 8ca1438..9465b60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /faraday-0.8.8.gem /faraday-0.9.0.gem +/faraday-0.15.4-tests.tgz +/faraday-0.15.4.gem diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 6ea67da..7007983 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -2,29 +2,34 @@ %global gem_name faraday Name: rubygem-%{gem_name} -Version: 0.9.0 -Release: 8%{?dist} +Version: 0.15.4 +Release: 1%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://github.com/lostisland/faraday Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# git clone https://github.com/lostisland/faraday.git && cd faraday +# git checkout v0.15.4 && tar czvf faraday-0.15.4-tests.tgz test/ script/ +Source1: %{gem_name}-%{version}-tests.tgz BuildRequires: ruby(release) -# Don't install these until test suite can be ran again. See %%check below -#BuildRequires: wget -#BuildRequires: lsof -#BuildRequires: rubygem(sinatra) -#BuildRequires: rubygem(minitest) -BuildRequires: rubygem(multipart-post) => 1.2 -BuildRequires: rubygem(multipart-post) < 3 BuildRequires: rubygems-devel -BuildRequires: ruby +BuildRequires: ruby >= 1.9 +BuildRequires: %{_bindir}/lsof +BuildRequires: rubygem(minitest) +BuildRequires: rubygem(multipart-post) +BuildRequires: rubygem(sinatra) +# Adapter test dependencies, might be optionally disabled. +BuildRequires: rubygem(em-http-request) +BuildRequires: rubygem(excon) +BuildRequires: rubygem(httpclient) +BuildRequires: rubygem(net-http-persistent) +BuildRequires: rubygem(rack-test) +BuildRequires: rubygem(typhoeus) BuildArch: noarch -# Filter from RPM's autorequires. -%global __requires_exclude ^/usr/bin/env$ - %description -HTTP/REST API client library +HTTP/REST API client library. + %package doc Summary: Documentation for %{name} @@ -32,61 +37,68 @@ Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc -Documentation for %{name} +Documentation for %{name}. %prep -gem unpack %{SOURCE0} - -%setup -q -D -T -n %{gem_name}-%{version} - -gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +%setup -q -n %{gem_name}-%{version} -b 1 %build # Create the gem as gem install only works on a gem file -gem build %{gem_name}.gemspec +gem build ../%{gem_name}-%{version}.gemspec # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir # by default, so that we can move it into the buildroot in %%install %gem_install -# Remove unnecessary files -pushd .%{gem_instdir}/ - rm %{gem_name}.gemspec - rm Gemfile - rm Rakefile - rm .document -popd - %install - mkdir -p %{buildroot}%{gem_dir} -cp -pa .%{gem_dir}/* \ +cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ + + %check pushd .%{gem_instdir} -# The test suite is ran by a custom bash script. -# Skip test check until this is resolved. -# https://github.com/lostisland/faraday/blob/v0.9.0/script/test -#ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' +ln -s %{_builddir}/test test +ln -s %{_builddir}/script script + +# Avoid Bundler. +sed -i '/bundler\/setup/,/^fi$/ s/^/#/' script/test + +# Follow symlinks. +sed -i "s/find /find -L /" script/test + +# We don't care about code coverage. +sed -i "/simplecov/,/^end$/ s/^/#/" test/helper.rb + +# We don't have {patron,em-synchrony} available in Fedora. +mv test/adapters/em_synchrony_test.rb{,.disabled} +mv test/adapters/patron_test.rb{,.disabled} + +# Rrequirs internet access. +sed -i "/def test_dynamic_no_proxy/a\ skip" test/connection_test.rb + +# Fails with Typhoeus 1.0.2 +sed -i "/def test_custom_adapter_config/a\ skip" test/adapters/typhoeus_test.rb + +RUBYOPT="-Ilib -ryaml" script/test popd %files %dir %{gem_instdir} +%license %{gem_instdir}/LICENSE.md %{gem_libdir} -%{gem_spec} -%doc %{gem_instdir}/LICENSE.md -%doc %{gem_instdir}/README.md %exclude %{gem_cache} +%{gem_spec} %files doc %doc %{gem_docdir} -%{gem_instdir}/CHANGELOG.md -%{gem_instdir}/CONTRIBUTING.md -%{gem_instdir}/script -%{gem_instdir}/test +%doc %{gem_instdir}/README.md %changelog +* Fri Mar 01 2019 Vít Ondruch - 0.15.4-1 +- Update to Faraday 0.15.4. + * Sat Feb 02 2019 Fedora Release Engineering - 0.9.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index e0e202c..9c04dc1 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -f77914db9c4d4e8b2090447ec84ea746 faraday-0.9.0.gem +SHA512 (faraday-0.15.4-tests.tgz) = a67dec047bdf38b4fdf16497b62a8bee05cef38652b44a95252dcbe70af09d23ed43f7490c4490e887acf8d503d8bdcc7b41c4f96879d16099ef626477485cc1 +SHA512 (faraday-0.15.4.gem) = e63bf8a84dfd6a945c7172fe48197f9b022f4d9d8aa63712e249475202eb8e6e070683fe8f0816b1f72d945f3280fed4104b4c6956e2853dc4d13e718be1f23b From d200536f3a5f318c3e01c45f1f86ec6581b2a51b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 26 Jul 2019 19:19:00 +0000 Subject: [PATCH 09/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 7007983..c1ffa11 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 0.15.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://github.com/lostisland/faraday @@ -96,6 +96,9 @@ popd %doc %{gem_instdir}/README.md %changelog +* Fri Jul 26 2019 Fedora Release Engineering - 0.15.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri Mar 01 2019 Vít Ondruch - 0.15.4-1 - Update to Faraday 0.15.4. From 228bfa5cbd39806761b999e557b66f45dc02e3cc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 30 Jan 2020 18:27:52 +0000 Subject: [PATCH 10/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index c1ffa11..6f2b163 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 0.15.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://github.com/lostisland/faraday @@ -96,6 +96,9 @@ popd %doc %{gem_instdir}/README.md %changelog +* Thu Jan 30 2020 Fedora Release Engineering - 0.15.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Fri Jul 26 2019 Fedora Release Engineering - 0.15.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 6d9fc75a330efdda39e1ea64ab1e4c571cd69c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Mon, 27 Jul 2020 18:35:41 +0200 Subject: [PATCH 11/29] Update to Faraday 1.0.1. Resolves: rhbz#1756449 --- .gitignore | 1 + parser.rb | 246 ++++++++++++++++++ reader.rb | 152 +++++++++++ ...perly-fix-test-failure-with-Rack-2.1.patch | 27 ++ rubygem-faraday.spec | 71 ++--- sources | 3 +- 6 files changed, 469 insertions(+), 31 deletions(-) create mode 100644 parser.rb create mode 100644 reader.rb create mode 100644 rubygem-faraday-1.0.1-Properly-fix-test-failure-with-Rack-2.1.patch diff --git a/.gitignore b/.gitignore index 9465b60..00c45ba 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /faraday-0.9.0.gem /faraday-0.15.4-tests.tgz /faraday-0.15.4.gem +/faraday-1.0.1.gem diff --git a/parser.rb b/parser.rb new file mode 100644 index 0000000..dfb1b05 --- /dev/null +++ b/parser.rb @@ -0,0 +1,246 @@ +module MultipartParser + # A low level parser for multipart messages, + # based on the node-formidable parser. + class Parser + + def initialize + @boundary = nil + @boundary_chars = nil + @lookbehind = nil + @state = :parser_uninitialized + @index = 0 # Index into boundary or header + @flags = {} + @marks = {} # Keep track of different parts + @callbacks = {} + end + + # Initializes the parser, using the given boundary + def init_with_boundary(boundary) + @boundary = "\r\n--" + boundary + @lookbehind = "\0"*(@boundary.length + 8) + @state = :start + + @boundary_chars = {} + @boundary.each_byte do |b| + @boundary_chars[b.chr] = true + end + end + + # Registers a callback to be called when the + # given event occurs. Each callback is expected to + # take three parameters: buffer, start_index, and end_index. + # All of these parameters may be null, depending on the callback. + # Valid callbacks are: + # :end + # :header_field + # :header_value + # :header_end + # :headers_end + # :part_begin + # :part_data + # :part_end + def on(event, &callback) + @callbacks[event] = callback + end + + # Writes data to the parser. + # Returns the number of bytes parsed. + # In practise, this means that if the return value + # is less than the buffer length, a parse error occured. + def write(buffer) + i = 0 + buffer_length = buffer.length + index = @index + flags = @flags.dup + state = @state + lookbehind = @lookbehind + boundary = @boundary + boundary_chars = @boundary_chars + boundary_length = @boundary.length + boundary_end = boundary_length - 1 + + while i < buffer_length + c = buffer[i, 1] + case state + when :parser_uninitialized + return i; + when :start + index = 0; + state = :start_boundary + when :start_boundary # Differs in that it has no preceeding \r\n + if index == boundary_length - 2 + return i unless c == "\r" + index += 1 + elsif index - 1 == boundary_length - 2 + return i unless c == "\n" + # Boundary read successfully, begin next part + callback(:part_begin) + state = :header_field_start + else + return i unless c == boundary[index+2, 1] # Unexpected character + index += 1 + end + i += 1 + when :header_field_start + state = :header_field + @marks[:header_field] = i + index = 0 + when :header_field + if c == "\r" + @marks.delete :header_field + state = :headers_almost_done + else + index += 1 + unless c == "-" # Skip hyphens + if c == ":" + return i if index == 1 # Empty header field + data_callback(:header_field, buffer, i, :clear => true) + state = :header_value_start + else + cl = c.downcase + return i if cl < "a" || cl > "z" + end + end + end + i += 1 + when :header_value_start + if c == " " # Skip spaces + i += 1 + else + @marks[:header_value] = i + state = :header_value + end + when :header_value + if c == "\r" + data_callback(:header_value, buffer, i, :clear => true) + callback(:header_end) + state = :header_value_almost_done + end + i += 1 + when :header_value_almost_done + return i unless c == "\n" + state = :header_field_start + i += 1 + when :headers_almost_done + return i unless c == "\n" + callback(:headers_end) + state = :part_data_start + i += 1 + when :part_data_start + state = :part_data + @marks[:part_data] = i + when :part_data + prev_index = index + + if index == 0 + # Boyer-Moore derived algorithm to safely skip non-boundary data + # See http://debuggable.com/posts/parsing-file-uploads-at-500- + # mb-s-with-node-js:4c03862e-351c-4faa-bb67-4365cbdd56cb + while i + boundary_length <= buffer_length + break if boundary_chars.has_key? buffer[i + boundary_end].chr + i += boundary_length + end + c = buffer[i, 1] + end + + if index < boundary_length + if boundary[index, 1] == c + if index == 0 + data_callback(:part_data, buffer, i, :clear => true) + end + index += 1 + else # It was not the boundary we found, after all + index = 0 + end + elsif index == boundary_length + index += 1 + if c == "\r" + flags[:part_boundary] = true + elsif c == "-" + flags[:last_boundary] = true + else # We did not find a boundary after all + index = 0 + end + elsif index - 1 == boundary_length + if flags[:part_boundary] + index = 0 + if c == "\n" + flags.delete :part_boundary + callback(:part_end) + callback(:part_begin) + state = :header_field_start + i += 1 + next # Ugly way to break out of the case statement + end + elsif flags[:last_boundary] + if c == "-" + callback(:part_end) + callback(:end) + state = :end + else + index = 0 # False alarm + end + else + index = 0 + end + end + + if index > 0 + # When matching a possible boundary, keep a lookbehind + # reference in case it turns out to be a false lead + lookbehind[index-1] = c + elsif prev_index > 0 + # If our boundary turns out to be rubbish, + # the captured lookbehind belongs to part_data + callback(:part_data, lookbehind, 0, prev_index) + @marks[:part_data] = i + + # Reconsider the current character as it might be the + # beginning of a new sequence. + i -= 1 + end + + i += 1 + when :end + i += 1 + else + return i; + end + end + + data_callback(:header_field, buffer, buffer_length) + data_callback(:header_value, buffer, buffer_length) + data_callback(:part_data, buffer, buffer_length) + + @index = index + @state = state + @flags = flags + + return buffer_length + end + + private + + # Issues a callback. + def callback(event, buffer = nil, start = nil, the_end = nil) + return if !start.nil? && start == the_end + if @callbacks.has_key? event + @callbacks[event].call(buffer, start, the_end) + end + end + + # Issues a data callback, + # The only valid options is :clear, + # which, if true, will reset the appropriate mark to 0, + # If not specified, the mark will be removed. + def data_callback(data_type, buffer, the_end, options = {}) + return unless @marks.has_key? data_type + callback(data_type, buffer, @marks[data_type], the_end) + unless options[:clear] + @marks[data_type] = 0 + else + @marks.delete data_type + end + end + end +end diff --git a/reader.rb b/reader.rb new file mode 100644 index 0000000..d63562c --- /dev/null +++ b/reader.rb @@ -0,0 +1,152 @@ +require 'multipart_parser/parser' + +module MultipartParser + class NotMultipartError < StandardError; end; + + # A more high level interface to MultipartParser. + class Reader + + # Initializes a MultipartReader, that will + # read a request with the given boundary value. + def initialize(boundary) + @parser = Parser.new + @parser.init_with_boundary(boundary) + @header_field = '' + @header_value = '' + @part = nil + @ended = false + @on_error = nil + @on_part = nil + + init_parser_callbacks + end + + # Returns true if the parser has finished parsing + def ended? + @ended + end + + # Sets to a code block to call + # when part headers have been parsed. + def on_part(&callback) + @on_part = callback + end + + # Sets a code block to call when + # a parser error occurs. + def on_error(&callback) + @on_error = callback + end + + # Write data from the given buffer (String) + # into the reader. + def write(buffer) + bytes_parsed = @parser.write(buffer) + if bytes_parsed != buffer.size + msg = "Parser error, #{bytes_parsed} of #{buffer.length} bytes parsed" + @on_error.call(msg) unless @on_error.nil? + end + end + + # Extracts a boundary value from a Content-Type header. + # Note that it is the header value you provide here. + # Raises NotMultipartError if content_type is invalid. + def self.extract_boundary_value(content_type) + if content_type =~ /multipart/i + if match = (content_type =~ /boundary=(?:"([^"]+)"|([^;]+))/i) + $1 || $2 + else + raise NotMultipartError.new("No multipart boundary") + end + else + raise NotMultipartError.new("Not a multipart content type!") + end + end + + class Part + attr_accessor :filename, :headers, :name, :mime + + def initialize + @headers = {} + @data_callback = nil + @end_callback = nil + end + + # Calls the data callback with the given data + def emit_data(data) + @data_callback.call(data) unless @data_callback.nil? + end + + # Calls the end callback + def emit_end + @end_callback.call unless @end_callback.nil? + end + + # Sets a block to be called when part data + # is read. The block should take one parameter, + # namely the read data. + def on_data(&callback) + @data_callback = callback + end + + # Sets a block to be called when all data + # for the part has been read. + def on_end(&callback) + @end_callback = callback + end + end + + private + + def init_parser_callbacks + @parser.on(:part_begin) do + @part = Part.new + @header_field = '' + @header_value = '' + end + + @parser.on(:header_field) do |b, start, the_end| + @header_field << b[start...the_end] + end + + @parser.on(:header_value) do |b, start, the_end| + @header_value << b[start...the_end] + end + + @parser.on(:header_end) do + @header_field.downcase! + @part.headers[@header_field] = @header_value + if @header_field == 'content-disposition' + if @header_value =~ /name="([^"]+)"/i + @part.name = $1 + end + if @header_value =~ /filename="([^;]+)"/i + match = $1 + start = (match.rindex("\\") || -1)+1 + @part.filename = match[start...(match.length)] + end + elsif @header_field == 'content-type' + @part.mime = @header_value + end + @header_field = '' + @header_value = '' + end + + @parser.on(:headers_end) do + @on_part.call(@part) unless @on_part.nil? + end + + @parser.on(:part_data) do |b, start, the_end| + @part.emit_data b[start...the_end] + end + + @parser.on(:part_end) do + @part.emit_end + end + + @parser.on(:end) do + @ended = true + end + end + end +end diff --git a/rubygem-faraday-1.0.1-Properly-fix-test-failure-with-Rack-2.1.patch b/rubygem-faraday-1.0.1-Properly-fix-test-failure-with-Rack-2.1.patch new file mode 100644 index 0000000..8816a50 --- /dev/null +++ b/rubygem-faraday-1.0.1-Properly-fix-test-failure-with-Rack-2.1.patch @@ -0,0 +1,27 @@ +From bf03db0979954ef4dd8646c53b73a003af70a953 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Fri, 24 Jul 2020 20:39:25 +0200 +Subject: [PATCH] Properly fix test failure with Rack 2.1+. + +Rack is not to blame, just naive test case which was enough so far. + +Fixes #1119 +--- + spec/support/shared_examples/request_method.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/spec/support/shared_examples/request_method.rb b/spec/support/shared_examples/request_method.rb +index 8e2828a2..917e48ca 100644 +--- a/spec/support/shared_examples/request_method.rb ++++ b/spec/support/shared_examples/request_method.rb +@@ -13,8 +13,8 @@ + end + + it 'handles headers with multiple values' do +- request_stub.to_return(headers: { 'Set-Cookie' => 'one, two' }) +- expect(response.headers['set-cookie']).to eq('one, two') ++ request_stub.to_return(headers: { 'Set-Cookie' => 'name=value' }) ++ expect(response.headers['set-cookie']).to eq('name=value') + end + + it 'retrieves the response headers' do diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 6f2b163..4c9bc02 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -2,22 +2,28 @@ %global gem_name faraday Name: rubygem-%{gem_name} -Version: 0.15.4 -Release: 3%{?dist} +Version: 1.0.1 +Release: 1%{?dist} Summary: HTTP/REST API client library License: MIT -URL: https://github.com/lostisland/faraday +URL: https://lostisland.github.io/faraday Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem -# git clone https://github.com/lostisland/faraday.git && cd faraday -# git checkout v0.15.4 && tar czvf faraday-0.15.4-tests.tgz test/ script/ -Source1: %{gem_name}-%{version}-tests.tgz +# Since we don't have multipart-parser in Fedora, include the essential part +# just for testing purposes. +# https://github.com/danabr/multipart-parser/blob/master/lib/multipart_parser/parser.rb +Source1: https://raw.githubusercontent.com/danabr/multipart-parser/master/lib/multipart_parser/parser.rb +# https://github.com/danabr/multipart-parser/blob/master/lib/multipart_parser/reader.rb +Source2: https://raw.githubusercontent.com/danabr/multipart-parser/master/lib/multipart_parser/reader.rb +# Fix Rack 2.1+ test compatibility. +# https://github.com/lostisland/faraday/pull/1171 +Patch0: rubygem-faraday-1.0.1-Properly-fix-test-failure-with-Rack-2.1.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel -BuildRequires: ruby >= 1.9 -BuildRequires: %{_bindir}/lsof -BuildRequires: rubygem(minitest) +BuildRequires: ruby >= 2.3 BuildRequires: rubygem(multipart-post) -BuildRequires: rubygem(sinatra) +BuildRequires: rubygem(rack) +BuildRequires: rubygem(rspec) +BuildRequires: rubygem(webmock) # Adapter test dependencies, might be optionally disabled. BuildRequires: rubygem(em-http-request) BuildRequires: rubygem(excon) @@ -40,7 +46,12 @@ BuildArch: noarch Documentation for %{name}. %prep -%setup -q -n %{gem_name}-%{version} -b 1 +mkdir -p multipart_parser/multipart_parser +cp %{SOURCE1} %{SOURCE2} multipart_parser/multipart_parser + +%setup -q -n %{gem_name}-%{version} + +%patch0 -p1 %build # Create the gem as gem install only works on a gem file @@ -59,29 +70,23 @@ cp -a .%{gem_dir}/* \ %check pushd .%{gem_instdir} -ln -s %{_builddir}/test test -ln -s %{_builddir}/script script - -# Avoid Bundler. -sed -i '/bundler\/setup/,/^fi$/ s/^/#/' script/test - -# Follow symlinks. -sed -i "s/find /find -L /" script/test - # We don't care about code coverage. -sed -i "/simplecov/,/^end$/ s/^/#/" test/helper.rb +sed -i "/simplecov/ s/^/#/" spec/spec_helper.rb +sed -i "/coveralls/ s/^/#/" spec/spec_helper.rb +sed -i "/SimpleCov/,/^end$/ s/^/#/" spec/spec_helper.rb + +# We don't need Pry. +sed -i "/pry/ s/^/#/" spec/spec_helper.rb # We don't have {patron,em-synchrony} available in Fedora. -mv test/adapters/em_synchrony_test.rb{,.disabled} -mv test/adapters/patron_test.rb{,.disabled} +mv spec/faraday/adapter/em_synchrony_spec.rb{,.disabled} +mv spec/faraday/adapter/patron_spec.rb{,.disabled} -# Rrequirs internet access. -sed -i "/def test_dynamic_no_proxy/a\ skip" test/connection_test.rb +# This needs http-net-persistent 3.0+. +sed -i '/allows to set min_version in SSL settings/a\ skip' \ + spec/faraday/adapter/net_http_persistent_spec.rb -# Fails with Typhoeus 1.0.2 -sed -i "/def test_custom_adapter_config/a\ skip" test/adapters/typhoeus_test.rb - -RUBYOPT="-Ilib -ryaml" script/test +rspec -I%{_builddir}/multipart_parser -rspec_helper -r%{SOURCE1} spec -f d popd %files @@ -93,9 +98,17 @@ popd %files doc %doc %{gem_docdir} +%doc %{gem_instdir}/CHANGELOG.md %doc %{gem_instdir}/README.md +%{gem_instdir}/Rakefile +%{gem_instdir}/examples +%{gem_instdir}/spec %changelog +* Thu Jul 23 2020 Vít Ondruch - 1.0.1-1 +- Update to Faraday 1.0.1. + Resolves: rhbz#1756449 + * Thu Jan 30 2020 Fedora Release Engineering - 0.15.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/sources b/sources index 9c04dc1..3dacc06 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -SHA512 (faraday-0.15.4-tests.tgz) = a67dec047bdf38b4fdf16497b62a8bee05cef38652b44a95252dcbe70af09d23ed43f7490c4490e887acf8d503d8bdcc7b41c4f96879d16099ef626477485cc1 -SHA512 (faraday-0.15.4.gem) = e63bf8a84dfd6a945c7172fe48197f9b022f4d9d8aa63712e249475202eb8e6e070683fe8f0816b1f72d945f3280fed4104b4c6956e2853dc4d13e718be1f23b +SHA512 (faraday-1.0.1.gem) = 0374cf32669e1727f435b765d959c5cefd774a451073e88c81c3b49d73885798803b53580f591f1e8862813baf113be7efb7abdc4d526719002f899a7c3b5c82 From d7033b1a2b87523680c9b3cf64a8c4a952953d31 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 27 Jan 2021 15:51:40 +0000 Subject: [PATCH 12/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 4c9bc02..65cee68 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -105,6 +105,9 @@ popd %{gem_instdir}/spec %changelog +* Wed Jan 27 2021 Fedora Release Engineering - 1.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Thu Jul 23 2020 Vít Ondruch - 1.0.1-1 - Update to Faraday 1.0.1. Resolves: rhbz#1756449 From 01813feef7fb8815be64e96cc35ffb75838e715f Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sat, 20 Feb 2021 14:55:40 +0900 Subject: [PATCH 13/29] Support for net-http-persistent 4.0 net connection failure error change --- ...y-1.0.1-net-http-persistent-4-error-kind.patch | 15 +++++++++++++++ rubygem-faraday.spec | 12 ++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 faraday-1.0.1-net-http-persistent-4-error-kind.patch diff --git a/faraday-1.0.1-net-http-persistent-4-error-kind.patch b/faraday-1.0.1-net-http-persistent-4-error-kind.patch new file mode 100644 index 0000000..fa4f680 --- /dev/null +++ b/faraday-1.0.1-net-http-persistent-4-error-kind.patch @@ -0,0 +1,15 @@ +--- faraday-1.0.1/lib/faraday/adapter/net_http_persistent.rb.persistent4 2021-02-20 14:29:13.644561286 +0900 ++++ faraday-1.0.1/lib/faraday/adapter/net_http_persistent.rb 2021-02-20 14:29:52.521616996 +0900 +@@ -59,6 +59,12 @@ module Faraday + if e.message.include? 'connection refused' + raise Faraday::ConnectionFailed, e + end ++ rescue Net::OpenTimeout => e ++ raise Faraday::TimeoutError, e if e.message.include? 'execution expired' ++ ++ if e.message.include? 'connection refused' ++ raise Faraday::ConnectionFailed, e ++ end + + raise + end diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 65cee68..3ce99e1 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -17,6 +17,9 @@ Source2: https://raw.githubusercontent.com/danabr/multipart-parser/master/lib/mu # Fix Rack 2.1+ test compatibility. # https://github.com/lostisland/faraday/pull/1171 Patch0: rubygem-faraday-1.0.1-Properly-fix-test-failure-with-Rack-2.1.patch +# Trial support: net-http-persistent 4 changes error status for connenction failure +# Need reporting to upstream: will do later +Patch1: faraday-1.0.1-net-http-persistent-4-error-kind.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby >= 2.3 @@ -49,9 +52,7 @@ Documentation for %{name}. mkdir -p multipart_parser/multipart_parser cp %{SOURCE1} %{SOURCE2} multipart_parser/multipart_parser -%setup -q -n %{gem_name}-%{version} - -%patch0 -p1 +%autosetup -n %{gem_name}-%{version} -p1 %build # Create the gem as gem install only works on a gem file @@ -105,6 +106,9 @@ popd %{gem_instdir}/spec %changelog +* Sat Feb 20 2021 Mamoru TASAKA - 1.0.1-3 +- Support for net-http-persistent 4.0 net connection failure error change + * Wed Jan 27 2021 Fedora Release Engineering - 1.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From ebc2b1ef4e32d2133fe8172f8d6ed0a64562d608 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sat, 20 Feb 2021 15:41:54 +0900 Subject: [PATCH 14/29] Use upstream patch for net-http-persistent 4.0 --- ...0.1-net-http-persistent-3-error-kind.patch | 24 +++++++++++++++++++ ...0.1-net-http-persistent-4-error-kind.patch | 15 ------------ 2 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 faraday-1.0.1-net-http-persistent-3-error-kind.patch delete mode 100644 faraday-1.0.1-net-http-persistent-4-error-kind.patch diff --git a/faraday-1.0.1-net-http-persistent-3-error-kind.patch b/faraday-1.0.1-net-http-persistent-3-error-kind.patch new file mode 100644 index 0000000..556e96f --- /dev/null +++ b/faraday-1.0.1-net-http-persistent-3-error-kind.patch @@ -0,0 +1,24 @@ +From 687108bb4ddc2511aeaae7449dd401fe62dd5ceb Mon Sep 17 00:00:00 2001 +From: Matt +Date: Thu, 31 Dec 2020 10:51:03 +0000 +Subject: [PATCH] Adds Ruby 3.0 to CI Matrix (#1226) + +--- + .github/workflows/ci.yml | 6 +----- + Gemfile | 2 +- + lib/faraday/adapter/net_http_persistent.rb | 2 +- + 3 files changed, 3 insertions(+), 7 deletions(-) + +diff --git a/lib/faraday/adapter/net_http_persistent.rb b/lib/faraday/adapter/net_http_persistent.rb +index ff20c256..26bcc2ce 100644 +--- a/lib/faraday/adapter/net_http_persistent.rb ++++ b/lib/faraday/adapter/net_http_persistent.rb +@@ -51,7 +51,7 @@ def proxy_uri(env) + + def perform_request(http, env) + http.request env[:url], create_request(env) +- rescue Errno::ETIMEDOUT => e ++ rescue Errno::ETIMEDOUT, Net::OpenTimeout => e + raise Faraday::TimeoutError, e + rescue Net::HTTP::Persistent::Error => e + raise Faraday::TimeoutError, e if e.message.include? 'Timeout' diff --git a/faraday-1.0.1-net-http-persistent-4-error-kind.patch b/faraday-1.0.1-net-http-persistent-4-error-kind.patch deleted file mode 100644 index fa4f680..0000000 --- a/faraday-1.0.1-net-http-persistent-4-error-kind.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- faraday-1.0.1/lib/faraday/adapter/net_http_persistent.rb.persistent4 2021-02-20 14:29:13.644561286 +0900 -+++ faraday-1.0.1/lib/faraday/adapter/net_http_persistent.rb 2021-02-20 14:29:52.521616996 +0900 -@@ -59,6 +59,12 @@ module Faraday - if e.message.include? 'connection refused' - raise Faraday::ConnectionFailed, e - end -+ rescue Net::OpenTimeout => e -+ raise Faraday::TimeoutError, e if e.message.include? 'execution expired' -+ -+ if e.message.include? 'connection refused' -+ raise Faraday::ConnectionFailed, e -+ end - - raise - end From 78c5802cacc28d466d81e6865e6ce50d21c5038d Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sat, 20 Feb 2021 15:42:19 +0900 Subject: [PATCH 15/29] add spec file --- rubygem-faraday.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 3ce99e1..22df891 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -17,9 +17,9 @@ Source2: https://raw.githubusercontent.com/danabr/multipart-parser/master/lib/mu # Fix Rack 2.1+ test compatibility. # https://github.com/lostisland/faraday/pull/1171 Patch0: rubygem-faraday-1.0.1-Properly-fix-test-failure-with-Rack-2.1.patch -# Trial support: net-http-persistent 4 changes error status for connenction failure -# Need reporting to upstream: will do later -Patch1: faraday-1.0.1-net-http-persistent-4-error-kind.patch +# Extracted from: +# https://github.com/lostisland/faraday/commit/687108bb4ddc2511aeaae7449dd401fe62dd5ceb +Patch1: faraday-1.0.1-net-http-persistent-3-error-kind.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby >= 2.3 @@ -106,6 +106,9 @@ popd %{gem_instdir}/spec %changelog +* Sat Feb 20 2021 Mamoru TASAKA - 1.0.1-4 +- Use upstream patch for net-http-persistent 4.0 + * Sat Feb 20 2021 Mamoru TASAKA - 1.0.1-3 - Support for net-http-persistent 4.0 net connection failure error change From 8cdb112ef34f0ddecada0ba2137a412cb21e0ceb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 12:03:16 +0000 Subject: [PATCH 16/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 22df891..151cec7 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -106,6 +106,9 @@ popd %{gem_instdir}/spec %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 1.0.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Sat Feb 20 2021 Mamoru TASAKA - 1.0.1-4 - Use upstream patch for net-http-persistent 4.0 From 9f0d0fa3c8ea574488ee473d407d67287af89e3d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 21 Jan 2022 18:31:40 +0000 Subject: [PATCH 17/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 151cec7..9fe7436 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -106,6 +106,9 @@ popd %{gem_instdir}/spec %changelog +* Fri Jan 21 2022 Fedora Release Engineering - 1.0.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Fri Jul 23 2021 Fedora Release Engineering - 1.0.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From c8b6f5da89b401dde3d78bab405862f31d6d13ae Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 01:32:10 +0000 Subject: [PATCH 18/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 9fe7436..50a818a 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -106,6 +106,9 @@ popd %{gem_instdir}/spec %changelog +* Sat Jul 23 2022 Fedora Release Engineering - 1.0.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Fri Jan 21 2022 Fedora Release Engineering - 1.0.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 2734b32f546dff3b874902dd588283a8a96d6ac4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 20 Jan 2023 20:25:29 +0000 Subject: [PATCH 19/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 50a818a..4e3b632 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 7%{?dist} +Release: 8%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -106,6 +106,9 @@ popd %{gem_instdir}/spec %changelog +* Fri Jan 20 2023 Fedora Release Engineering - 1.0.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Sat Jul 23 2022 Fedora Release Engineering - 1.0.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From d81799c1968e3f8034e41fe5d99940bb92fef19f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 21 Jul 2023 17:35:59 +0000 Subject: [PATCH 20/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 4e3b632..1fd7292 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -106,6 +106,9 @@ popd %{gem_instdir}/spec %changelog +* Fri Jul 21 2023 Fedora Release Engineering - 1.0.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Fri Jan 20 2023 Fedora Release Engineering - 1.0.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From a7c00e1606e458c64a02a64515115103260edf4c Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Fri, 22 Sep 2023 14:20:03 +0900 Subject: [PATCH 21/29] Backport upstream patch for testsuite with ruby3.3 undefined method message change --- ...23-testsuite-undefined-method-change.patch | 80 +++++++++++++++++++ rubygem-faraday.spec | 10 ++- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 faraday-pr1523-testsuite-undefined-method-change.patch diff --git a/faraday-pr1523-testsuite-undefined-method-change.patch b/faraday-pr1523-testsuite-undefined-method-change.patch new file mode 100644 index 0000000..72efa8e --- /dev/null +++ b/faraday-pr1523-testsuite-undefined-method-change.patch @@ -0,0 +1,80 @@ +From 05f2d9486bd88dc0030e002e65cb7d91a67b3f5d Mon Sep 17 00:00:00 2001 +From: Koichi ITO +Date: Tue, 15 Aug 2023 13:18:31 +0900 +Subject: [PATCH] Fix a test failure using Ruby 3.3.0dev + +This PR fixes the following test failure using Ruby 3.3.0dev: + +```console +$ ruby -v +ruby 3.3.0dev (2023-08-14T15:48:39Z master 52837fcec2) [x86_64-darwin22] +$ bundle exec rspec spec/faraday_spec.rb + +Randomized with seed 57031 + +Faraday + has a version number + proxies to default_connection + uses method_missing on Faraday if there is no proxyable method (FAILED - 1) + proxies methods that exist on the default_connection + proxied methods can be accessed + +Failures: + + 1) Faraday proxies to default_connection uses method_missing on Faraday if there is no proxyable method + Failure/Error: + expect { Faraday.this_method_does_not_exist }.to raise_error( + NoMethodError, expected_message + ) + + expected NoMethodError with "undefined method `this_method_does_not_exist' for Faraday:Module", + got # with backtrace: + # ./lib/faraday.rb:147:in `method_missing' + # ./spec/faraday_spec.rb:27:in `block (4 levels) in ' + # ./spec/faraday_spec.rb:27:in `block (3 levels) in ' + # ./spec/faraday_spec.rb:27:in `block (3 levels) in ' +``` + +That error message has been changed by https://github.com/ruby/ruby/commit/e7b8d32e in Ruby 3.3.0dev. + +cf. https://bugs.ruby-lang.org/issues/18285 + +So the test error message is changed: + +Ruby 3.2 or lower: + +``` +undefined method `this_method_does_not_exist' for Faraday:Module +``` + +Ruby 3.3.0dev: + +``` +NoMethodError: undefined method `this_method_does_not_exist' for module Faraday +``` +--- + spec/faraday_spec.rb | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/spec/faraday_spec.rb b/spec/faraday_spec.rb +index 8b603ebbd..25d9d4fa9 100644 +--- a/spec/faraday_spec.rb ++++ b/spec/faraday_spec.rb +@@ -18,10 +18,13 @@ + end + + it 'uses method_missing on Faraday if there is no proxyable method' do +- expect { Faraday.this_method_does_not_exist }.to raise_error( +- NoMethodError, +- "undefined method `this_method_does_not_exist' for Faraday:Module" +- ) ++ expected_message = if RUBY_VERSION >= '3.3' ++ "undefined method `this_method_does_not_exist' for module Faraday" ++ else ++ "undefined method `this_method_does_not_exist' for Faraday:Module" ++ end ++ ++ expect { Faraday.this_method_does_not_exist }.to raise_error(NoMethodError, expected_message) + end + + it 'proxied methods can be accessed' do diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 1fd7292..9c4abc8 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 9%{?dist} +Release: 10%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -20,6 +20,10 @@ Patch0: rubygem-faraday-1.0.1-Properly-fix-test-failure-with-Rack-2.1.patch # Extracted from: # https://github.com/lostisland/faraday/commit/687108bb4ddc2511aeaae7449dd401fe62dd5ceb Patch1: faraday-1.0.1-net-http-persistent-3-error-kind.patch +# "undefined method" error message changed with ruby 3.3 +# https://github.com/lostisland/faraday/pull/1523 +# https://github.com/ruby/ruby/pull/6950 +Patch2: faraday-pr1523-testsuite-undefined-method-change.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby >= 2.3 @@ -106,6 +110,10 @@ popd %{gem_instdir}/spec %changelog +* Fri Sep 22 2023 Mamoru TASAKA - 1.0.1-10 +- Backport upstream patch for testsuite with ruby3.3 undefined method + message change + * Fri Jul 21 2023 Fedora Release Engineering - 1.0.1-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 82beb8afba3c194913ae14ae66529a5ca1dd64a3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 22 Jan 2024 12:52:15 +0000 Subject: [PATCH 22/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 9c4abc8..02efd04 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 10%{?dist} +Release: 11%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -110,6 +110,9 @@ popd %{gem_instdir}/spec %changelog +* Mon Jan 22 2024 Fedora Release Engineering - 1.0.1-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Sep 22 2023 Mamoru TASAKA - 1.0.1-10 - Backport upstream patch for testsuite with ruby3.3 undefined method message change From d48b28f77eafe6ed26b62e28f91598a83ff488d1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 26 Jan 2024 16:48:49 +0000 Subject: [PATCH 23/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 02efd04..bc54f03 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 11%{?dist} +Release: 12%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -110,6 +110,9 @@ popd %{gem_instdir}/spec %changelog +* Fri Jan 26 2024 Fedora Release Engineering - 1.0.1-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Mon Jan 22 2024 Fedora Release Engineering - 1.0.1-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From a0abbd7e4131e3a23acc8a033b862ad545f1f077 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jul 2024 19:17:03 +0000 Subject: [PATCH 24/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index bc54f03..074cfc4 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -110,6 +110,9 @@ popd %{gem_instdir}/spec %changelog +* Fri Jul 19 2024 Fedora Release Engineering - 1.0.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Fri Jan 26 2024 Fedora Release Engineering - 1.0.1-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From ec69c58547e506e2394e6f70d2ee488709fb4d49 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sun, 1 Dec 2024 22:50:39 +0900 Subject: [PATCH 25/29] Support ruby3.4 backtrace / Hash inspect formatting change --- ...uby34-hash-inspect-formatting-change.patch | 13 ++++++++++ faraday-pr1560-ruby34-backtrace-change.patch | 24 +++++++++++++++++++ rubygem-faraday.spec | 11 ++++++++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 faraday-issue1602-ruby34-hash-inspect-formatting-change.patch create mode 100644 faraday-pr1560-ruby34-backtrace-change.patch diff --git a/faraday-issue1602-ruby34-hash-inspect-formatting-change.patch b/faraday-issue1602-ruby34-hash-inspect-formatting-change.patch new file mode 100644 index 0000000..68a9f14 --- /dev/null +++ b/faraday-issue1602-ruby34-hash-inspect-formatting-change.patch @@ -0,0 +1,13 @@ +diff --git a/spec/faraday/error_spec.rb b/spec/faraday/error_spec.rb +index fd30e2d..59c118f 100644 +--- a/spec/faraday/error_spec.rb ++++ b/spec/faraday/error_spec.rb +@@ -21,7 +21,7 @@ + it { expect(subject.wrapped_exception).to be_nil } + it { expect(subject.response).to eq(exception) } + it { expect(subject.message).to eq('the server responded with status 400') } +- it { expect(subject.inspect).to eq('#400}>') } ++ it { expect(subject.inspect).to eq('#') } + end + + context 'with string' do diff --git a/faraday-pr1560-ruby34-backtrace-change.patch b/faraday-pr1560-ruby34-backtrace-change.patch new file mode 100644 index 0000000..076c534 --- /dev/null +++ b/faraday-pr1560-ruby34-backtrace-change.patch @@ -0,0 +1,24 @@ +From 8cdc483218d4612d53239f48785567b6b6d056cd Mon Sep 17 00:00:00 2001 +From: m-nakamura145 +Date: Fri, 24 May 2024 23:23:24 +0900 +Subject: [PATCH] Fix compatibility with Ruby 3.4.0-preview1 + +--- + spec/faraday_spec.rb | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/spec/faraday_spec.rb b/spec/faraday_spec.rb +index 30be29cf8..c3583f184 100644 +--- a/spec/faraday_spec.rb ++++ b/spec/faraday_spec.rb +@@ -18,7 +18,9 @@ + end + + it 'uses method_missing on Faraday if there is no proxyable method' do +- expected_message = if RUBY_VERSION >= '3.3' ++ expected_message = if RUBY_VERSION >= '3.4' ++ "undefined method 'this_method_does_not_exist' for module Faraday" ++ elsif RUBY_VERSION >= '3.3' + "undefined method `this_method_does_not_exist' for module Faraday" + else + "undefined method `this_method_does_not_exist' for Faraday:Module" diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 074cfc4..3bc9f1f 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 13%{?dist} +Release: 14%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -24,6 +24,12 @@ Patch1: faraday-1.0.1-net-http-persistent-3-error-kind.patch # https://github.com/lostisland/faraday/pull/1523 # https://github.com/ruby/ruby/pull/6950 Patch2: faraday-pr1523-testsuite-undefined-method-change.patch +# ruby3.4 backtrace quoting change +# https://github.com/lostisland/faraday/pull/1560 +Patch3: faraday-pr1560-ruby34-backtrace-change.patch +# ruby3.4 Hash#inspect formatting change +# https://github.com/lostisland/faraday/issues/1602 +Patch4: faraday-issue1602-ruby34-hash-inspect-formatting-change.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby >= 2.3 @@ -110,6 +116,9 @@ popd %{gem_instdir}/spec %changelog +* Sun Dec 01 2024 Mamoru TASAKA - 1.0.1-14 +- Support ruby3.4 backtrace / Hash inspect formatting change + * Fri Jul 19 2024 Fedora Release Engineering - 1.0.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 3d0ae00653e44e7985996dca1661e70d9a94a319 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Wed, 4 Dec 2024 16:41:34 +0900 Subject: [PATCH 26/29] Use upstreamed patch for ruby34 formatting change --- ...uby34-hash-inspect-formatting-change.patch | 13 -------- ...uby34-hash-inspect-formatting-change.patch | 30 +++++++++++++++++++ rubygem-faraday.spec | 9 ++++-- 3 files changed, 36 insertions(+), 16 deletions(-) delete mode 100644 faraday-issue1602-ruby34-hash-inspect-formatting-change.patch create mode 100644 faraday-pr1604-ruby34-hash-inspect-formatting-change.patch diff --git a/faraday-issue1602-ruby34-hash-inspect-formatting-change.patch b/faraday-issue1602-ruby34-hash-inspect-formatting-change.patch deleted file mode 100644 index 68a9f14..0000000 --- a/faraday-issue1602-ruby34-hash-inspect-formatting-change.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/spec/faraday/error_spec.rb b/spec/faraday/error_spec.rb -index fd30e2d..59c118f 100644 ---- a/spec/faraday/error_spec.rb -+++ b/spec/faraday/error_spec.rb -@@ -21,7 +21,7 @@ - it { expect(subject.wrapped_exception).to be_nil } - it { expect(subject.response).to eq(exception) } - it { expect(subject.message).to eq('the server responded with status 400') } -- it { expect(subject.inspect).to eq('#400}>') } -+ it { expect(subject.inspect).to eq('#') } - end - - context 'with string' do diff --git a/faraday-pr1604-ruby34-hash-inspect-formatting-change.patch b/faraday-pr1604-ruby34-hash-inspect-formatting-change.patch new file mode 100644 index 0000000..b972f1b --- /dev/null +++ b/faraday-pr1604-ruby34-hash-inspect-formatting-change.patch @@ -0,0 +1,30 @@ +From 74962b2d77af4a1ca6bc557031e6c24759dbafa7 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Tue, 3 Dec 2024 15:48:12 +0900 +Subject: [PATCH] [TEST] fix compatibility with ruby 3.4.0dev + +ruby 3.4 changes Hash#inspect formatting as: +https://bugs.ruby-lang.org/issues/20433 + +Closes #1602 +--- + spec/faraday/error_spec.rb | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/spec/faraday/error_spec.rb b/spec/faraday/error_spec.rb +index fd30e2d34..170f32672 100644 +--- a/spec/faraday/error_spec.rb ++++ b/spec/faraday/error_spec.rb +@@ -21,7 +21,11 @@ + it { expect(subject.wrapped_exception).to be_nil } + it { expect(subject.response).to eq(exception) } + it { expect(subject.message).to eq('the server responded with status 400') } +- it { expect(subject.inspect).to eq('#400}>') } ++ if RUBY_VERSION >= '3.4' ++ it { expect(subject.inspect).to eq('#') } ++ else ++ it { expect(subject.inspect).to eq('#400}>') } ++ end + end + + context 'with string' do diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 3bc9f1f..642521c 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 14%{?dist} +Release: 15%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -28,8 +28,8 @@ Patch2: faraday-pr1523-testsuite-undefined-method-change.patch # https://github.com/lostisland/faraday/pull/1560 Patch3: faraday-pr1560-ruby34-backtrace-change.patch # ruby3.4 Hash#inspect formatting change -# https://github.com/lostisland/faraday/issues/1602 -Patch4: faraday-issue1602-ruby34-hash-inspect-formatting-change.patch +# https://github.com/lostisland/faraday/pull/1604 +Patch4: faraday-pr1604-ruby34-hash-inspect-formatting-change.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby >= 2.3 @@ -116,6 +116,9 @@ popd %{gem_instdir}/spec %changelog +* Wed Dec 04 2024 Mamoru TASAKA - 1.0.1-15 +- Use upstreamed patch for ruby34 formatting change + * Sun Dec 01 2024 Mamoru TASAKA - 1.0.1-14 - Support ruby3.4 backtrace / Hash inspect formatting change From b27c6d55c282426f35fcc56bf5a8f67ca1ca381f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 18 Jan 2025 23:15:02 +0000 Subject: [PATCH 27/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 642521c..13a74a2 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 15%{?dist} +Release: 16%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -116,6 +116,9 @@ popd %{gem_instdir}/spec %changelog +* Sat Jan 18 2025 Fedora Release Engineering - 1.0.1-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Wed Dec 04 2024 Mamoru TASAKA - 1.0.1-15 - Use upstreamed patch for ruby34 formatting change From 1260b6a10111e7feb5dcd7cc7a12699b0f9b6a11 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 12:24:24 +0000 Subject: [PATCH 28/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- rubygem-faraday.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 13a74a2..715e072 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 16%{?dist} +Release: 17%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -116,6 +116,9 @@ popd %{gem_instdir}/spec %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 1.0.1-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Sat Jan 18 2025 Fedora Release Engineering - 1.0.1-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 196267c11d58c2a566698be407522789d7c4750c Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Mon, 1 Dec 2025 22:44:59 +0900 Subject: [PATCH 29/29] Backport upstream patch for rack3.1 change --- ...549-unespace-rack-utils-query-result.patch | 23 ++++++++++++++ faraday-rack-pr13-rack31-rack_input.patch | 30 +++++++++++++++++++ rubygem-faraday.spec | 13 +++++++- 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 faraday-pr1549-unespace-rack-utils-query-result.patch create mode 100644 faraday-rack-pr13-rack31-rack_input.patch diff --git a/faraday-pr1549-unespace-rack-utils-query-result.patch b/faraday-pr1549-unespace-rack-utils-query-result.patch new file mode 100644 index 0000000..e727376 --- /dev/null +++ b/faraday-pr1549-unespace-rack-utils-query-result.patch @@ -0,0 +1,23 @@ +From 66551ecc79f5d3d5bca1a2523bd8736db8c2220c Mon Sep 17 00:00:00 2001 +From: Mattia Giuffrida +Date: Sat, 20 Jan 2024 16:48:26 +0000 +Subject: [PATCH] Unescape the result of `Rack::Utils.build_nested_query` + +--- + spec/faraday/params_encoders/nested_spec.rb | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/spec/faraday/params_encoders/nested_spec.rb b/spec/faraday/params_encoders/nested_spec.rb +index 46312047f..83da22dc4 100644 +--- a/spec/faraday/params_encoders/nested_spec.rb ++++ b/spec/faraday/params_encoders/nested_spec.rb +@@ -62,7 +62,8 @@ + it 'encodes rack compat' do + params = { a: [{ one: '1', two: '2' }, '3', ''] } + result = Faraday::Utils.unescape(Faraday::NestedParamsEncoder.encode(params)).split('&') +- expected = Rack::Utils.build_nested_query(params).split('&') ++ escaped = Rack::Utils.build_nested_query(params) ++ expected = Rack::Utils.unescape(escaped).split('&') + expect(result).to match_array(expected) + end + diff --git a/faraday-rack-pr13-rack31-rack_input.patch b/faraday-rack-pr13-rack31-rack_input.patch new file mode 100644 index 0000000..f08c969 --- /dev/null +++ b/faraday-rack-pr13-rack31-rack_input.patch @@ -0,0 +1,30 @@ +From a590bc34e40b62484440dcd4ab5147c0c02bb425 Mon Sep 17 00:00:00 2001 +From: Andreas Schleifer +Date: Wed, 9 Apr 2025 09:21:05 +0200 +Subject: [PATCH] Fix tests for rack 3.1: env['rack.input'] is optional (#13) + +* fix(spec): fix tests for rack 3.1 + +* feat(ci): add ruby 3.4 to CI test matrix + +--------- + +Co-authored-by: Olle Jonsson +--- + .github/workflows/ci.yml | 1 + + spec/support/webmock_rack_app.rb | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/spec/support/webmock_rack_app.rb b/spec/support/webmock_rack_app.rb +index a3212c7..894c411 100644 +--- a/spec/support/webmock_rack_app.rb ++++ b/spec/support/webmock_rack_app.rb +@@ -49,7 +49,7 @@ def req_headers(env) + end + + def req_body(env) +- env['rack.input'].read ++ env['rack.input']&.read + end + + def process_response(req_signature) diff --git a/rubygem-faraday.spec b/rubygem-faraday.spec index 715e072..6d9542c 100644 --- a/rubygem-faraday.spec +++ b/rubygem-faraday.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 1.0.1 -Release: 17%{?dist} +Release: 18%{?dist} Summary: HTTP/REST API client library License: MIT URL: https://lostisland.github.io/faraday @@ -30,6 +30,14 @@ Patch3: faraday-pr1560-ruby34-backtrace-change.patch # ruby3.4 Hash#inspect formatting change # https://github.com/lostisland/faraday/pull/1604 Patch4: faraday-pr1604-ruby34-hash-inspect-formatting-change.patch +# https://github.com/lostisland/faraday-rack/pull/13 +# https://github.com/lostisland/faraday-rack/commit/a590bc34e40b62484440dcd4ab5147c0c02bb425 +# Patch for rack 3.1 wrt env['rack.input'] is optional +Patch5: faraday-rack-pr13-rack31-rack_input.patch +# https://github.com/lostisland/faraday/pull/1549 +# https://github.com/lostisland/faraday/commit/66551ecc79f5d3d5bca1a2523bd8736db8c2220c.patch +# Unescape the result of Rack::Utils.build_nested_query for rack 3.1 +Patch6: faraday-pr1549-unespace-rack-utils-query-result.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby >= 2.3 @@ -116,6 +124,9 @@ popd %{gem_instdir}/spec %changelog +* Mon Dec 01 2025 Mamoru TASAKA - 1.0.1-18 +- Backport upstream patch for rack3.1 change + * Fri Jul 25 2025 Fedora Release Engineering - 1.0.1-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild