eotb 0.4.3 → 0.4.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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/eotb.gemspec +2 -2
  3. data/lib/eotb.rb +3 -11
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.3
1
+ 0.4.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.4.3"
8
+ s.version = "0.4.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-07-19}
12
+ s.date = %q{2010-07-20}
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 = [
data/lib/eotb.rb CHANGED
@@ -5,6 +5,8 @@ require 'json'
5
5
 
6
6
  class Eotb
7
7
 
8
+ METHODS = [:to_actor, :to_subject, :to_json, :to_hash, :inspect]
9
+
8
10
  def self.configure(api_key, host = '127.0.0.1', port = '3000')
9
11
  @@uri = URI.parse('http://' + host + ':' + port + '/apps/' + api_key + '/events')
10
12
  @@post = Net::HTTP::Post.new(@@uri.path)
@@ -19,17 +21,7 @@ class Eotb
19
21
  end
20
22
 
21
23
  def self.value_format(value)
22
- if value.respond_to? :to_actor
23
- value.to_actor
24
- elsif value.respond_to? :to_subject
25
- value.to_subject
26
- elsif value.respond_to? :to_json
27
- value.to_json
28
- elsif value.respond_to? :to_hash
29
- value.to_hash
30
- else
31
- value.inspect
32
- end
24
+ value.send METHODS.find { |m| m if value.respond_to? m }
33
25
  end
34
26
 
35
27
  def self.hash_flatten(hash)
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: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 3
10
- version: 0.4.3
9
+ - 4
10
+ version: 0.4.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-07-19 00:00:00 +02:00
18
+ date: 2010-07-20 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency