commit
6a682f88dd
BIN
dalli-2.7.8-tests.tgz
Normal file
BIN
dalli-2.7.8-tests.tgz
Normal file
Binary file not shown.
BIN
dalli-2.7.8.gem
Normal file
BIN
dalli-2.7.8.gem
Normal file
Binary file not shown.
44
rubygem-dalli-2.7.6-Fix-memcached-1.5.4-compatibility.patch
Normal file
44
rubygem-dalli-2.7.6-Fix-memcached-1.5.4-compatibility.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From 754414d3cd21a385ea62d58307ed7055e1df2996 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||
Date: Thu, 18 Jan 2018 17:10:50 +0100
|
||||
Subject: [PATCH] Fix mamcached 1.5.4 compatibility.
|
||||
|
||||
memcached 1.5.4 changed order of evaluation of command line parameters
|
||||
[1]. As a result, the test suite failed with errors such as:
|
||||
|
||||
~~~
|
||||
$ ruby -Ilib:test -e 'Dir.glob('\''./test/test_*.rb'\'').sort.each{ |x| require x }'
|
||||
Testing with Rails 5.1.4
|
||||
Using standard socket IO (ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux])
|
||||
Run options: --seed 35324
|
||||
# Running:
|
||||
Found memcached 1.5.4 in PATH
|
||||
.........................................................Cannot set item size limit higher than 1/2 of memory max.
|
||||
Cannot set item size limit higher than 1/2 of memory max.
|
||||
F
|
||||
Failure:
|
||||
Dalli::using a live server::in low memory conditions#test_0001_handle error response correctly [/builddir/build/BUILD/dalli-2.7.6/usr/share/gems/gems/dalli-2.7.6/test/test_dalli.rb:740]:
|
||||
unexpected failure on iteration 0
|
||||
/usr/share/gems/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:70:in `method': undefined method `test_0001_handle error response correctly' for class `Minitest::Result' (NameError)
|
||||
~~~
|
||||
|
||||
This commit adjust the memcached parameters to make the test suite pass.
|
||||
|
||||
[1] https://github.com/memcached/memcached/commit/95246f7947e9d95969d04db0898a93ef66235fb0
|
||||
---
|
||||
test/memcached_mock.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/memcached_mock.rb b/test/memcached_mock.rb
|
||||
index 47e96cb..42ba9d7 100644
|
||||
--- a/test/memcached_mock.rb
|
||||
+++ b/test/memcached_mock.rb
|
||||
@@ -108,7 +108,7 @@ def memcached_cas_persistent(port = 25662)
|
||||
|
||||
|
||||
def memcached_low_mem_persistent(port = 19128)
|
||||
- dc = start_and_flush_with_retry(port, '-m 1 -M')
|
||||
+ dc = start_and_flush_with_retry(port, '-m 1 -M -I 512k')
|
||||
yield dc, port if block_given?
|
||||
end
|
||||
|
||||
125
rubygem-dalli-2.7.6-Use-assert_nil-in-tests.patch
Normal file
125
rubygem-dalli-2.7.6-Use-assert_nil-in-tests.patch
Normal file
@ -0,0 +1,125 @@
|
||||
From 6d3243e7f41166b9fe57a64df066b1d1ec27164c Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Valena <pvalena@redhat.com>
|
||||
Date: Tue, 22 Aug 2017 13:42:43 +0200
|
||||
Subject: [PATCH] Use `assert_nil` in tests
|
||||
|
||||
instead of `assert_equal nil`, because it produces errors with activesupport >= 5.1.3.
|
||||
---
|
||||
test/test_active_support.rb | 16 ++++++++--------
|
||||
test/test_dalli.rb | 8 ++++----
|
||||
test/test_encoding.rb | 2 +-
|
||||
3 files changed, 13 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/test/test_active_support.rb b/test/test_active_support.rb
|
||||
index eca4322..6313b4c 100644
|
||||
--- a/test/test_active_support.rb
|
||||
+++ b/test/test_active_support.rb
|
||||
@@ -84,7 +84,7 @@ def self.it_with_and_without_local_cache(message, &block)
|
||||
with_cache cache_nils: true do
|
||||
@dalli.write('nil', nil)
|
||||
dvalue = @dalli.fetch('nil') { flunk }
|
||||
- assert_equal nil, dvalue
|
||||
+ assert_nil dvalue
|
||||
end
|
||||
|
||||
with_cache cache_nils: false do
|
||||
@@ -281,7 +281,7 @@ def self.it_with_and_without_local_cache(message, &block)
|
||||
@dalli.delete(y)
|
||||
Dalli::Client.any_instance.expects(:get).with(y, {}).once.returns(nil)
|
||||
dres = @dalli.read(y)
|
||||
- assert_equal nil, dres
|
||||
+ assert_nil dres
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -320,15 +320,15 @@ def self.it_with_and_without_local_cache(message, &block)
|
||||
assert_equal 6, @dalli.increment('counterY1', 1, :initial => 5)
|
||||
assert_equal 6, @dalli.read('counterY1', :raw => true).to_i
|
||||
|
||||
- assert_equal nil, @dalli.increment('counterZ1', 1, :initial => nil)
|
||||
- assert_equal nil, @dalli.read('counterZ1')
|
||||
+ assert_nil @dalli.increment('counterZ1', 1, :initial => nil)
|
||||
+ assert_nil @dalli.read('counterZ1')
|
||||
|
||||
assert_equal 5, @dalli.decrement('counterY2', 1, :initial => 5)
|
||||
assert_equal 4, @dalli.decrement('counterY2', 1, :initial => 5)
|
||||
assert_equal 4, @dalli.read('counterY2', :raw => true).to_i
|
||||
|
||||
- assert_equal nil, @dalli.decrement('counterZ2', 1, :initial => nil)
|
||||
- assert_equal nil, @dalli.read('counterZ2')
|
||||
+ assert_nil @dalli.decrement('counterZ2', 1, :initial => nil)
|
||||
+ assert_nil @dalli.read('counterZ2')
|
||||
|
||||
user = MockUser.new
|
||||
assert op_addset_succeeds(@dalli.write(user, 0, :raw => true))
|
||||
@@ -369,7 +369,7 @@ def self.it_with_and_without_local_cache(message, &block)
|
||||
memcached_kill(new_port)
|
||||
|
||||
silence_logger do
|
||||
- assert_equal @dalli.read('foo'), nil
|
||||
+ assert_nil @dalli.read('foo')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -446,7 +446,7 @@ def self.it_with_and_without_local_cache(message, &block)
|
||||
|
||||
it 'supports connection pooling' do
|
||||
with_cache :expires_in => 1, :namespace => 'foo', :compress => true, :pool_size => 3 do
|
||||
- assert_equal nil, @dalli.read('foo')
|
||||
+ assert_nil @dalli.read('foo')
|
||||
assert @dalli.write('foo', 1)
|
||||
assert_equal 1, @dalli.fetch('foo') { raise 'boom' }
|
||||
assert_equal true, @dalli.dalli.is_a?(ConnectionPool)
|
||||
diff --git a/test/test_dalli.rb b/test/test_dalli.rb
|
||||
index ac404b0..0d36877 100644
|
||||
--- a/test/test_dalli.rb
|
||||
+++ b/test/test_dalli.rb
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
it 'returns nil for nonexist key' do
|
||||
memcached_persistent do |dc|
|
||||
- assert_equal nil, dc.get('notexist')
|
||||
+ assert_nil dc.get('notexist')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
|
||||
dc.set("fetch_key", nil)
|
||||
res = dc.fetch("fetch_key") { flunk "fetch block called" }
|
||||
- assert_equal nil, res
|
||||
+ assert_nil res
|
||||
end
|
||||
|
||||
memcached_persistent(21345, cache_nils: false) do |dc|
|
||||
@@ -507,7 +507,7 @@
|
||||
assert_equal 'bar', dc.get(:foo)
|
||||
|
||||
resp = dc.get('123')
|
||||
- assert_equal nil, resp
|
||||
+ assert_nil resp
|
||||
|
||||
assert op_addset_succeeds(dc.set('123', 'xyz'))
|
||||
|
||||
@@ -561,7 +561,7 @@
|
||||
assert_equal 'bar', dc.get(:foo)
|
||||
|
||||
resp = dc.get('123')
|
||||
- assert_equal nil, resp
|
||||
+ assert_nil resp
|
||||
|
||||
assert op_addset_succeeds(dc.set('123', 'xyz'))
|
||||
|
||||
diff --git a/test/test_encoding.rb b/test/test_encoding.rb
|
||||
index 8f03e4a..7daf874 100644
|
||||
--- a/test/test_encoding.rb
|
||||
+++ b/test/test_encoding.rb
|
||||
@@ -22,7 +22,7 @@
|
||||
assert dc.set(key, 'bar', 1)
|
||||
assert_equal 'bar', dc.get(key)
|
||||
sleep 1.2
|
||||
- assert_equal nil, dc.get(key)
|
||||
+ assert_nil dc.get(key)
|
||||
end
|
||||
end
|
||||
end
|
||||
68
rubygem-dalli.spec
Normal file
68
rubygem-dalli.spec
Normal file
@ -0,0 +1,68 @@
|
||||
%global gem_name dalli
|
||||
%global enable_test 0
|
||||
Name: rubygem-%{gem_name}
|
||||
Version: 2.7.8
|
||||
Release: 1
|
||||
Summary: High performance memcached client for Ruby
|
||||
License: MIT
|
||||
URL: https://github.com/petergoldstein/dalli
|
||||
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||||
Source1: %{gem_name}-%{version}-tests.tgz
|
||||
Patch0: rubygem-dalli-2.7.6-Use-assert_nil-in-tests.patch
|
||||
Patch1: rubygem-dalli-2.7.6-Fix-memcached-1.5.4-compatibility.patch
|
||||
BuildRequires: ruby(release) rubygems-devel
|
||||
%if 0%{enable_test} > 0
|
||||
BuildRequires: memcached rubygem(minitest) rubygem(mocha) rubygem(rails)
|
||||
BuildRequires: rubygem(connection_pool)
|
||||
%endif
|
||||
BuildRequires: ruby
|
||||
BuildArch: noarch
|
||||
%description
|
||||
High performance memcached client for Ruby
|
||||
|
||||
%package doc
|
||||
Summary: Documentation for %{name}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
BuildArch: noarch
|
||||
%description doc
|
||||
Documentation for %{name}
|
||||
|
||||
%prep
|
||||
%setup -q -n %{gem_name}-%{version}
|
||||
|
||||
%build
|
||||
gem build ../%{gem_name}-%{version}.gemspec
|
||||
%gem_install
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{gem_dir}
|
||||
cp -pa .%{gem_dir}/* \
|
||||
%{buildroot}%{gem_dir}/
|
||||
|
||||
%check
|
||||
%if 0%{enable_test} > 0
|
||||
pushd .%{gem_instdir}
|
||||
tar xzvf %{SOURCE1}
|
||||
cat %{PATCH0} | patch -p1
|
||||
cat %{PATCH1} | patch -p1
|
||||
sed -i '/bundler/ s/^/#/' test/helper.rb
|
||||
ruby -Ilib:test -e "Dir.glob('./test/test_*.rb').sort.each{ |x| require x }"
|
||||
popd
|
||||
%endif
|
||||
|
||||
%files
|
||||
%dir %{gem_instdir}
|
||||
%{gem_libdir}
|
||||
%exclude %{gem_cache}
|
||||
%{gem_spec}
|
||||
%license %{gem_instdir}/LICENSE
|
||||
|
||||
%files doc
|
||||
%doc %{gem_docdir}
|
||||
%doc %{gem_instdir}/README.md
|
||||
%doc %{gem_instdir}/History.md
|
||||
%{gem_instdir}/Gemfile
|
||||
|
||||
%changelog
|
||||
* Fri Jul 24 2020 wutao <wutao61@huawei.com> - 2.7.8-1
|
||||
- package init
|
||||
4
rubygem-dalli.yaml
Normal file
4
rubygem-dalli.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
version_control: github
|
||||
src_repo: petergoldstein/dalli
|
||||
tag_prefix: "^v"
|
||||
seperator: "."
|
||||
Loading…
x
Reference in New Issue
Block a user