- Update to Rack 1.4.1.

- Documentation moved into subpackage.
epel9
Vít Ondruch 12 years ago
parent d3dbfc75c7
commit 07b9d2a26d

1
.gitignore vendored

@ -1,3 +1,4 @@
rack-1.1.0.gem
/rack-1.3.0.gem
/rack-1.4.0.gem
/rack-1.4.1.gem

@ -1,43 +0,0 @@
From 17a3e1ea7be50094d09b6f5fbb4770b5468e8421 Mon Sep 17 00:00:00 2001
From: HannesG <hag@informatik.uni-kiel.de>
Date: Thu, 29 Dec 2011 19:23:32 +0100
Subject: [PATCH] Test an object which repsonds to each instead of a set.
---
test/spec_response.rb | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/test/spec_response.rb b/test/spec_response.rb
index 07dd012..589063e 100644
--- a/test/spec_response.rb
+++ b/test/spec_response.rb
@@ -1,4 +1,3 @@
-require 'set'
require 'rack/response'
require 'stringio'
@@ -125,7 +124,6 @@ describe Rack::Response do
response = Rack::Response.new
response.redirect "/foo"
status, header, body = response.finish
-
status.should.equal 302
header["Location"].should.equal "/foo"
@@ -147,7 +145,12 @@ describe Rack::Response do
str = ""; body.each { |part| str << part }
str.should.equal "foobar"
- r = Rack::Response.new(["foo", "bar"].to_set)
+ object_with_each = Object.new
+ def object_with_each.each
+ yield "foo"
+ yield "bar"
+ end
+ r = Rack::Response.new(object_with_each)
r.write "foo"
status, header, body = r.finish
str = ""; body.each { |part| str << part }
--
1.7.7.5

@ -1,62 +0,0 @@
From c711cd421f3eacfde9965b4b38f41acc5754b5d0 Mon Sep 17 00:00:00 2001
From: HannesG <hag@informatik.uni-kiel.de>
Date: Thu, 29 Dec 2011 19:24:03 +0100
Subject: [PATCH] Utils tests now accept different query orders.
---
test/spec_utils.rb | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/test/spec_utils.rb b/test/spec_utils.rb
index a787763..069e229 100644
--- a/test/spec_utils.rb
+++ b/test/spec_utils.rb
@@ -3,6 +3,15 @@ require 'rack/utils'
require 'rack/mock'
describe Rack::Utils do
+
+ # A helper method which checks
+ # if certain query parameters
+ # are equal.
+ def equal_query_to(query)
+ parts = query.split('&')
+ lambda{|other| (parts & other.split('&')) == parts }
+ end
+
def kcodeu
one8 = RUBY_VERSION.to_f < 1.9
default_kcode, $KCODE = $KCODE, 'U' if one8
@@ -187,13 +196,13 @@ describe Rack::Utils do
end
should "build query strings correctly" do
- Rack::Utils.build_query("foo" => "bar").should.equal "foo=bar"
+ Rack::Utils.build_query("foo" => "bar").should.be equal_query_to("foo=bar")
Rack::Utils.build_query("foo" => ["bar", "quux"]).
- should.equal "foo=bar&foo=quux"
+ should.be equal_query_to("foo=bar&foo=quux")
Rack::Utils.build_query("foo" => "1", "bar" => "2").
- should.equal "foo=1&bar=2"
+ should.be equal_query_to("foo=1&bar=2")
Rack::Utils.build_query("my weird field" => "q1!2\"'w$5&7/z8)?").
- should.equal "my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F"
+ should.be equal_query_to("my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F")
end
should "build nested query strings correctly" do
@@ -202,9 +211,9 @@ describe Rack::Utils do
Rack::Utils.build_nested_query("foo" => "bar").should.equal "foo=bar"
Rack::Utils.build_nested_query("foo" => "1", "bar" => "2").
- should.equal "foo=1&bar=2"
+ should.be equal_query_to("foo=1&bar=2")
Rack::Utils.build_nested_query("my weird field" => "q1!2\"'w$5&7/z8)?").
- should.equal "my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F"
+ should.be equal_query_to("my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F")
Rack::Utils.build_nested_query("foo" => [nil]).
should.equal "foo[]"
--
1.7.7.5

