eotb 0.4.6 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -3,4 +3,5 @@ coverage
3
3
  rdoc
4
4
  pkg
5
5
  *.swp
6
- .bundle
6
+ .bundle
7
+ Gemfile.lock
data/README.rdoc CHANGED
@@ -17,7 +17,7 @@ Install gem from GitHub repository
17
17
  $ git clone git://github.com/Quirke/eotb_rails_plugin.git
18
18
  $ cd eotb_rails_plugin
19
19
  $ rake build
20
- $ gem install ./pkg/eotb-0.4.2.gem
20
+ $ gem install ./pkg/eotb-0.5.0.gem
21
21
 
22
22
  === Bundler
23
23
 
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ begin
8
8
  gem.summary = "Rails plugin which allow you easily track and observe your apps"
9
9
  gem.description = "Rails plugin which allow you easily track and observe your apps"
10
10
  gem.email = "bartlomiej.kozal@ragnarson.com"
11
- gem.homepage = "http://github.com/Quirke/eotb_rails_plugin"
11
+ gem.homepage = "http://github.com/placek/eotb_rails_plugin"
12
12
  gem.authors = ["Ragnarson"]
13
13
  gem.add_development_dependency "rspec", ">= 1.3.0"
14
14
  gem.add_development_dependency "jeweler", ">= 1.4.0"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.6
