eotb 0.1.3 → 0.1.4
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/.gitignore +2 -1
- data/Gemfile +1 -1
- data/README +14 -4
- data/VERSION +1 -1
- data/eotb.gemspec +4 -5
- data/{rails/init.rb → init.rb} +0 -0
- data/lib/eotb.rb +9 -5
- metadata +5 -6
- data/.bundle/config +0 -2
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README
CHANGED
|
@@ -4,11 +4,18 @@ Rails plugin which allow you easily track and observe your apps.
|
|
|
4
4
|
|
|
5
5
|
Installation
|
|
6
6
|
------------------
|
|
7
|
-
Install gem in traditional way:
|
|
7
|
+
* Install gem in traditional way:
|
|
8
8
|
|
|
9
9
|
$ gem install eotb
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
* Install gem from GitHub repository:
|
|
12
|
+
|
|
13
|
+
$ git clone git://github.com/Quirke/eotb_rails_plugin.git
|
|
14
|
+
$ cd eotb_rails_plugin
|
|
15
|
+
$ rake build
|
|
16
|
+
$ gem install ./pkg/eotb-0.1.3.gem
|
|
17
|
+
|
|
18
|
+
* Add this line to Gemfile in your rails application:
|
|
12
19
|
|
|
13
20
|
gem 'eotb'
|
|
14
21
|
|
|
@@ -25,8 +32,11 @@ Using in your apps
|
|
|
25
32
|
------------------
|
|
26
33
|
Add file eotb.rb in directory config/initializers of your rails application with content:
|
|
27
34
|
|
|
28
|
-
Eotb.configure("
|
|
29
|
-
|
|
35
|
+
Eotb.configure("your_api_key", "host", "port") # default host and port are 127.0.0.1 and 3000
|
|
36
|
+
|
|
37
|
+
Register events by:
|
|
38
|
+
|
|
39
|
+
Eotb.register_event("user", "did_sth", {:username => "John", :time => "12:39:00"}) # Eotb.register_event(actor, action, subject)
|
|
30
40
|
|
|
31
41
|
Copyright
|
|
32
42
|
=========
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.4
|
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.1.
|
|
8
|
+
s.version = "0.1.4"
|
|
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-06-
|
|
12
|
+
s.date = %q{2010-06-30}
|
|
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 = [
|
|
@@ -17,8 +17,7 @@ Gem::Specification.new do |s|
|
|
|
17
17
|
"README"
|
|
18
18
|
]
|
|
19
19
|
s.files = [
|
|
20
|
-
".
|
|
21
|
-
".document",
|
|
20
|
+
".document",
|
|
22
21
|
".gitignore",
|
|
23
22
|
"Gemfile",
|
|
24
23
|
"LICENSE",
|
|
@@ -26,8 +25,8 @@ Gem::Specification.new do |s|
|
|
|
26
25
|
"Rakefile",
|
|
27
26
|
"VERSION",
|
|
28
27
|
"eotb.gemspec",
|
|
28
|
+
"init.rb",
|
|
29
29
|
"lib/eotb.rb",
|
|
30
|
-
"rails/init.rb",
|
|
31
30
|
"spec/eotb_spec.rb",
|
|
32
31
|
"spec/spec_helper.rb"
|
|
33
32
|
]
|
data/{rails/init.rb → init.rb}
RENAMED
|
File without changes
|
data/lib/eotb.rb
CHANGED
|
@@ -11,13 +11,17 @@ class Eotb
|
|
|
11
11
|
@@api_key = api_key
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def to_json(array)
|
|
15
|
-
JSON.generate(array)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
14
|
def self.register_event(actor, action, subject)
|
|
19
|
-
|
|
15
|
+
to_post = { "event[app_id]" => @@api_key, "event[actor][type]" => actor, "event[action]" => action }
|
|
16
|
+
subject.each do |key, value|
|
|
17
|
+
to_post["event[subject][#{key.to_s}]"] = value.to_s
|
|
18
|
+
end
|
|
19
|
+
@@http.set_form_data(to_post)
|
|
20
20
|
Net::HTTP.new(@@uri.host, @@uri.port).start { |http| http.request(@@http) }
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
def to_json(array)
|
|
24
|
+
JSON.generate(array)
|
|
25
|
+
end
|
|
26
|
+
|
|
23
27
|
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: 19
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 1
|
|
9
|
-
-
|
|
10
|
-
version: 0.1.
|
|
9
|
+
- 4
|
|
10
|
+
version: 0.1.4
|
|
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-06-
|
|
18
|
+
date: 2010-06-30 00:00:00 +02:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
@@ -60,7 +60,6 @@ extra_rdoc_files:
|
|
|
60
60
|
- LICENSE
|
|
61
61
|
- README
|
|
62
62
|
files:
|
|
63
|
-
- .bundle/config
|
|
64
63
|
- .document
|
|
65
64
|
- .gitignore
|
|
66
65
|
- Gemfile
|
|
@@ -69,8 +68,8 @@ files:
|
|
|
69
68
|
- Rakefile
|
|
70
69
|
- VERSION
|
|
71
70
|
- eotb.gemspec
|
|
71
|
+
- init.rb
|
|
72
72
|
- lib/eotb.rb
|
|
73
|
-
- rails/init.rb
|
|
74
73
|
- spec/eotb_spec.rb
|
|
75
74
|
- spec/spec_helper.rb
|
|
76
75
|
has_rdoc: true
|
data/.bundle/config
DELETED