diff --git a/rubygem-sinatra-2.0.8.1-Fix-failing-tests.patch b/rubygem-sinatra-2.0.8.1-Fix-failing-tests.patch new file mode 100644 index 0000000..e844a38 --- /dev/null +++ b/rubygem-sinatra-2.0.8.1-Fix-failing-tests.patch @@ -0,0 +1,25 @@ +From 750aa3b0de06dad41539bdb402123b5416a3475d Mon Sep 17 00:00:00 2001 +From: Jordan Owens +Date: Tue, 10 Mar 2020 10:24:05 -0400 +Subject: [PATCH] Fix failing tests + +Rack added support for Multi-part ranges and apparently changed the +format of cookie expires timestamp format to match specs. +--- + test/static_test.rb | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/test/static_test.rb b/test/static_test.rb +index e8408b14e..1c6cb35e9 100644 +--- a/test/static_test.rb ++++ b/test/static_test.rb +@@ -152,8 +152,7 @@ def assert_valid_range(http_range, range, path, file) + end + + it 'correctly ignores syntactically invalid range requests' do +- # ...and also ignores multi-range requests, which aren't supported yet +- ["bytes=45-40", "bytes=IV-LXVI", "octets=10-20", "bytes=-", "bytes=1-2,3-4"].each do |http_range| ++ ["bytes=45-40", "bytes=IV-LXVI", "octets=10-20", "bytes=", "bytes=3-1,4-5"].each do |http_range| + request = Rack::MockRequest.new(@app) + response = request.get("/#{File.basename(__FILE__)}", 'HTTP_RANGE' => http_range) + diff --git a/rubygem-sinatra.spec b/rubygem-sinatra.spec index 35b5857..b17e2ac 100644 --- a/rubygem-sinatra.spec +++ b/rubygem-sinatra.spec @@ -1,14 +1,19 @@ %global gem_name sinatra -%{?_with_bootstrap: %global bootstrap 1} +%bcond_with bootstrap Summary: Ruby-based web application framework Name: rubygem-%{gem_name} -Version: 2.0.3 -Release: 2 +Version: 2.0.8.1 +Release: 1 License: MIT URL: http://www.sinatrarb.com/ -Source0: https://rubygems.org/gems/sinatra-%{version}.gem -Source1: https://github.com/sinatra/sinatra/archive/v%{version}.tar.gz -BuildRequires: rubygems-devel +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# git clone https://github.com/sinatra/sinatra.git && cd sinatra +# git archive -v -o sinatra-2.0.8.1-test.tar.gz v2.0.8.1 test/ +Source1: %{gem_name}-%{version}-test.tar.gz +# Fix test failure due to Rack 2.2.2 incompatibility. +# https://github.com/sinatra/sinatra/pull/1605 +Patch0: rubygem-sinatra-2.0.8.1-Fix-failing-tests.patch +BuildRequires: rubygems-devel ruby(release) ruby >= 2.2.0 %if ! 0%{?bootstrap} BuildRequires: rubygem(rack) >= 2.0 rubygem(rack-protection) = %{version} rubygem(tilt) BuildRequires: rubygem(mustermann) rubygem(rack-test) rubygem(minitest) > 5 @@ -28,12 +33,14 @@ Obsoletes: %{name}-doc < %{version}-%{release} This package contains 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 + +pushd %{_builddir} +%patch0 -p1 +popd %build -gem build %{gem_name}.gemspec +gem build ../%{gem_name}-%{version}.gemspec %gem_install %install @@ -42,19 +49,12 @@ cp -rv .%{gem_dir}/* %{buildroot}%{gem_dir} sed -i -e 's|^#!/usr/bin/env ruby|#!/usr/bin/ruby|' \ %{buildroot}%{gem_instdir}/examples/*.rb +%if %{without bootstrap} %check -%if ! 0%{?bootstrap} pushd .%{gem_instdir} -tar xzvf %{SOURCE1} -cd %{gem_name}-%{version} -for FILE in $(grep -rl '^require.*bundler.*' test/); do - sed -i "/^require 'bundler.*'/ s/^/#/" ${FILE} -done +cp -a %{_builddir}/test test +sed -i '/active_support/ s/$/ unless Hash.method_defined?(:slice)/' test/helper.rb mv test/integration_test.rb{,.disabled} -#solve test error due to rubygem-rack 2.2.0+ changes -sed -i '160,162d' test/static_test.rb -sed -i '159a\assert(' test/static_test.rb -sed -i '160a\response.status == 200 || response.status == 206,' test/static_test.rb ruby -e 'Dir.glob "./test/*_test.rb", &method(:require)' popd %endif @@ -82,6 +82,9 @@ popd %{gem_instdir}/examples %changelog +* Thu Feb 24 2022 liyanan - 2.0.8.1-1 +- update to 2.0.8.1 + * Wed Feb 10 2021 Ge Wang - 2.0.3-2 - solve test error due to rubygem-rack update to 2.2.0+ diff --git a/sinatra-2.0.3.gem b/sinatra-2.0.3.gem deleted file mode 100644 index adb06de..0000000 Binary files a/sinatra-2.0.3.gem and /dev/null differ diff --git a/sinatra-2.0.8.1-test.tar.gz b/sinatra-2.0.8.1-test.tar.gz new file mode 100644 index 0000000..524cdb7 Binary files /dev/null and b/sinatra-2.0.8.1-test.tar.gz differ diff --git a/sinatra-2.0.8.1.gem b/sinatra-2.0.8.1.gem new file mode 100644 index 0000000..a6722a2 Binary files /dev/null and b/sinatra-2.0.8.1.gem differ diff --git a/v2.0.3.tar.gz b/v2.0.3.tar.gz deleted file mode 100644 index b6cdc3e..0000000 Binary files a/v2.0.3.tar.gz and /dev/null differ