honesty 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +35 -32
- data/lib/version.rb +1 -1
- metadata +7 -7
data/README.rdoc
CHANGED
@@ -1,56 +1,59 @@
|
|
1
|
-
Honesty
|
2
|
-
=================
|
1
|
+
= Honesty
|
3
2
|
|
4
3
|
Honesty allows developers to store and track user activities and system events in
|
5
4
|
a human-readable, easily-searchable format.
|
6
5
|
|
7
|
-
==
|
6
|
+
== Installation
|
8
7
|
|
9
|
-
|
8
|
+
=== Get the gem
|
10
9
|
|
11
|
-
|
12
|
-
* If using bundler:
|
13
|
-
** Add "gem 'honesty'" to your Gemfile
|
14
|
-
** "bundle install"
|
10
|
+
Add Honesty to your Gemfile:
|
15
11
|
|
16
|
-
|
17
|
-
|
12
|
+
gem 'honesty'
|
13
|
+
|
14
|
+
=== Generate the model
|
15
|
+
|
16
|
+
Rails 3:
|
17
|
+
|
18
|
+
rails g honesty
|
18
19
|
|
19
|
-
|
20
|
-
|
20
|
+
Rails 2:
|
21
|
+
|
22
|
+
script/generate honesty
|
21
23
|
|
22
24
|
Migrate:
|
23
|
-
|
25
|
+
|
26
|
+
rake db:migrate
|
24
27
|
|
25
28
|
== Usage
|
26
29
|
|
27
|
-
|
30
|
+
=== Use Honesty in your ActiveRecord model:
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
class Shoe < ActiveRecord::Base
|
33
|
+
honesty
|
34
|
+
end
|
35
|
+
|
36
|
+
=== Add a fact to a model instance:
|
34
37
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
38
|
+
Parameters:
|
39
|
+
* Context - the object being acted on or the entity being tracked.
|
40
|
+
* Agent - the actor, so to speak.
|
41
|
+
* Action - the action taking place.
|
39
42
|
|
40
|
-
|
41
|
-
shoe.fact("Shoe", "Tim Boisvert", "Created Adidas Superstar II")
|
43
|
+
If you want to explicitly denote the context, pass all three parameters
|
42
44
|
|
43
|
-
|
45
|
+
shoe = Shoe.create
|
46
|
+
shoe.fact("Shoe", "Tim Boisvert", "Created Adidas Superstar II")
|
44
47
|
|
45
|
-
|
46
|
-
shoe.fact("Tim Boisvert", "Created Adidas Superstar II")
|
48
|
+
If you want to short-cut the fact and use the object's class name as the context, just pass in the agent and the action
|
47
49
|
|
48
|
-
|
50
|
+
shoe = Shoe.create
|
51
|
+
shoe.fact("Tim Boisvert", "Created Adidas Superstar II")
|
49
52
|
|
50
|
-
|
53
|
+
=== Get facts
|
51
54
|
|
52
|
-
|
53
|
-
|
55
|
+
shoe = Shoe.find(1)
|
56
|
+
facts = shoe.facts.all
|
54
57
|
|
55
58
|
== Credits
|
56
59
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honesty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-24 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &19185720 !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: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *19185720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sqlite3
|
27
|
-
requirement: &
|
27
|
+
requirement: &19185040 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *19185040
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &19184620 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *19184620
|
47
47
|
description: Store and track user activities and system events in a human-readable,
|
48
48
|
easily-searchable format
|
49
49
|
email: boisvert@gmail.com
|