@ -1,20 +1,15 @@
%define gem_name rack
%global gem_name rack
Name: rubygem-%{gem_name}
Summary: Common API for connecting web frameworks, web servers and layers of software
# Introduce Epoch (related to bug 552972)
Epoch: 1
Version: 1.4.0
Release: 3%{?dist}
Version: 1.4.1
Release: 1%{?dist}
Group: Development/Languages
License: MIT
URL: http://rubyforge.org/projects/%{gem_name}/
Source0: http://gems.rubyforge.org/gems/%{gem_name}-%{version}.gem
# These patches fix the test failuers with Ruby 1.8.7-p357 and are already
# proposed upstream: https://github.com/rack/rack/pull/298
Patch0: rubygem-rack-test-object-which-responds-to-each.patch
Patch1: rubygem-rack-tests-now-accept-different-query-orders.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: ruby(rubygems)
Requires: ruby(abi) = 1.9.1
BuildRequires: rubygems-devel
@ -26,17 +21,23 @@ Provides: rubygem(%{gem_name}) = %{version}
Rack provides a common API for connecting web frameworks,
web servers and layers of software in between
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}
%prep
%setup -q -c -T
mkdir -p .%{gem_dir}
gem install --local --install-dir .%{gem_dir} \
LANG=en_US.utf8 gem install --local --install-dir .%{gem_dir} \
--bindir .%{_bindir} \
--force %{SOURCE0}
pushd .%{gem_instdir}
%patch0 -p1
%patch1 -p1
popd
%build
%install
@ -45,11 +46,11 @@ mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
# Remove backup files
find %{buildroot}/%{gem_instdir} -type f -name "*~" -delete
mkdir -p %{buildroot}%{_bindir}
cp -pa .%{_bindir}/* \
%{buildroot}%{_bindir}/
# Delete zero-length files
find %{buildroot}/%{gem_instdir} -type f -size 0c -exec rm -rvf {} \;
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
# Fix anything executable that does not have a shebang
for file in `find %{buildroot}/%{gem_instdir} -type f -perm /a+x`; do
@ -57,49 +58,41 @@ for file in `find %{buildroot}/%{gem_instdir} -type f -perm /a+x`; do
done
# Find files with a shebang that do not have executable permissions
for file in `find %{buildroot}/%{gem_instdir} -type f ! -perm /a+x -name "*.rb"`; do
[ ! -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 755 $file
for file in `find %{buildroot}%{gem_instdir} -type f`; do
[ ! -z "`head -n 1 $file | grep \"^#!\"`" ] && chmod -v 755 $file
done
# Find files that have non-standard-executable-perm
find %{buildroot}/%{gem_instdir} -type f -perm /g+wx -exec chmod -v g-w {} \;
# Find files that are not readable
find %{buildroot}/%{gem_instdir} -type f ! -perm /go+r -exec chmod -v go+r {} \;
# Move %%{gem_dir}/bin/rackup to %%{_bindir}
mkdir -p %{buildroot}/%{_bindir}
mv %{buildroot}/%{gem_dir}/bin/rackup %{buildroot}/%{_bindir}
rm -rf %{buildroot}/%{gem_dir}/bin/
%clean
rm -rf %{buildroot}
%check
pushd %{buildroot}%{gem_instdir}
pushd .%{gem_instdir}
bacon --automatic --quiet
popd
%files
%defattr(-, root, root, -)
%dir %{gem_instdir}
%doc %{gem_docdir}
%doc %{gem_instdir}/COPYING
%doc %{gem_instdir}/Rakefile
%doc %{gem_instdir}/README.rdoc
%doc %{gem_instdir}/KNOWN-ISSUES
%doc %{gem_instdir}/SPEC
%doc %{gem_instdir}/example
%doc %{gem_instdir}/test
%doc %{gem_instdir}/contrib
%{gem_instdir}/%{gem_name}.gemspec
%{gem_libdir}
%{gem_instdir}/bin
%{_bindir}/rackup
%{gem_cache}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.rdoc
%doc %{gem_instdir}/KNOWN-ISSUES
%{gem_instdir}/%{gem_name}.gemspec
%{gem_instdir}/Rakefile
%{gem_instdir}/SPEC
%doc %{gem_instdir}/example
%{gem_instdir}/test
%doc %{gem_instdir}/contrib
%changelog
* Mon Oct 29 2012 Vít Ondruch <vondruch@redhat.com> - 1:1.4.1-1
- Update to Rack 1.4.1.
- Documentation moved into subpackage.
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

@ -1 +1 @@
c2a2100159ebd81ceffc20bd38323152 rack-1.4.0.gem
a278fe5208c2412b724d6eac432e2807 rack-1.4.1.gem

Loading…
Cancel
Save