redness 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source :rubygems
2
2
 
3
+ gem "rake"
3
4
  gem "json"
4
5
  gem "rspec"
5
6
  gem "redis", "~> 2.2.2"
@@ -8,6 +8,7 @@ GEM
8
8
  i18n (0.6.0)
9
9
  json (1.6.6)
10
10
  multi_json (1.3.2)
11
+ rake (0.9.2.2)
11
12
  redis (2.2.2)
12
13
  rspec (2.9.0)
13
14
  rspec-core (~> 2.9.0)
@@ -25,6 +26,7 @@ PLATFORMS
25
26
  DEPENDENCIES
26
27
  activesupport
27
28
  json
29
+ rake
28
30
  redis (~> 2.2.2)
29
31
  rspec
30
32
  timecop
data/README.md CHANGED
@@ -14,8 +14,6 @@ to Redis than the client library while remaining more composable and minimal tha
14
14
 
15
15
  ### Playing Around (read the tests for more examples)
16
16
  ```ruby
17
- require 'redis'
18
- require 'json'
19
17
  require 'redness'
20
18
 
21
19
  $redis = Redis.new
@@ -121,6 +119,19 @@ to Redis than the client library while remaining more composable and minimal tha
121
119
  union.get
122
120
  #=> [7,3,6,2,9,1]
123
121
 
122
+ # TimedRedSet is a RedSet with timestamped data
123
+ TimedRedSet.add("somekey", 1)
124
+ TimedRedSet.add("somekey", 2)
125
+
126
+ TimedRedSet.get("somekey")
127
+ #=> [2, 1]
128
+
129
+ TimedRedSet.get_with_timestamps("somekey")
130
+ #=> [[2, 2012-05-04 14:29:57 -0400], [1, 2012-05-04 14:29:48 -0400]]
131
+
132
+ TimedRedSet.since("somekey", 5.minutes.ago, lower: 1, upper: 2)
133
+ #=> [1]
134
+
124
135
  # RedExpire expires the collection with the
125
136
  # provided key in a given number of seconds
126
137
  RedList.new("somelist")
@@ -1,3 +1,7 @@
1
+ require "json" unless defined?(JSON)
2
+ require "redis" unless defined?(Redis)
3
+ require "active_support/core_ext" unless defined?(ActiveSupport)
4
+
1
5
  require "precisionable"
2
6
 
3
7
  require "redness/red"
@@ -1,4 +1,4 @@
1
1
  module Redness
2
- VERSION="0.0.4"
2
+ VERSION="0.0.5"
3
3
  MAJOR, MINOR, TINY = VERSION.split(".")
4
4
  end
@@ -7,8 +7,6 @@ require 'active_support/core_ext'
7
7
  require 'timecop'
8
8
 
9
9
  require 'redis_runner'
10
- require 'precisionable'
11
-
12
10
  require 'redness'
13
11
 
14
12
  RSpec.configure do |config|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,7 +18,7 @@ date: 2012-05-04 00:00:00.000000000Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: json
21
- requirement: &70214144946880 !ruby/object:Gem::Requirement
21
+ requirement: &70095839355840 !ruby/object:Gem::Requirement
22
22
  none: false
23
23
  requirements:
24
24
  - - ! '>='
@@ -26,10 +26,10 @@ dependencies:
26
26
  version: '0'
27
27
  type: :runtime
28
28
  prerelease: false
29
- version_requirements: *70214144946880
29
+ version_requirements: *70095839355840
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rspec
32
- requirement: &70214144946460 !ruby/object:Gem::Requirement
32
+ requirement: &70095839355420 !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
35
  - - ! '>='
@@ -37,10 +37,10 @@ dependencies:
37
37
  version: '0'
38
38
  type: :runtime
39
39
  prerelease: false
40
- version_requirements: *70214144946460
40
+ version_requirements: *70095839355420
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: redis
43
- requirement: &70214144945960 !ruby/object:Gem::Requirement
43
+ requirement: &70095839354920 !ruby/object:Gem::Requirement
44
44
  none: false
45
45
  requirements:
46
46
  - - ~>
@@ -48,10 +48,10 @@ dependencies:
48
48
  version: 2.2.2
49
49
  type: :runtime
50
50
  prerelease: false
51
- version_requirements: *70214144945960
51
+ version_requirements: *70095839354920
52
52
  - !ruby/object:Gem::Dependency
53
53
  name: activesupport
54
- requirement: &70214144945540 !ruby/object:Gem::Requirement
54
+ requirement: &70095839354500 !ruby/object:Gem::Requirement
55
55
  none: false
56
56
  requirements:
57
57
  - - ! '>='
@@ -59,10 +59,10 @@ dependencies:
59
59
  version: '0'
60
60
  type: :runtime
61
61
  prerelease: false
62
- version_requirements: *70214144945540
62
+ version_requirements: *70095839354500
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: timecop
65
- requirement: &70214144945080 !ruby/object:Gem::Requirement
65
+ requirement: &70095839354040 !ruby/object:Gem::Requirement
66
66
  none: false
67
67
  requirements:
68
68
  - - ! '>='
@@ -70,7 +70,7 @@ dependencies:
70
70
  version: '0'
71
71
  type: :runtime
72
72
  prerelease: false
73
- version_requirements: *70214144945080
73
+ version_requirements: *70095839354040
74
74
  description: Helpful Ruby classes for improved Redis data structures
75
75
  email: dev@howaboutwe.com
76
76
  executables: []