update to 2.0.8.1
This commit is contained in:
parent
417444712f
commit
0f0163f28f
25
rubygem-sinatra-2.0.8.1-Fix-failing-tests.patch
Normal file
25
rubygem-sinatra-2.0.8.1-Fix-failing-tests.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 750aa3b0de06dad41539bdb402123b5416a3475d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jordan Owens <jkowens@gmail.com>
|
||||||
|
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)
|
||||||
|
|
||||||
@ -1,14 +1,19 @@
|
|||||||
%global gem_name sinatra
|
%global gem_name sinatra
|
||||||
%{?_with_bootstrap: %global bootstrap 1}
|
%bcond_with bootstrap
|
||||||
Summary: Ruby-based web application framework
|
Summary: Ruby-based web application framework
|
||||||
Name: rubygem-%{gem_name}
|
Name: rubygem-%{gem_name}
|
||||||
Version: 2.0.3
|
Version: 2.0.8.1
|
||||||
Release: 2
|
Release: 1
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://www.sinatrarb.com/
|
URL: http://www.sinatrarb.com/
|
||||||
Source0: https://rubygems.org/gems/sinatra-%{version}.gem
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||||||
Source1: https://github.com/sinatra/sinatra/archive/v%{version}.tar.gz
|
# git clone https://github.com/sinatra/sinatra.git && cd sinatra
|
||||||
BuildRequires: rubygems-devel
|
# 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}
|
%if ! 0%{?bootstrap}
|
||||||
BuildRequires: rubygem(rack) >= 2.0 rubygem(rack-protection) = %{version} rubygem(tilt)
|
BuildRequires: rubygem(rack) >= 2.0 rubygem(rack-protection) = %{version} rubygem(tilt)
|
||||||
BuildRequires: rubygem(mustermann) rubygem(rack-test) rubygem(minitest) > 5
|
BuildRequires: rubygem(mustermann) rubygem(rack-test) rubygem(minitest) > 5
|
||||||
@ -28,12 +33,14 @@ Obsoletes: %{name}-doc < %{version}-%{release}
|
|||||||
This package contains documentation for %{name}.
|
This package contains documentation for %{name}.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
gem unpack %{SOURCE0}
|
%setup -q -n %{gem_name}-%{version} -b 1
|
||||||
%setup -q -D -T -n %{gem_name}-%{version}
|
|
||||||
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
|
pushd %{_builddir}
|
||||||
|
%patch0 -p1
|
||||||
|
popd
|
||||||
|
|
||||||
%build
|
%build
|
||||||
gem build %{gem_name}.gemspec
|
gem build ../%{gem_name}-%{version}.gemspec
|
||||||
%gem_install
|
%gem_install
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -42,19 +49,12 @@ cp -rv .%{gem_dir}/* %{buildroot}%{gem_dir}
|
|||||||
sed -i -e 's|^#!/usr/bin/env ruby|#!/usr/bin/ruby|' \
|
sed -i -e 's|^#!/usr/bin/env ruby|#!/usr/bin/ruby|' \
|
||||||
%{buildroot}%{gem_instdir}/examples/*.rb
|
%{buildroot}%{gem_instdir}/examples/*.rb
|
||||||
|
|
||||||
|
%if %{without bootstrap}
|
||||||
%check
|
%check
|
||||||
%if ! 0%{?bootstrap}
|
|
||||||
pushd .%{gem_instdir}
|
pushd .%{gem_instdir}
|
||||||
tar xzvf %{SOURCE1}
|
cp -a %{_builddir}/test test
|
||||||
cd %{gem_name}-%{version}
|
sed -i '/active_support/ s/$/ unless Hash.method_defined?(:slice)/' test/helper.rb
|
||||||
for FILE in $(grep -rl '^require.*bundler.*' test/); do
|
|
||||||
sed -i "/^require 'bundler.*'/ s/^/#/" ${FILE}
|
|
||||||
done
|
|
||||||
mv test/integration_test.rb{,.disabled}
|
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)'
|
ruby -e 'Dir.glob "./test/*_test.rb", &method(:require)'
|
||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
@ -82,6 +82,9 @@ popd
|
|||||||
%{gem_instdir}/examples
|
%{gem_instdir}/examples
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Feb 24 2022 liyanan <liyanan32@huawei.com> - 2.0.8.1-1
|
||||||
|
- update to 2.0.8.1
|
||||||
|
|
||||||
* Wed Feb 10 2021 Ge Wang <wangge20@huawei.com> - 2.0.3-2
|
* Wed Feb 10 2021 Ge Wang <wangge20@huawei.com> - 2.0.3-2
|
||||||
- solve test error due to rubygem-rack update to 2.2.0+
|
- solve test error due to rubygem-rack update to 2.2.0+
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
BIN
sinatra-2.0.8.1-test.tar.gz
Normal file
BIN
sinatra-2.0.8.1-test.tar.gz
Normal file
Binary file not shown.
BIN
sinatra-2.0.8.1.gem
Normal file
BIN
sinatra-2.0.8.1.gem
Normal file
Binary file not shown.
BIN
v2.0.3.tar.gz
BIN
v2.0.3.tar.gz
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user