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 new file mode 100644 index 0000000..f4bc708 --- /dev/null +++ b/rubygem-thin-1.7.2-Mock-Kernel.warn-in-Ruby-2.5-compatible-way.patch @@ -0,0 +1,35 @@ +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 new file mode 100644 index 0000000..3217bb1 --- /dev/null +++ b/rubygem-thin.spec @@ -0,0 +1,86 @@ +%global gem_name thin +Name: rubygem-%{gem_name} +Version: 1.7.2 +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 +BuildRequires: ruby(release) rubygems-devel ruby-devel gcc rubygem(rspec2) +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 +libraries in web history. +The Mongrel parser, the root of Mongrel speed and security, +Event Machine, a network I/O library with extremely high scalability and +Rack, a minimal interface between webservers and Ruby frameworks. + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{name}. + +%prep +%setup -q -c -T +%gem_install -n %{SOURCE0} + +%build + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ +mkdir -p %{buildroot}%{gem_extdir_mri} +cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/ +rm -rf %{buildroot}%{gem_instdir}/ext/ +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 +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)/' \ + 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 +popd + +%files +%dir %{gem_instdir} +%{_bindir}/thin +%{gem_extdir_mri} +%{gem_instdir}/bin +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%{gem_instdir}/example/ +%doc %{gem_instdir}/CHANGELOG +%doc %{gem_instdir}/README.md +%{gem_instdir}/Rakefile + +%changelog +* Sat Aug 22 2020 tuShenmei - 1.7.2-1 +- package init diff --git a/rubygem-thin.yaml b/rubygem-thin.yaml new file mode 100644 index 0000000..aabcdb5 --- /dev/null +++ b/rubygem-thin.yaml @@ -0,0 +1,4 @@ +version_control: NA +src_repo: NA +tag_prefix: "thin-" +separator: "." diff --git a/temp.patch b/temp.patch new file mode 100644 index 0000000..1dce1bb --- /dev/null +++ b/temp.patch @@ -0,0 +1,14 @@ +--- rubygem-thin1.spec 2020-08-18 16:00:38.520006155 +0800 ++++ rubygem-thin.spec 2020-08-18 10:52:29.976017810 +0800 +@@ -4,9 +4,9 @@ + Release: 1 + Summary: A thin and fast web server + License: (GPLv2+ or Ruby) and BSD and MIT +-URL: http://code.macournoyer.com/thin/ ++URL: https://rubygems.org/gems/thin/versions/1.7.2 + Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +-Source1: %{gem_name}-%{version}-tests.tgz ++#Source1: %%{gem_name}-%%{version}-tests.tgz + Patch0: rubygem-thin-1.7.2-Mock-Kernel.warn-in-Ruby-2.5-compatible-way.patch + BuildRequires: ruby(release) rubygems-devel ruby-devel gcc rubygem(rspec2) + BuildRequires: rubygem(eventmachine) >= 1.0.4 rubygem(daemons) >= 1.0.9 rubygem(rack) >= 1.0.0 diff --git a/thin-1.7.2.gem b/thin-1.7.2.gem new file mode 100644 index 0000000..a9b3265 Binary files /dev/null and b/thin-1.7.2.gem differ diff --git a/v1.7.2.tar.gz b/v1.7.2.tar.gz new file mode 100644 index 0000000..a404a09 Binary files /dev/null and b/v1.7.2.tar.gz differ