redis-classy 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 853e22b851186e7652fccf16122aa30eeba5a2b3
4
- data.tar.gz: ba856a46a81233ab124e9d4385b018f9553b7d3b
3
+ metadata.gz: 2c6d2bd350f71c3fc03a805458f373fe15fe0644
4
+ data.tar.gz: 9a2becf5e44e7b8a8b17c4c1cebe1558ff3d5aaa
5
5
  SHA512:
6
- metadata.gz: 3b780da64c36779c891c665cfdfa63677535abbbd45c23387fcf4898c9fb6800baa77c1d762024d27b02358f20183fe82b3d55584c306d111c65fa38451661ea
7
- data.tar.gz: d5e41544b71b1dff5072fa45366cdcbc2a9ad275f3eb7235bea137a2ad3694ad52efe7541a1a7b63946b8203e6335cdf17f44ecdb30d2bc1a099675b429d37ce
6
+ metadata.gz: d5c972222223dbb7274a0e6bfc3d863431b8843562e7a4f62e03412a6bfc45b28ed37b07bbcac7b4b417b448b88967abf4879a49e4955763651e85714ecfdb4e
7
+ data.tar.gz: 64f5bb8239d112ede4277237c2eb18a402888df5c4ba6d803e0448a79c416d060bde994e54e286c9e5d03a1de9d07b4d8eb8de5429abfd5f4a30b909d336af7e
@@ -76,11 +76,12 @@ class RedisClassy
76
76
  end
77
77
  end
78
78
 
79
+ KEYLESS_COMMANDS = [:multi, :pipelined, :exec, :eval, :unwatch]
80
+
79
81
  def method_missing(command, *args, &block)
80
82
  if @redis.respond_to?(command)
81
- parameters = @redis.method(command).parameters
82
- if parameters.empty? || parameters.first.first == :block
83
- # Keyless commands
83
+ case command
84
+ when *KEYLESS_COMMANDS
84
85
  @redis.send(command, *args, &block)
85
86
  else
86
87
  @redis.send(command, @key, *args, &block)
@@ -1,3 +1,3 @@
1
1
  class RedisClassy
2
- VERSION = '2.4.0'
2
+ VERSION = '2.4.1'
3
3
  end
@@ -86,6 +86,14 @@ describe RedisClassy do
86
86
  expect(something.smembers).to eq(['1','2','3'])
87
87
  end
88
88
 
89
+ it 'handles watch' do
90
+ something = Something.new('foo')
91
+
92
+ something.watch do
93
+ something.unwatch
94
+ end
95
+ end
96
+
89
97
  it 'handles method_missing' do
90
98
  # class method
91
99
  expect { Something.bogus }.to raise_error(NoMethodError)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-classy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenn Ejima