justlogging-rails 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- justlogging-rails (0.0.5)
4
+ justlogging-rails (0.0.6)
5
5
  rails
6
6
  rake
7
7
  rspec
@@ -9,41 +9,41 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionmailer (3.2.6)
13
- actionpack (= 3.2.6)
12
+ actionmailer (3.2.7)
13
+ actionpack (= 3.2.7)
14
14
  mail (~> 2.4.4)
15
- actionpack (3.2.6)
16
- activemodel (= 3.2.6)
17
- activesupport (= 3.2.6)
15
+ actionpack (3.2.7)
16
+ activemodel (= 3.2.7)
17
+ activesupport (= 3.2.7)
18
18
  builder (~> 3.0.0)
19
19
  erubis (~> 2.7.0)
20
- journey (~> 1.0.1)
20
+ journey (~> 1.0.4)
21
21
  rack (~> 1.4.0)
22
22
  rack-cache (~> 1.2)
23
23
  rack-test (~> 0.6.1)
24
24
  sprockets (~> 2.1.3)
25
- activemodel (3.2.6)
26
- activesupport (= 3.2.6)
25
+ activemodel (3.2.7)
26
+ activesupport (= 3.2.7)
27
27
  builder (~> 3.0.0)
28
- activerecord (3.2.6)
29
- activemodel (= 3.2.6)
30
- activesupport (= 3.2.6)
28
+ activerecord (3.2.7)
29
+ activemodel (= 3.2.7)
30
+ activesupport (= 3.2.7)
31
31
  arel (~> 3.0.2)
32
32
  tzinfo (~> 0.3.29)
33
- activeresource (3.2.6)
34
- activemodel (= 3.2.6)
35
- activesupport (= 3.2.6)
36
- activesupport (3.2.6)
33
+ activeresource (3.2.7)
34
+ activemodel (= 3.2.7)
35
+ activesupport (= 3.2.7)
36
+ activesupport (3.2.7)
37
37
  i18n (~> 0.6)
38
38
  multi_json (~> 1.0)
39
39
  arel (3.0.2)
40
- builder (3.0.0)
40
+ builder (3.0.2)
41
41
  diff-lcs (1.1.3)
42
42
  erubis (2.7.0)
43
43
  hike (1.2.1)
44
- i18n (0.6.0)
44
+ i18n (0.6.1)
45
45
  journey (1.0.4)
46
- json (1.7.3)
46
+ json (1.7.5)
47
47
  mail (2.4.4)
48
48
  i18n (>= 0.4.0)
49
49
  mime-types (~> 1.16)
@@ -58,17 +58,17 @@ GEM
58
58
  rack
59
59
  rack-test (0.6.1)
60
60
  rack (>= 1.0)
61
- rails (3.2.6)
62
- actionmailer (= 3.2.6)
63
- actionpack (= 3.2.6)
64
- activerecord (= 3.2.6)
65
- activeresource (= 3.2.6)
66
- activesupport (= 3.2.6)
61
+ rails (3.2.7)
62
+ actionmailer (= 3.2.7)
63
+ actionpack (= 3.2.7)
64
+ activerecord (= 3.2.7)
65
+ activeresource (= 3.2.7)
66
+ activesupport (= 3.2.7)
67
67
  bundler (~> 1.0)
68
- railties (= 3.2.6)
69
- railties (3.2.6)
70
- actionpack (= 3.2.6)
71
- activesupport (= 3.2.6)
68
+ railties (= 3.2.7)
69
+ railties (3.2.7)
70
+ actionpack (= 3.2.7)
71
+ activesupport (= 3.2.7)
72
72
  rack-ssl (~> 1.3.2)
73
73
  rake (>= 0.8.7)
74
74
  rdoc (~> 3.4)
@@ -76,19 +76,19 @@ GEM
76
76
  rake (0.9.2.2)
77
77
  rdoc (3.12)
78
78
  json (~> 1.4)
79
- rspec (2.10.0)
80
- rspec-core (~> 2.10.0)
81
- rspec-expectations (~> 2.10.0)
82
- rspec-mocks (~> 2.10.0)
83
- rspec-core (2.10.1)
84
- rspec-expectations (2.10.0)
79
+ rspec (2.11.0)
80
+ rspec-core (~> 2.11.0)
81
+ rspec-expectations (~> 2.11.0)
82
+ rspec-mocks (~> 2.11.0)
83
+ rspec-core (2.11.1)
84
+ rspec-expectations (2.11.2)
85
85
  diff-lcs (~> 1.1.3)
86
- rspec-mocks (2.10.1)
86
+ rspec-mocks (2.11.2)
87
87
  sprockets (2.1.3)
88
88
  hike (~> 1.2)
89
89
  rack (~> 1.0)
90
90
  tilt (~> 1.1, != 1.3.0)
91
- thor (0.15.3)
91
+ thor (0.16.0)
92
92
  tilt (1.3.3)
93
93
  treetop (1.4.10)
94
94
  polyglot
@@ -91,7 +91,7 @@ module Justlogging
91
91
  def complete!
92
92
  Thread.current[:justlogging_transaction_id] = nil
93
93
  current_transaction = Justlogging.transactions.delete(@id)
94
- if @events.any? || @exception.present?
94
+ if @events.any? || exception?
95
95
  Justlogging.agent.add_to_queue(current_transaction.to_hash)
96
96
  end
97
97
  end
@@ -27,12 +27,17 @@ module Justlogging
27
27
  end
28
28
 
29
29
  def encoded_message(payload)
30
- message(ActiveSupport::JSON.encode(payload))
30
+ encoded_payload = {}.tap do |hsh|
31
+ payload.each do |key, val|
32
+ hsh[key] = ActiveSupport::JSON.encode(val)
33
+ end
34
+ end
35
+ message(encoded_payload)
31
36
  end
32
37
 
33
- def message(json)
38
+ def message(encoded_hash)
34
39
  Net::HTTP::Post.new(uri.request_uri).tap do |post|
35
- post.set_form_data(json.reverse_merge('api_key' => api_key))
40
+ post.set_form_data(encoded_hash.reverse_merge('api_key' => api_key))
36
41
  end
37
42
  end
38
43
 
@@ -1,3 +1,3 @@
1
1
  module Justlogging
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -34,16 +34,16 @@ describe Justlogging::Transmitter do
34
34
 
35
35
  describe "#encoded_message" do
36
36
  it "calls message" do
37
- ActiveSupport::JSON.stub(:encode => :json)
38
- subject.should_receive(:message).with(:json)
37
+ ActiveSupport::JSON.stub(:encode => "{a:'b'}")
38
+ subject.should_receive(:message).with(:payload => "{a:'b'}")
39
39
  end
40
40
 
41
41
  it "encodes the payload using json" do
42
42
  subject.stub(:message)
43
- ActiveSupport::JSON.should_receive(:encode).with(:payload)
43
+ ActiveSupport::JSON.should_receive(:encode).with({"a"=>"b"})
44
44
  end
45
45
 
46
- after { subject.encoded_message(:payload) }
46
+ after { subject.encoded_message(:payload => {'a' => 'b'}) }
47
47
  end
48
48
 
49
49
  describe "#message" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: justlogging-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: