redis-wrap 0.0.0 → 0.0.1

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: 1f4f0dc09510ead01d649792f68ab44732e1bc27
4
- data.tar.gz: f6c44a5e02ea93445f72d851b3bc5743f453728a
3
+ metadata.gz: 92c0dc77293273654619c243657800c2ca5193c0
4
+ data.tar.gz: 4710f4c19ded5b1a92961d7b8135766a55b920c6
5
5
  SHA512:
6
- metadata.gz: d63a3117b2860184ef8e9df704ec41cb118a375dad5ad76635a1e213067891c5e331816a2512ced54a40fb5de58b8a8c23b4b736409f7bf229873ee37dda14dd
7
- data.tar.gz: 1db64e7604d159cd20f93201b22a4faec1f64430ff6dc2aaaf6672273b5754bd545b7fe42786cefe32da208fd5352b2568c8cc5a4a347ca2c251856bfb437be1
6
+ metadata.gz: b6bf092001a6c641a0260d3402769a27a13a3a9cf01b6dd89f9cc6ec99f3f4e0d1b9fe4cfcf4f0e08b514a7b6045e582d322ce36facea00252b79f4d6c1974c0
7
+ data.tar.gz: bc26ae988cb1658d4472e85943e000af74929f537c6b525540036b5dab7ba3a9d2b5e23dc9e71c121f040a7bae48981b0630d3e403fa254e5ffe1a433681f094
data/README.md CHANGED
@@ -80,4 +80,13 @@ CachedFind.new(User, params[:id]).fetch
80
80
 
81
81
  ### Install
82
82
 
83
- **TODO.**
83
+ ```ruby
84
+ # Gemfile
85
+
86
+ gem 'redis'
87
+ gem 'redis-wrap'
88
+ ```
89
+
90
+ ```sh
91
+ $ bundle install
92
+ ```
data/lib/redis/wrap.rb CHANGED
@@ -7,23 +7,17 @@ class Redis
7
7
  attr_reader :key
8
8
 
9
9
  def initialize(key)
10
- @key = key
10
+ @key = key.to_s
11
11
  end
12
12
 
13
13
  def method_missing(command, *arguments, &block)
14
- arguments = arguments.map do |argument|
15
- if argument.is_a?(Redis::Wrap)
16
- argument.key
17
- else
18
- argument
19
- end
20
- end
21
-
22
14
  redis.send(command, key, *arguments, &block)
23
15
  end
24
16
 
25
17
  def redis
26
18
  Redis.current
27
19
  end
20
+
21
+ alias_method :to_s, :key
28
22
  end
29
23
  end
@@ -0,0 +1,18 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'redis-wrap'
3
+ s.version = '0.0.1'
4
+
5
+ # metadata
6
+ s.license = 'MIT'
7
+ s.date = '2014-10-15'
8
+ s.summary = 'object-oriented redis'
9
+ s.description = ''
10
+ s.homepage = 'https://github.com/aj0strow/redis-wrap'
11
+ s.authors = [ '@aj0strow' ]
12
+ s.files = `git ls-files`.split(/\n/)
13
+ puts s.files
14
+ s.test_files = s.files.grep(/^test/)
15
+
16
+ # dependencies
17
+ s.add_runtime_dependency 'redis', '~> 3'
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-wrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@aj0strow"
@@ -36,6 +36,7 @@ files:
36
36
  - Rakefile
37
37
  - lib/redis-wrap.rb
38
38
  - lib/redis/wrap.rb
39
+ - redis-wrap.gemspec
39
40
  - test/helper.rb
40
41
  - test/redis/wrap_spec.rb
41
42
  homepage: https://github.com/aj0strow/redis-wrap