journal 0.0.6 → 0.0.7
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/.rvmrc +1 -1
- data/Gemfile.lock +1 -1
- data/journal.gemspec +2 -2
- data/lib/journal/handler.rb +4 -0
- data/lib/journal/version.rb +1 -1
- data/spec/journal_spec.rb +12 -0
- metadata +7 -7
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use ruby-1.9.
|
1
|
+
rvm use ruby-1.9.2@journal --create
|
data/Gemfile.lock
CHANGED
data/journal.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'journal'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.date = '2012-
|
3
|
+
s.version = '0.0.7'
|
4
|
+
s.date = '2012-06-11'
|
5
5
|
s.summary = "Journal!"
|
6
6
|
s.description = "Simple way to log activity on an object using a redis db"
|
7
7
|
s.authors = [ "Thomas Riboulet"]
|
data/lib/journal/handler.rb
CHANGED
data/lib/journal/version.rb
CHANGED
data/spec/journal_spec.rb
CHANGED
@@ -136,6 +136,18 @@ describe Journal do
|
|
136
136
|
Journal.last(key,10).first.class.should eql JournalEntry
|
137
137
|
end
|
138
138
|
|
139
|
+
it "Test removing old entries" do
|
140
|
+
key = "awesome+key"
|
141
|
+
data = "created object num 42"
|
142
|
+
timestamp = Time.now.to_i
|
143
|
+
Journal.log(key, data, timestamp)
|
144
|
+
Journal.log(key, data, timestamp + 10)
|
145
|
+
Journal.log(key, data, timestamp + 20)
|
146
|
+
Journal.purge(key, timestamp + 15)
|
147
|
+
Journal.last(key,10).count.should eql 1
|
148
|
+
Journal.last(key,10).first.data.split('@').first.should eql JournalEntry.new(key, "#{data}@#{timestamp}").data.split('@').first
|
149
|
+
end
|
150
|
+
|
139
151
|
end
|
140
152
|
|
141
153
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: journal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-11 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|
16
|
-
requirement: &
|
16
|
+
requirement: &70179725160240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70179725160240
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70179725159720 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '2.7'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70179725159720
|
36
36
|
description: Simple way to log activity on an object using a redis db
|
37
37
|
email: riboulet@gmail.com
|
38
38
|
executables: []
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.8.
|
81
|
+
rubygems_version: 1.8.10
|
82
82
|
signing_key:
|
83
83
|
specification_version: 3
|
84
84
|
summary: Journal!
|