eotb 0.0.1 → 0.0.2

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/.bundle/config ADDED
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_WITHOUT: ""
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gem "json", ">= 1.4.3"
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 = ["Bartlomiej Kozal", "Pawel Placzynski", "Justyna Post", "Sebastian Wojtczak"]
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
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.1"
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 = ["Bartlomiej Kozal", "Pawel Placzynski", "Justyna Post", "Sebastian Wojtczak"]
12
- s.date = %q{2010-06-21}
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.rdoc"
17
+ "README"
18
18
  ]
19
19
  s.files = [
20
- ".document",
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(@array)
12
+ def to_json(array = @array)
13
+ JSON.generate(array)
11
14
  end
12
15
 
13
- def register_event(actor = :user, action = :no_action, subject = {})
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
- before :each do
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
- before :each do
16
- @register_event = @eotb.register_event
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
- it "should be an array" do
20
- @register_event.should be_a(Array)
21
- end
12
+ end
13
+
14
+ context "connection with app" do
22
15
 
23
- it "should have three items" do
24
- @register_event.should have(3).items
25
- end
16
+ it "should set connection"
26
17
 
27
- it "last argument should be a hash" do
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
@@ -3,6 +3,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'eotb'
4
4
  require 'spec'
5
5
  require 'spec/autorun'
6
+ require 'json'
6
7
 
7
8
  Spec::Runner.configure do |config|
8
9
 
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
- - Bartlomiej Kozal
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-21 00:00:00 +02:00
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.rdoc
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.