reredis 0.0.1 → 0.0.2

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGZiNGZmMThhNTFmOWJmYzE3OGI3NzA3MjgwMGViZDNiYzg0ZTMzNw==
4
+ YWQyNzVkMTlmMTkzMWRmZmIxZjkwYjA4MGExYmQ4YjExM2QzZWUzYw==
5
5
  data.tar.gz: !binary |-
6
- Njk5NjcyYTRhMDlkMzUwMDE3NjViOGE2ZDM4ZWI0MjcxNTFmNTQzYw==
6
+ MjEzZWVkYjYwNzlhMzRmNjJiMzliODc1NzI0ZTViNjViZjEzNjkxMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjFmNDc5NjE2ZmZhNjRmMjU0ZTgxNDZiZTk3Y2Y0MDk4MTZmNmU4M2Y0MTgz
10
- ODQ4NzMwMTllMGQ0MDg0NjU3OTI5ZDcyMjkxYmM3N2I1ZWFlMjZlOGIyODAx
11
- YTI4NDFlYzc5Yjc1MmI4Y2I2MGIzMjFkN2MzMWE3ZjIzMDU0OTM=
9
+ MTVlMGRkYjk5NjUzNWY5OWQwNDkzMmVhYzgzYjU0ZDkwZjUxYTI4ZDY2YjNl
10
+ YTdmMDNlZjFhOWZlYTQxYWQ0OGMzODIzZWM2NjU1MDhhZTVlMTcyYzUwODk5
11
+ NTZmOGY2ODgyMjk5NDkyNDk5ZDhiYjk1NmM4NDQwZjQwZjJlMDI=
12
12
  data.tar.gz: !binary |-
13
- ZDgyZjg0NzNiODA5OWM3ODVmZmI4NWU1NzVhNzkxMTVjZGJkZTNjMGYyOTg2
14
- MDZlMzhmYjI2NDJlYzcxMWE4ZTc3ODQxNGZlMGRmYTk2Y2ZiN2RjNWViY2I4
15
- YTU1ZWM1NDMyNmVkYWI3NWQ3NTk4NGM3MjU1ODZiOTliYmZkZDc=
13
+ N2I0OGQwOTE0OGUxYTQ0ODYxM2UzODkwMjEyZWZkZmIzMjQwYTFhODUzYmJi
14
+ Mzk5NjBlZjcxN2QyYmMyNWVlOTAxMjI1YjJkYmE1ZGIxN2M1NGE1OGE2ZGEy
15
+ NjQwZDQwNTgzNGJkNGJjNGIyODhiODM2ZjI3NWY2NTg3YTYxN2Y=
data/README.md CHANGED
@@ -10,13 +10,41 @@ Add this line to your application's Gemfile:
10
10
 
11
11
  And then execute:
12
12
 
13
- $ bundle
13
+ $ bundle install
14
14
 
15
15
  Or install it yourself as:
16
16
 
17
17
  $ gem install reredis
18
18
 
19
19
  ## Usage
20
+ A custorm gem redis- it include redis object and some sample counter for model : photo,user using Redis
21
+
22
+ To use redis object
23
+ Add this line to your application's active record model
24
+ $ include Reredis::Model::RedisObject
25
+
26
+ To use User's counter and relation sample
27
+ $ include Reredis::Model::User::Counter
28
+ $ include Reredis::Model::User::Relation
29
+
30
+ To user Photo's counter sample
31
+ $ include Reredis::Model::Photo::Counter
32
+
33
+ You can test in rails console
34
+ # Photo.first.likes_count
35
+ # Photo.first.comments_count
36
+ # Photo.first.pins_count
37
+ # User.first.get_followers_status
38
+ # User.first.get_likes_status
39
+
40
+ Using method mget of Redis to get information
41
+
42
+ Something like this :
43
+ # @likes_count = Reredis.mget(photos, "likes_count")
44
+ # @pins_count = Reredis.mget(photos, "pins_count")
45
+ # @comments_count = Reredis.mget(photos, "comments_count")
46
+
47
+
20
48
 
21
49
 
22
50
  ## Contributing
@@ -23,7 +23,6 @@ module Reredis
23
23
  $redis_statistics = Redis.new(:host => ENV['CACHE_REDIS_TRACK_STATISTICS'], :port => 6379, :db => 2)
24
24
  end
25
25
 
26
- # if redis error or flushdb, please run rake redis:run_after_flushdb
27
26
  def self.mget(objects, str)
28
27
  hash = Hash.new
29
28
  return hash if objects.blank?
@@ -1,3 +1,3 @@
1
1
  module Reredis
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reredis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phan Trung Kien