diff --git a/0001-Fix-maximum_connections-limiting-test.patch b/0001-Fix-maximum_connections-limiting-test.patch deleted file mode 100644 index 23ad3d7ed4f13329bcc2db1764a53774df5d4ea9..0000000000000000000000000000000000000000 --- a/0001-Fix-maximum_connections-limiting-test.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b7876b29c46fccd711638073a66d9c2ea76af4fe Mon Sep 17 00:00:00 2001 -From: maminjie -Date: Fri, 19 Mar 2021 14:15:32 +0800 -Subject: [PATCH] Fix maximum_connections limiting test - -reference to: https://github.com/macournoyer/thin/pull/360 ---- - spec/server_spec.rb | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/spec/server_spec.rb b/spec/server_spec.rb -index 40747cc..25fb48a 100644 ---- a/spec/server_spec.rb -+++ b/spec/server_spec.rb -@@ -16,9 +16,10 @@ describe Server do - # connections, so we cannot really run this test under that - # condition. - pending("only for non-root users") if Process.euid == 0 -- @server.maximum_connections = 100_000 -+ maximum_connnections = 1_000_000 -+ @server.maximum_connections = maximum_connnections - @server.config -- @server.maximum_connections.should < 100_000 -+ @server.maximum_connections.should <= maximum_connnections - end - - it "should default to non-threaded" do -@@ -102,4 +103,4 @@ describe Server, "initialization" do - Server.should_not_receive(:setup_signals) - Server.new(:signals => false) - end --end -\ No newline at end of file -+end --- -2.23.0 - diff --git a/rubygem-thin-1.7.2-Mock-Kernel.warn-in-Ruby-2.5-compatible-way.patch b/rubygem-thin-1.7.2-Mock-Kernel.warn-in-Ruby-2.5-compatible-way.patch deleted file mode 100644 index f4bc70863f2c85c9fd939e132f4e5fa7d9545556..0000000000000000000000000000000000000000 --- a/rubygem-thin-1.7.2-Mock-Kernel.warn-in-Ruby-2.5-compatible-way.patch +++ /dev/null @@ -1,35 +0,0 @@ -From fd9aad1ccc736d0ceaa36dfe1732390427354788 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Mon, 8 Jan 2018 13:23:43 +0100 -Subject: [PATCH] Mock Kernel.warn in Ruby 2.5 compatible way. - -Ruby changed the way Kernel#warn reports the error [1], but mocking the -method on the class, which is calling it, should be universal [2]. - -[1] https://bugs.ruby-lang.org/issues/12944 -[2] https://www.reddit.com/r/ruby/comments/2nki9q/rspec_how_do_you_mock_or_stub_kernel_methods_like/ ---- - spec/runner_spec.rb | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/spec/runner_spec.rb b/spec/runner_spec.rb -index 825783d..cee6b91 100644 ---- a/spec/runner_spec.rb -+++ b/spec/runner_spec.rb -@@ -65,10 +65,10 @@ describe Runner do - end - - it "should warn when require a rack config file" do -- STDERR.stub!(:write) -- STDERR.should_receive(:write).with(/WARNING:/) -- - runner = Runner.new(%w(start -r config.ru)) -+ -+ runner.should_receive(:warn).with(/WARNING:/) -+ - runner.run! rescue nil - - runner.options[:rackup].should == 'config.ru' --- -2.15.1 - diff --git a/rubygem-thin.spec b/rubygem-thin.spec index 5a4573115b90b1852150cd6f708b5f006ad0e18d..520199456b8f4abad5c92e9435446094ba77c24d 100644 --- a/rubygem-thin.spec +++ b/rubygem-thin.spec @@ -1,17 +1,15 @@ %global gem_name thin Name: rubygem-%{gem_name} -Version: 1.7.2 -Release: 2 +Version: 1.8.0 +Release: 1 Summary: A thin and fast web server License: (GPLv2+ or Ruby) and BSD and MIT URL: https://rubygems.org/gems/%{gem_name}/versions/%{version} Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem -Source1: https://github.com/macournoyer/thin/archive/v%{version}.tar.gz -# Fix the test suite error due to way Ruby 2.5 reports warnings. -# https://github.com/macournoyer/thin/pull/346 -Patch0: rubygem-thin-1.7.2-Mock-Kernel.warn-in-Ruby-2.5-compatible-way.patch -Patch1: 0001-Fix-maximum_connections-limiting-test.patch -BuildRequires: ruby(release) rubygems-devel ruby-devel gcc rubygem(rspec2) +# git clone https://github.com/macournoyer/thin.git && cd thin +# git archive -v -o thin-1.8.0-tests.tar.gz v1.8.0 spec/ +Source1: %{gem_name}-%{version}-tests.tar.gz +BuildRequires: ruby(release) rubygems-devel ruby-devel gcc rubygem(rspec) BuildRequires: rubygem(eventmachine) >= 1.0.4 rubygem(daemons) >= 1.0.9 rubygem(rack) >= 1.0.0 %description Thin is a Ruby web server that glues together three of the best Ruby @@ -29,10 +27,11 @@ BuildArch: noarch Documentation for %{name}. %prep -%setup -q -c -T -%gem_install -n %{SOURCE0} +%setup -q -n %{gem_name}-%{version} -b 1 %build +gem build ../%{gem_name}-%{version}.gemspec +%gem_install %install mkdir -p %{buildroot}%{gem_dir} @@ -45,26 +44,16 @@ mkdir -p %{buildroot}%{_bindir} cp -a .%{_bindir}/* \ %{buildroot}%{_bindir}/ find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x -pushd %{buildroot}/%{gem_instdir}/example -chmod 755 async_chat.ru -chmod 755 async_tailer.ru -popd %check pushd .%{gem_instdir} -tar xzvf %{SOURCE1} -cp -r thin-%{version}/spec spec -cat %{PATCH0} | patch -p1 -cat %{PATCH1} | patch -p1 -find spec/perf -name "*_spec.rb" -exec \ - sed -i '/be_faster_then/ i \ pending' {} \; -sed -i -r "/'should (force )?kill process in pid file'/a \ pending" \ - spec/daemonizing_spec.rb -sed -i '/^ def server_should_start_in_less_then/,/^ end/ s/(10)/(20)/' \ +cp -a %{_builddir}/spec spec + +# To prevent timeout error on build. +sed -i '/^ def wait_for_server_to_start$/,/^ end$/ s/(10)/(30)/' \ spec/daemonizing_spec.rb -sed -i '/"tracing routines (with NO custom logger)"/a \ before { pending }' \ - spec/logging_spec.rb -rspec2 -I$(dirs +1)%{gem_extdir_mri} spec + +rspec -I$(dirs +1)%{gem_extdir_mri} spec popd %files @@ -84,6 +73,9 @@ popd %{gem_instdir}/Rakefile %changelog +* Tue Jan 17 2023 caodongxia - 1.8.0-1 +- update to 1.8.0 + * Fri Mar 19 2021 maminjie - 1.7.2-2 - Fix maximum_connections limiting test diff --git a/thin-1.7.2.gem b/thin-1.7.2.gem deleted file mode 100644 index a9b326549c7b5c0d7a03dffee226cc64cf6c47d7..0000000000000000000000000000000000000000 Binary files a/thin-1.7.2.gem and /dev/null differ diff --git a/thin-1.8.0-tests.tar.gz b/thin-1.8.0-tests.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a4b68541f97c2ef7c7502d424d2dfc8c0a1b4ff7 Binary files /dev/null and b/thin-1.8.0-tests.tar.gz differ diff --git a/thin-1.8.0.gem b/thin-1.8.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..e686764da955178292ba7bcc489e4d3d2fa5be21 Binary files /dev/null and b/thin-1.8.0.gem differ diff --git a/v1.7.2.tar.gz b/v1.7.2.tar.gz deleted file mode 100644 index a404a0976da1df17181d99d3b99d56139b4aa1bc..0000000000000000000000000000000000000000 Binary files a/v1.7.2.tar.gz and /dev/null differ