airbrake-ruby 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b51cb8b53a17fbe261374e06275f714d72dfe4c3
4
- data.tar.gz: f3b407f5473a75890e56dde82fce32a2e13753c9
3
+ metadata.gz: 1d15481adc9973cf21c5302ab3cd3dbb365d4891
4
+ data.tar.gz: 94b9535ca5be9f4a28a75a24548516755cf5945e
5
5
  SHA512:
6
- metadata.gz: 9778f6f6fcd5d027d78bd5b330c490648efe0af2fc9649dc4274d46e91c7eedd8e5fe31698a195f5246cd6113fdabcc4be986f4d1c150ae013a4fdc726d48c97
7
- data.tar.gz: aedd2549376dc458b30511d2160b024f53f77b0836c5df66cd0f73330e5b49d5cbd2dc1f1e4ccc49c89618b392104a432eaf80c1fda6dc799dc2741df216cb9c
6
+ metadata.gz: 2426fc74599daab97fe712b40b1f9d8a3a899ef721cd28091e86aa88a91c8bbd16e727452ca70a564f80863b4c32d95cf428f78f4db5fc376fc389bb589fd5dc
7
+ data.tar.gz: f04c48e0820d3b96c61618c08403845ca4730acc08eb4e68f8668cc52ce6365b28d35d0b4ab5293a22d5290e2863c1d4f100d57bc81fe14162f9c4fce67e9458
data/lib/airbrake-ruby.rb CHANGED
@@ -4,6 +4,7 @@ require 'json'
4
4
  require 'thread'
5
5
  require 'set'
6
6
  require 'English'
7
+ require 'socket'
7
8
 
8
9
  require 'airbrake-ruby/version'
9
10
  require 'airbrake-ruby/config'
@@ -48,6 +48,10 @@ module Airbrake
48
48
  :params
49
49
  ].freeze
50
50
 
51
+ ##
52
+ # @return [String] the name of the host machine
53
+ HOSTNAME = Socket.gethostname.freeze
54
+
51
55
  def initialize(config, exception, params = {})
52
56
  @config = config
53
57
 
@@ -145,7 +149,10 @@ module Airbrake
145
149
 
146
150
  # Legacy Airbrake v4 behaviour.
147
151
  component: params.delete(:component),
148
- action: params.delete(:action)
152
+ action: params.delete(:action),
153
+
154
+ # Make sure we always send hostname.
155
+ hostname: HOSTNAME
149
156
  }.merge(CONTEXT).delete_if { |_key, val| val.nil? || val.empty? }
150
157
  end
151
158
 
@@ -3,5 +3,5 @@
3
3
  module Airbrake
4
4
  ##
5
5
  # @return [String] the library version
6
- AIRBRAKE_RUBY_VERSION = '1.0.3'.freeze
6
+ AIRBRAKE_RUBY_VERSION = '1.0.4'.freeze
7
7
  end
data/spec/notice_spec.rb CHANGED
@@ -105,6 +105,11 @@ RSpec.describe Airbrake::Notice do
105
105
  expect(notice.to_json).
106
106
  to match(/"notifier":{"name":"airbrake-ruby","version":".+","url":".+"}/)
107
107
  end
108
+
109
+ it "always contains context/hostname" do
110
+ expect(notice.to_json).
111
+ to match(/"context":{.*"hostname":".+".*}/)
112
+ end
108
113
  end
109
114
 
110
115
  describe "#[]" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-18 00:00:00.000000000 Z
11
+ date: 2016-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -158,3 +158,4 @@ test_files:
158
158
  - spec/notice_spec.rb
159
159
  - spec/config_spec.rb
160
160
  - spec/filter_chain_spec.rb
161
+ has_rdoc: