eotb 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +22 -19
- data/VERSION +1 -1
- data/eotb.gemspec +2 -2
- data/lib/eotb.rb +11 -11
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -8,26 +8,26 @@ Rails plugin which allow you easily track and observe your apps.
|
|
8
8
|
|
9
9
|
Install gem in traditional way
|
10
10
|
|
11
|
-
|
11
|
+
$ gem install eotb
|
12
12
|
|
13
13
|
=== GitHub
|
14
14
|
|
15
15
|
Install gem from GitHub repository
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
$ git clone git://github.com/Quirke/eotb_rails_plugin.git
|
18
|
+
$ cd eotb_rails_plugin
|
19
|
+
$ rake build
|
20
|
+
$ gem install ./pkg/eotb-0.4.2.gem
|
21
21
|
|
22
22
|
=== Bundler
|
23
23
|
|
24
24
|
Add this line to Gemfile in your rails application
|
25
25
|
|
26
|
-
|
26
|
+
gem 'eotb'
|
27
27
|
|
28
28
|
And run
|
29
29
|
|
30
|
-
|
30
|
+
$ bundle install
|
31
31
|
|
32
32
|
== Getting API Key
|
33
33
|
|
@@ -38,31 +38,34 @@ As a result you will get API Key of your application.
|
|
38
38
|
|
39
39
|
Add file <tt>eotb.rb</tt> in directory <tt>config/initializers</tt> of your rails application with content:
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
require 'Eotb'
|
42
|
+
Eotb.configure("your_api_key", "host", "port") # default host and port are 127.0.0.1 and 3000
|
43
43
|
|
44
44
|
Register events by:
|
45
45
|
|
46
|
-
|
46
|
+
Eotb.register_event("user", "did_sth", {:username => "John", :time => "12:39:00"}) # actor, action, subject
|
47
47
|
|
48
48
|
=== Examples
|
49
49
|
|
50
50
|
Register actor and his action
|
51
|
-
|
52
|
-
Eotb.register_event("user", "registered")
|
53
51
|
|
54
|
-
|
52
|
+
Eotb.register_event("user", "registered")
|
55
53
|
|
56
|
-
|
54
|
+
Register subject of event
|
57
55
|
|
58
|
-
|
56
|
+
Eotb.register_event("user", "registered", {:username => "John", :when => "today"})
|
59
57
|
|
60
|
-
|
58
|
+
Use symbols instead of strings
|
61
59
|
|
62
|
-
|
60
|
+
Eotb.register_event(:admin, :deleted, {:what => "News", :category => "Ruby"})
|
63
61
|
|
64
|
-
|
65
|
-
|
62
|
+
Register hashes and nested hashes
|
63
|
+
|
64
|
+
Eotb.register_event({:username => "John", :mail => "john@example.com"}, :connected, {:with_values => {:a => 20, :b => 30}, :when => "Now"})
|
65
|
+
|
66
|
+
You can register any type of objects
|
67
|
+
|
68
|
+
Eotb.register_event(Object.new, :fed, {:pet => Dog.new})
|
66
69
|
|
67
70
|
== Copyright
|
68
71
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
data/eotb.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{eotb}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ragnarson"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-19}
|
13
13
|
s.description = %q{Rails plugin which allow you easily track and observe your apps}
|
14
14
|
s.email = %q{bartlomiej.kozal@ragnarson.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/eotb.rb
CHANGED
@@ -18,17 +18,17 @@ class Eotb
|
|
18
18
|
Net::HTTP.new(@@uri.host, @@uri.port).start.request(@@post)
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.value_format(
|
22
|
-
if
|
23
|
-
|
24
|
-
elsif
|
25
|
-
|
26
|
-
elsif
|
27
|
-
|
28
|
-
elsif
|
29
|
-
|
21
|
+
def self.value_format(value)
|
22
|
+
if value.respond_to? :to_actor
|
23
|
+
value.to_actor
|
24
|
+
elsif value.respond_to? :to_subject
|
25
|
+
value.to_subject
|
26
|
+
elsif value.respond_to? :to_json
|
27
|
+
value.to_json
|
28
|
+
elsif value.respond_to? :to_hash
|
29
|
+
value.to_hash
|
30
30
|
else
|
31
|
-
|
31
|
+
value.inspect
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -56,7 +56,7 @@ class Eotb
|
|
56
56
|
else
|
57
57
|
a = "\"event[#{type}]\" => #{value_format(hash)}"
|
58
58
|
end
|
59
|
-
eval
|
59
|
+
eval('{' + a.to_s + '}')
|
60
60
|
end
|
61
61
|
|
62
62
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eotb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 3
|
10
|
+
version: 0.4.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ragnarson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-19 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|