eotb 0.4.4 → 0.4.5
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/Gemfile +2 -1
- data/Gemfile.lock +28 -20
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/eotb.gemspec +5 -2
- data/lib/eotb.rb +18 -8
- data/spec/eotb_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -2
- metadata +20 -4
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,15 +1,32 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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"
|
6
19
|
specs:
|
7
|
-
-
|
8
|
-
version:
|
20
|
+
- activesupport:
|
21
|
+
version: 2.3.8
|
9
22
|
- gemcutter:
|
10
|
-
version: 0.
|
23
|
+
version: 0.6.1
|
11
24
|
- git:
|
12
25
|
version: 1.2.5
|
26
|
+
- hoptoad_notifier:
|
27
|
+
version: 2.3.2
|
28
|
+
- json_pure:
|
29
|
+
version: 1.4.3
|
13
30
|
- rubyforge:
|
14
31
|
version: 2.0.4
|
15
32
|
- jeweler:
|
@@ -18,16 +35,7 @@ specs:
|
|
18
35
|
version: 1.4.3
|
19
36
|
- rspec:
|
20
37
|
version: 1.3.0
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- :default
|
26
|
-
json:
|
27
|
-
version: ">= 1.4.3"
|
28
|
-
group:
|
29
|
-
- :default
|
30
|
-
rspec:
|
31
|
-
version: ">= 1.3.0"
|
32
|
-
group:
|
33
|
-
- :default
|
38
|
+
hash: 489f72bcf927655f3b5fdc56b1fa93742e792bf5
|
39
|
+
sources:
|
40
|
+
- Rubygems:
|
41
|
+
uri: http://gemcutter.org
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.5
|
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.5"
|
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-21}
|
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 = [
|
@@ -48,15 +48,18 @@ Gem::Specification.new do |s|
|
|
48
48
|
s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
|
49
49
|
s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
|
50
50
|
s.add_runtime_dependency(%q<json>, [">= 1.4.3"])
|
51
|
+
s.add_runtime_dependency(%q<hoptoad_notifier>, [">= 2.3.2"])
|
51
52
|
else
|
52
53
|
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
53
54
|
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
54
55
|
s.add_dependency(%q<json>, [">= 1.4.3"])
|
56
|
+
s.add_dependency(%q<hoptoad_notifier>, [">= 2.3.2"])
|
55
57
|
end
|
56
58
|
else
|
57
59
|
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
58
60
|
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
59
61
|
s.add_dependency(%q<json>, [">= 1.4.3"])
|
62
|
+
s.add_dependency(%q<hoptoad_notifier>, [">= 2.3.2"])
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
data/lib/eotb.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'net/http'
|
3
|
+
require 'timeout'
|
3
4
|
require 'uri'
|
4
5
|
require 'json'
|
6
|
+
require 'hoptoad_notifier'
|
7
|
+
|
8
|
+
HoptoadNotifier.configure { |config| config.api_key='f625b37e34b6084e4a2eae85e6de954f' }
|
5
9
|
|
6
10
|
class Eotb
|
7
|
-
|
11
|
+
|
8
12
|
METHODS = [:to_actor, :to_subject, :to_json, :to_hash, :inspect]
|
9
13
|
|
10
14
|
def self.configure(api_key, host = '127.0.0.1', port = '3000')
|
@@ -17,7 +21,14 @@ class Eotb
|
|
17
21
|
action = { "event[action]" => action.to_s }
|
18
22
|
event = @@api_key.merge(hash_format(actor, :actor)).merge(action).merge(hash_format(subject, :subject))
|
19
23
|
@@post.set_form_data(event)
|
20
|
-
|
24
|
+
begin
|
25
|
+
Timeout::timeout(2) {
|
26
|
+
Net::HTTP.new(@@uri.host, @@uri.port).start.request(@@post)
|
27
|
+
}
|
28
|
+
rescue => e
|
29
|
+
puts "TIMEOUT"
|
30
|
+
HoptoadNotifier.notify(e)
|
31
|
+
end
|
21
32
|
end
|
22
33
|
|
23
34
|
def self.value_format(value)
|
@@ -40,15 +51,14 @@ class Eotb
|
|
40
51
|
|
41
52
|
def self.hash_format(hash, type)
|
42
53
|
if hash.is_a?(Hash)
|
43
|
-
|
54
|
+
h = hash_flatten(hash).map do |k, v|
|
44
55
|
key = k.map{ |e| "[#{e}]" }.join
|
45
56
|
"\"event[#{type}]#{key}\" => #{value_format(v)}"
|
46
|
-
end
|
47
|
-
a.join(', ')
|
57
|
+
end.join(', ')
|
48
58
|
else
|
49
|
-
|
59
|
+
h = "\"event[#{type}]\" => #{value_format(hash)}"
|
50
60
|
end
|
51
|
-
eval
|
61
|
+
eval "{#{h.to_s}}"
|
52
62
|
end
|
53
63
|
|
54
|
-
end
|
64
|
+
end
|
data/spec/eotb_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
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: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 5
|
10
|
+
version: 0.4.5
|
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-21 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -66,6 +66,22 @@ dependencies:
|
|
66
66
|
version: 1.4.3
|
67
67
|
type: :runtime
|
68
68
|
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: hoptoad_notifier
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 7
|
78
|
+
segments:
|
79
|
+
- 2
|
80
|
+
- 3
|
81
|
+
- 2
|
82
|
+
version: 2.3.2
|
83
|
+
type: :runtime
|
84
|
+
version_requirements: *id004
|
69
85
|
description: Rails plugin which allow you easily track and observe your apps
|
70
86
|
email: bartlomiej.kozal@ragnarson.com
|
71
87
|
executables: []
|