spymemcached_store 1.0.1-java → 1.0.2-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cf1de67233c72496592c0350be6f3ca2800c5b4
4
- data.tar.gz: 2e3376af818bf52570cc8ccc4e8450d9c76c2b6e
3
+ metadata.gz: f498d43e5c726a6c6bf9b18d8bb331fcecb77440
4
+ data.tar.gz: 4305f1bbcade53b8dd98b06021acd29c97bbad69
5
5
  SHA512:
6
- metadata.gz: 9a4b8c7c6b64c1ffdeacfa2d732768515e9358c4c6fdb15b3e6eb6da529121a35036caa7e7558b1f6561d70f7dc8a9504324665cb063a12eace84eb6401121cb
7
- data.tar.gz: 1eee6860ba61259be722275852131475bf5398dd774885c9475e6b65dab9ba76f9c3bb00470e6b5216cef581fd2df0e20c58aff909bc7c59a310138e3ed9e0ec
6
+ metadata.gz: 9b81f7eff1f2210b5a5dcb81def4d6aeebb2484e57ca9c2560881e4b09380ea5a09a116ca03e032fb9f2773fc7f0e294a72e8c2b23b0a58ce179b4369aed9bd7
7
+ data.tar.gz: 2a15f5641e9a975cde6ac8f754d1075dda4aaa7c01d60f7df98e6c7d4cac122e0a9f00b93bf0c953cc8e14085d646b66e02d39650feef3d209c7085569af5b42
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # SpymemcachedStore
2
2
 
3
3
  This is Rails 4 compatible cache store for [spymemcached.jruby](https://github.com/ThoughtWorksStudios/spymemcached.jruby)
4
+ to replace Rails' default memcache client Dalli on JRuby platform.
4
5
 
5
6
  ## Installation
6
7
 
@@ -26,6 +27,11 @@ Supports all Rails cache store options, see [spymemcached.jruby](https://github.
26
27
 
27
28
  It is not recommended to use :compress and :compress_threshold options, as spymemcached.jruby does it by default.
28
29
 
30
+ ## Credits
31
+
32
+ Most of code including tests is coming from Rails codebase v4.1.6.
33
+ Only replaced Dalli related part with spymemcached.jruby to keep API compatible.
34
+
29
35
  ## Contributing
30
36
 
31
37
  1. Fork it ( https://github.com/ThoughtWorksStudios/spymemcached_store/fork )
@@ -5,7 +5,6 @@ module ActiveSupport
5
5
  module Cache
6
6
  class SpymemcachedStore < ActiveSupport::Cache::Store
7
7
 
8
- # namespace
9
8
  def initialize(*addresses)
10
9
  addresses = addresses.flatten
11
10
  options = addresses.extract_options!
@@ -115,7 +114,7 @@ module ActiveSupport
115
114
  # Set the memcache expire a few minutes in the future to support race condition ttls on read
116
115
  expires_in += 5.minutes
117
116
  end
118
- @client.send(method, key, value, expires_in)
117
+ @client.send(method, key, value, expires_in, options)
119
118
  rescue Spymemcached::Error => e
120
119
  logger.error("Spymemcached::Error (#{e}): #{e.message}") if logger
121
120
  false
@@ -1,3 +1,3 @@
1
1
  module SpymemcachedStore
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.platform = 'java'
10
10
  spec.authors = ["Xiao Li"]
11
11
  spec.email = ["swing1979@gmail.com"]
12
- spec.summary = %q{Rails 3 & 4 cache store for spymemcached.jruby.}
13
- spec.description = %q{Rails 3 & 4 cache store for spymemcached.jruby.}
12
+ spec.summary = %q{Rails 4 cache store for spymemcached.jruby.}
13
+ spec.description = %q{Rails 4 cache store for spymemcached.jruby.}
14
14
  spec.homepage = "https://github.com/ThoughtWorksStudios/spymemcached_store"
15
15
  spec.license = "MIT"
16
16
 
@@ -2,6 +2,8 @@ gem 'minitest' # make sure we get the gem, not stdlib
2
2
  require 'minitest'
3
3
  require "minitest/autorun"
4
4
 
5
+ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '../lib')))
6
+
5
7
  require 'active_support'
6
8
  require 'active_support/inflector'
7
9
  require 'mocha/setup' # FIXME: stop using mocha
@@ -78,6 +80,16 @@ class SpymemcachedStoreTest < ::Minitest::Test
78
80
  assert_equal 'bar', @cache.read('abc:foo')
79
81
  end
80
82
 
83
+ def test_raw_option
84
+ @cache.write('foo', '1')
85
+ assert_equal '1', @cache.read('foo')
86
+ assert_equal -1, @cache.increment('foo')
87
+
88
+ @cache.write('bar', '1', :raw => true)
89
+ assert_equal '1', @cache.read('bar')
90
+ assert_equal 2, @cache.increment('bar')
91
+ end
92
+
81
93
  def assert_not_equal(expected, result)
82
94
  assert expected != result, "expect #{expected.inspect} not equal #{result.inspect}"
83
95
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spymemcached_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: java
6
6
  authors:
7
7
  - Xiao Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-01 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spymemcached.jruby
@@ -108,7 +108,7 @@ dependencies:
108
108
  version: '5.1'
109
109
  prerelease: false
110
110
  type: :development
111
- description: Rails 3 & 4 cache store for spymemcached.jruby.
111
+ description: Rails 4 cache store for spymemcached.jruby.
112
112
  email:
113
113
  - swing1979@gmail.com
114
114
  executables: []
@@ -155,7 +155,7 @@ rubyforge_project:
155
155
  rubygems_version: 2.1.9
156
156
  signing_key:
157
157
  specification_version: 4
158
- summary: Rails 3 & 4 cache store for spymemcached.jruby.
158
+ summary: Rails 4 cache store for spymemcached.jruby.
159
159
  test_files:
160
160
  - test/autoloading_cache_behavior.rb
161
161
  - test/cache_increment_decrement_behavior.rb