active_redis 0.0.8 → 0.0.9

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: 15b35e41e228279d6ebc16ce99d25115d786074f
4
- data.tar.gz: 150c894dcd3e562549d4ee6a52a005020f262cc5
3
+ metadata.gz: 714e87fed728d64204b22bf03e507a3da63cd670
4
+ data.tar.gz: 6f626a9bc8c1f070b735bdf02e59db2b5a828027
5
5
  SHA512:
6
- metadata.gz: 288bb1c18077d83a21a80d846d520f5a9f0539a31ce9dfeb24c76bf64d4b5c90a9adac9fcb69e601c2c9a2ca43724ad8c6266a9a714eb44301802bff56f7906d
7
- data.tar.gz: fa32af2552935029c263779f957a592fe29763ac7d997ea10a5b2c5ec53e4c755d3f2753f4ea52452939381a9a2044d25d94a5107b15dccd0784de84c08e5827
6
+ metadata.gz: e137faf3d688792a89611ed83e33e32c8565be4f896e7270ed5270288794e95e859504d6a5f49367658327c48a4d6bd2a737bc06d62aca3cbc357695d8c61f6b
7
+ data.tar.gz: 58c1b780aa0e7410b16a034f674c0e30b872c14af4c4eef49943c271f8f86d28211e91b28205d51780182ca9d9c479546de55a90bb24e20d6f7d48e6394ab52f
data/README.md CHANGED
@@ -6,7 +6,7 @@ Small childly ORM for Redis
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'active_redis'
9
+ gem 'active_redis', '0.0.9'
10
10
 
11
11
  And then execute:
12
12
 
data/active_redis.gemspec CHANGED
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "redis"
22
- spec.add_dependency "activesupport"
23
- spec.add_dependency "colorize"
21
+ spec.add_dependency "redis", '3.0.7'
22
+ spec.add_dependency "activesupport", '>= 3.0.0'
23
+ spec.add_dependency "colorize", '0.7.3'
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency "rake"
@@ -25,6 +25,15 @@ module ActiveRedis::ConnectionExt
25
25
  destroy_by_keys fetch_keys(model)
26
26
  end
27
27
 
28
+ def expire_record(model, id, seconds = -1)
29
+ raise ActiveRedis::NotSpecifiedIdError, "Must specified ID for destroy record!" unless id
30
+ if seconds > 0
31
+ adapter.expire model.table_name(id), seconds
32
+ else
33
+ adapter.persist model.table_name(id)
34
+ end
35
+ end
36
+
28
37
  private
29
38
  def destroy_by_keys(keys)
30
39
  adapter.del keys
@@ -33,6 +33,14 @@ module ActiveRedis
33
33
  save
34
34
  end
35
35
 
36
+ def expire(seconds)
37
+ ActiveRedis.connection.expire_record self.class, self.id, seconds
38
+ end
39
+
40
+ def clear_expire
41
+ expire -1
42
+ end
43
+
36
44
  private
37
45
 
38
46
  def fill_attributes
@@ -1,3 +1,3 @@
1
1
  module ActiveRedis
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Gernyak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-26 00:00:00.000000000 Z
11
+ date: 2014-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 3.0.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 3.0.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '>='
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 3.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 3.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: colorize
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.7.3
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 0.7.3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  requirements: []
203
203
  rubyforge_project:
204
- rubygems_version: 2.0.6
204
+ rubygems_version: 2.2.2
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: Small childly ORM for Redis