redis-scripting 1.0.0 → 1.0.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.
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Utilities built on redis-rb for using Redis Lua scripting.
4
4
 
5
+ [![Build Status](https://travis-ci.org/codekitchen/redis-rb-scripting.png?branch=master)](https://travis-ci.org/codekitchen/redis-rb-scripting)
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -15,7 +15,7 @@ class Module
15
15
  load_scripts()
16
16
  end
17
17
 
18
- def run(script_name, keys, argv)
18
+ def run(script_name, keys, argv, redis = self.redis)
19
19
  script = @scripts[script_name.to_s]
20
20
  raise(ArgumentError, "unknown script: #{script_name}") unless script
21
21
 
@@ -1,5 +1,5 @@
1
1
  class Redis
2
2
  module Scripting
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -12,6 +12,17 @@ describe Redis::Scripting::Module do
12
12
  it "should raise on unknown" do
13
13
  expect { subject.run(:whut, [], []) }.to raise_error(ArgumentError)
14
14
  end
15
+
16
+ it "should use initializer redis by default" do
17
+ expect(redis).to receive(:evalsha) { 1 }
18
+ subject.run(:test1, [], []).should == 1
19
+ end
20
+
21
+ it "should use the given redis" do
22
+ redis2 = double('Redis2')
23
+ expect(redis2).to receive(:evalsha) { 1 }
24
+ subject.run(:test1, [], [], redis2).should == 1
25
+ end
15
26
  end
16
27
  end
17
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-scripting
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-05 00:00:00.000000000 Z
12
+ date: 2013-09-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
@@ -130,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  segments:
132
132
  - 0
133
- hash: -614399944501012724
133
+ hash: 141756191017378612
134
134
  required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  none: false
136
136
  requirements:
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  segments:
141
141
  - 0
142
- hash: -614399944501012724
142
+ hash: 141756191017378612
143
143
  requirements: []
144
144
  rubyforge_project:
145
145
  rubygems_version: 1.8.23