1
+ 0.5.0
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.6"
8
+ s.version = "0.5.0"
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-21}
12
+ s.date = %q{2010-07-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 = [
@@ -20,7 +20,6 @@ Gem::Specification.new do |s|
20
20
  ".document",
21
21
  ".gitignore",
22
22
  "Gemfile",
23
- "Gemfile.lock",
24
23
  "LICENSE",
25
24
  "README.rdoc",
26
25
  "Rakefile",
@@ -30,7 +29,7 @@ Gem::Specification.new do |s|
30
29
  "spec/eotb_spec.rb",
31
30
  "spec/spec_helper.rb"
32
31
  ]
33
- s.homepage = %q{http://github.com/Quirke/eotb_rails_plugin}
32
+ s.homepage = %q{http://github.com/placek/eotb_rails_plugin}
34
33
  s.rdoc_options = ["--charset=UTF-8"]
35
34
  s.require_paths = ["lib"]
36
35
  s.rubygems_version = %q{1.3.7}
data/lib/eotb.rb CHANGED
@@ -25,8 +25,8 @@ class Eotb
25
25
  Net::HTTP.new(@@uri.host, @@uri.port).start.request(@@post)
26
26
  }
27
27
  rescue => e
28
- puts "TIMEOUT"
29
- HoptoadNotifier.notify(e)
28
+ logger = Logger.new("log/#{ENV['RAILS_ENV']}.log")
29
+ logger.error "ERROR eotb gem: " + e\
30
30
  end
31
31
  end
32
32
 
data/spec/eotb_spec.rb CHANGED
@@ -2,49 +2,67 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe Eotb do
4
4
 
5
- before(:all) do
6
- @response = "200"
7
- Eotb.configure("0"*40)
8
- end
9
-
10
- it "should format actor in string" do
11
- Eotb.hash_format("actor", :actor).should == {"event[actor]" => "actor"}
12
- end
13
-
14
- it "should format actor in hash" do
15
- Eotb.hash_format({:type => "User"}, :actor).should == {"event[actor][type]" => "User"}
16
- end
17
-
18
- it "should format actor in nested hash" do
19
- Eotb.hash_format({:type => { :account => "User"}}, :actor).should == {"event[actor][type][account]" => "User"}
20
- end
21
-
22
- it "should register two arguments" do
23
- Eotb.register_event("actor", "action").code.should == @response
24
- end
25
-
26
- it "should register three arguments" do
27
- Eotb.register_event("actor", "action", {:username => "John"}).code.should == @response
28
- end
29
-
30
- it "should register symbols" do
31
- Eotb.register_event(:actor, :action, {:username => "John"}).code.should == @response
32
- end
33
-
34
- it "should register objects" do
35
- Eotb.register_event(Object.new, :action, {:username => Object.new}).code.should == @response
36
- end
5
+ describe "shoud format objects" do
6
+
7
+ it "should format actor in string" do
8
+ Eotb.hash_format("actor", :actor).should == {"event[actor]" => "actor"}
9
+ end
37
10
 
38
- it "should register hashes" do
39
- Eotb.register_event({:type => "User"}, :action, {:username => {:first_name => "John"}}).code.should == @response
40
- end
41
-
42
- it "should register nested hashes" do
43
- Eotb.register_event({:type => { :account => "User"}}, :action, {:username => {:first_name => "John"}}).code.should == @response
11
+ it "should format actor in hash" do
12
+ Eotb.hash_format({:type => "User"}, :actor).should == {"event[actor][type]" => "User"}
13
+ end
14
+
15
+ it "should format actor in nested hash" do
16
+ Eotb.hash_format({:type => { :account => "User"}}, :actor).should == {"event[actor][type][account]" => "User"}
17
+ end
18
+
44
19
  end
45
20
 
46
- it "should register arrays" do
47
- Eotb.register_event([2,3,4], :action, {:username => ["John", "Josh"]}).code.should == @response
21
+ describe "should register data" do
22
+
23
+ before(:each) do
24
+ @response = "200"
25
+ Eotb.configure("0"*40)
26
+ Net::HTTP.stub(:new) { Net::HTTP }
27
+ Net::HTTP.stub(:start) { Net::HTTP }
28
+ Net::HTTP.stub(:request) { "200" }
29
+ end
30
+
31
+ it "should register two arguments" do
32
+ Eotb.register_event("actor", "action").should == @response
33
+ end
34
+
35
+ it "should register three arguments" do
36
+ Eotb.register_event("actor", "action", {:username => "John"}).should == @response
37
+ end
38
+
39
+ it "should register symbols" do
40
+ Eotb.register_event(:actor, :action, {:username => "John"}).should == @response
41
+ end
42
+
43
+ it "should register objects" do
44
+ Eotb.register_event(Object.new, :action, {:username => Object.new}).should == @response
45
+ end
46
+
47
+ it "should register hashes" do
48
+ Eotb.register_event({:type => "User"}, :action, {:username => {:first_name => "John"}}).should == @response
49
+ end
50
+
51
+ it "should register nested hashes" do
52
+ Eotb.register_event({:type => { :account => "User"}}, :action, {:username => {:first_name => "John"}}).should == @response
53
+ end
54
+
55
+ it "should register arrays" do
56
+ Eotb.register_event([2,3,4], :action, {:username => ["John", "Josh"]}).should == @response
57
+ end
58
+
59
+ it "should log errors" do
60
+ logger = mock(Logger)
61
+ logger.stub(:new) { logger }
62
+ logger.stub(:error) { @response }
63
+ Eotb.register_event(:actor, :action, {:username => "John"}).should == @response
64
+ end
65
+
48
66
  end
49
67
 
50
68
  end
data/spec/spec_helper.rb CHANGED
@@ -4,5 +4,5 @@ require 'eotb'
4
4
  require 'spec'
5
5
  require 'spec/autorun'
6
6
  Spec::Runner.configure do |config|
7
-
7
+
8
8
  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: 3
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 4
9
- - 6
10
- version: 0.4.6
8
+ - 5
9
+ - 0
10
+ version: 0.5.0
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-21 00:00:00 +02:00
18
+ date: 2010-07-30 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -95,7 +95,6 @@ files:
95
95
  - .document
96
96
  - .gitignore
97
97
  - Gemfile
98
- - Gemfile.lock
99
98
  - LICENSE
100
99
  - README.rdoc
101
100
  - Rakefile
@@ -105,7 +104,7 @@ files:
105
104
  - spec/eotb_spec.rb
106
105
  - spec/spec_helper.rb
107
106
  has_rdoc: true
108
- homepage: http://github.com/Quirke/eotb_rails_plugin
107
+ homepage: http://github.com/placek/eotb_rails_plugin
109
108
  licenses: []
110
109
 
111
110
  post_install_message:
data/Gemfile.lock DELETED
@@ -1,41 +0,0 @@
1
- ---
2
- dependencies:
3
- rspec:
4
- group:
5
- - :default
6
- version: ">= 1.3.0"
7
- json:
8
- group:
9
- - :default
10
- version: ">= 1.4.3"
11
- jeweler:
12
- group:
13
- - :default
14
- version: ">= 1.4.0"
15
- hoptoad_notifier:
16
- group:
17
- - :default
18
- version: ">= 0"
19
- specs:
20
- - activesupport:
21
- version: 2.3.8
22
- - gemcutter:
23
- version: 0.6.1
24
- - git:
25
- version: 1.2.5
26
- - hoptoad_notifier:
27
- version: 2.3.2
28
- - json_pure:
29
- version: 1.4.3
30
- - rubyforge:
31
- version: 2.0.4
32
- - jeweler:
33
- version: 1.4.0
34
- - json:
35
- version: 1.4.3
36
- - rspec:
37
- version: 1.3.0
38
- hash: 489f72bcf927655f3b5fdc56b1fa93742e792bf5
39
- sources:
40
- - Rubygems:
41
- uri: http://gemcutter.org