Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 40 lines (27 sloc) 1.022 kb
c5f0f86 @mcansky v0.0.2 adding a JournalEntry class
authored
1 # Journal
f0ec2a6 @mcansky v0.0.1 of Journal Gem
authored
2
3 This gem is intended to provide an easy way to log activities. It uses Redis as storage, if you want to use a similar thing with CouchDB or MongoDB or anyother DB please create a separate Gem for that.
4
c5f0f86 @mcansky v0.0.2 adding a JournalEntry class
authored
5 ## How to use
f0ec2a6 @mcansky v0.0.1 of Journal Gem
authored
6
7 Put the following line into your Gemfile
8
9 ```
10 gem "journal"
11 ```
12
13 Then create an initializer or some other file loaded by your app and put the following config in it (with proper values) :
14
15 ```Ruby
16 Journal.setup do |config|
17 config.host = ""
18 config.port = ""
19 config.expiry = 604800
20 config.password = ""
21 end
22 ```
c5f0f86 @mcansky v0.0.2 adding a JournalEntry class
authored
23
24
25 ## how to call
26
27 To create an new entry you just have to call the Journal.log method passing the data you want and a key :
28
29 ```
30 Journal.log("oh", "some data")
31 ```
32
33 You can then retrieve a JournalEntry object using the Journal.last method :
34
35 ```
36 a = Journal.last("oh")
37 a.inspect
38 # #<JournalEntry:0x007f980c8dacd8 @key="awesome+key", @data="some data@1337007458", @timestamp="1337007458", @date=#<DateTime: 2012-05-14T16:57:38+02:00 ((2456062j,53858s,0n),+7200s,2299161j)>
39 ```
Something went wrong with that request. Please try again.