eotb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.bundle/config +2 -0
- data/Gemfile +2 -0
- data/README +17 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/eotb.gemspec +7 -6
- data/lib/eotb.rb +9 -4
- data/spec/eotb_spec.rb +9 -20
- data/spec/spec_helper.rb +1 -0
- metadata +9 -10
- data/README.rdoc +0 -17
data/.bundle/config
ADDED
data/Gemfile
ADDED
data/README
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
EotB Gem
|
2
|
+
========
|
3
|
+
Rails plugin which allow you easily track and observe your apps.
|
4
|
+
|
5
|
+
Installation
|
6
|
+
------------
|
7
|
+
$ gem install eotb
|
8
|
+
|
9
|
+
Using in your apps
|
10
|
+
------------------
|
11
|
+
require 'eotb'
|
12
|
+
@eotb = new.Eotb(:api_key)
|
13
|
+
@eotb.register_event(:user, :do_sth, { :user_name => "Vuvuzela" })
|
14
|
+
|
15
|
+
Copyright
|
16
|
+
=========
|
17
|
+
Copyright (c) 2010 Ragnarson. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ begin
|
|
9
9
|
gem.description = "Rails plugin which allow you easily track and observe your apps"
|
10
10
|
gem.email = "bartlomiej.kozal@ragnarson.com"
|
11
11
|
gem.homepage = "http://github.com/Quirke/eotb_rails_plugin"
|
12
|
-
gem.authors = ["
|
12
|
+
gem.authors = ["Ragnarson"]
|
13
13
|
gem.add_development_dependency "rspec", ">= 1.3.0"
|
14
14
|
gem.add_dependency "json", ">= 1.4.3"
|
15
15
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/eotb.gemspec
CHANGED
@@ -5,22 +5,23 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{eotb}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["
|
12
|
-
s.date = %q{2010-06-
|
11
|
+
s.authors = ["Ragnarson"]
|
12
|
+
s.date = %q{2010-06-22}
|
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 = [
|
16
16
|
"LICENSE",
|
17
|
-
"README
|
17
|
+
"README"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
".
|
20
|
+
".bundle/config",
|
21
|
+
".document",
|
21
22
|
".gitignore",
|
23
|
+
"Gemfile",
|
22
24
|
"LICENSE",
|
23
|
-
"README.rdoc",
|
24
25
|
"Rakefile",
|
25
26
|
"VERSION",
|
26
27
|
"eotb.gemspec",
|
data/lib/eotb.rb
CHANGED
@@ -1,17 +1,22 @@
|
|
1
1
|
require 'json'
|
2
|
+
require 'net/http'
|
2
3
|
|
3
4
|
class Eotb
|
4
5
|
|
5
|
-
def initialize
|
6
|
+
def initialize(api_key, host = '127.0.0.1:3000')
|
7
|
+
@api_key = api_key
|
8
|
+
@host = host
|
6
9
|
@array = []
|
7
10
|
end
|
8
11
|
|
9
|
-
def to_json
|
10
|
-
JSON.generate(
|
12
|
+
def to_json(array = @array)
|
13
|
+
JSON.generate(array)
|
11
14
|
end
|
12
15
|
|
13
|
-
def register_event(actor
|
16
|
+
def register_event(actor, action, subject)
|
14
17
|
@array << actor << action << subject
|
18
|
+
@array.to_json
|
19
|
+
# @array.clear
|
15
20
|
end
|
16
21
|
|
17
22
|
end
|
data/spec/eotb_spec.rb
CHANGED
@@ -2,31 +2,20 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
2
|
|
3
3
|
describe Eotb do
|
4
4
|
|
5
|
-
|
6
|
-
@eotb = Eotb.new
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should have register_event method" do
|
10
|
-
@eotb.methods.should include(:register_event)
|
11
|
-
end
|
12
|
-
|
13
|
-
describe ".register_event" do
|
5
|
+
context "register_event method" do
|
14
6
|
|
15
|
-
|
16
|
-
|
7
|
+
it "should return json" do
|
8
|
+
subject = { :user_id => 10, :user_name => "Noname" }
|
9
|
+
Eotb.new.register_event(:current_user, :bought_membership, subject).should eql JSON.generate([:current_user, :bought_membership, subject])
|
17
10
|
end
|
18
11
|
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
end
|
13
|
+
|
14
|
+
context "connection with app" do
|
22
15
|
|
23
|
-
it "should
|
24
|
-
@register_event.should have(3).items
|
25
|
-
end
|
16
|
+
it "should set connection"
|
26
17
|
|
27
|
-
it "
|
28
|
-
@register_event[2].should be_a(Hash)
|
29
|
-
end
|
18
|
+
it "should send json by POST to app"
|
30
19
|
|
31
20
|
end
|
32
21
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,24 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eotb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
|
-
-
|
14
|
-
- Pawel Placzynski
|
15
|
-
- Justyna Post
|
16
|
-
- Sebastian Wojtczak
|
13
|
+
- Ragnarson
|
17
14
|
autorequire:
|
18
15
|
bindir: bin
|
19
16
|
cert_chain: []
|
20
17
|
|
21
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-22 00:00:00 +02:00
|
22
19
|
default_executable:
|
23
20
|
dependencies:
|
24
21
|
- !ruby/object:Gem::Dependency
|
@@ -61,18 +58,20 @@ extensions: []
|
|
61
58
|
|
62
59
|
extra_rdoc_files:
|
63
60
|
- LICENSE
|
64
|
-
- README
|
61
|
+
- README
|
65
62
|
files:
|
63
|
+
- .bundle/config
|
66
64
|
- .document
|
67
65
|
- .gitignore
|
66
|
+
- Gemfile
|
68
67
|
- LICENSE
|
69
|
-
- README.rdoc
|
70
68
|
- Rakefile
|
71
69
|
- VERSION
|
72
70
|
- eotb.gemspec
|
73
71
|
- lib/eotb.rb
|
74
72
|
- spec/eotb_spec.rb
|
75
73
|
- spec/spec_helper.rb
|
74
|
+
- README
|
76
75
|
has_rdoc: true
|
77
76
|
homepage: http://github.com/Quirke/eotb_rails_plugin
|
78
77
|
licenses: []
|
data/README.rdoc
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
= eotb
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Note on Patches/Pull Requests
|
6
|
-
|
7
|
-
* Fork the project.
|
8
|
-
* Make your feature addition or bug fix.
|
9
|
-
* Add tests for it. This is important so I don't break it in a
|
10
|
-
future version unintentionally.
|
11
|
-
* Commit, do not mess with rakefile, version, or history.
|
12
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
-
* Send me a pull request. Bonus points for topic branches.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2010 Ragnarson. See LICENSE for details.
|