honeycomb-rails 0.4.1 → 0.4.2

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
  SHA256:
3
- metadata.gz: f13e00c09b5b340fcb8f28d6b6f18499bb6ca7111e6156d5b5c8c12a2aeaecbf
4
- data.tar.gz: c96bded26cbc16d04faeb0587bfc7f7009b018417faed39a94cb14dddffb52d9
3
+ metadata.gz: a6e8abdde1e706e01d1b26feba7dac25fca60d7c10aa6cadf8eb80b92d64d027
4
+ data.tar.gz: 87def2f4c965e144ab0225800bdcabbf44dd352f85f5dfc4b2708b34c5efc6e5
5
5
  SHA512:
6
- metadata.gz: e86add2fcc2a429723abe7cd3cec1ce31d2014537b18aacf017756728100b0dfee76a84f9580fb3a20f4671578709b817e47dbafd934a11a03374e5c430d1e18
7
- data.tar.gz: 36696d9e6f59b6098da73e94784f5a5fe8315ad34fde2ce326f6d68e02f8ff7096dc0d8b6f76f6c52c87b681c30e28867911fe72cc0d93c367cf7620082bd260
6
+ metadata.gz: 36e2f4d0938fd7588cd3d09fe79940479a044ff447476cd6c666c7cd00ce0829b5af1a30e69ab2152a0a590b8f7c003598afc4466c18451ae5e5be592eb5f1ea
7
+ data.tar.gz: a627f08ef0c6c7869962bf409f8c38d0293be235c9e3abd41abd3ee468f23c91ceac5a1d591afe3418d5c1b88eaa00a91ee9b4c1873ac940c4da06bbeee2421b
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # honeycomb-rails
1
+ # honeycomb-rails [![Build Status](https://travis-ci.org/honeycombio/honeycomb-rails.svg?branch=master)](https://travis-ci.org/honeycombio/honeycomb-rails) [![Gem Version](https://badge.fury.io/rb/honeycomb-rails.svg)](https://badge.fury.io/rb/honeycomb-rails)
2
2
 
3
3
  Easily instrument your Rails apps with [Honeycomb](https://honeycomb.io).
4
4
 
@@ -2,6 +2,18 @@ module HoneycombRails
2
2
  module Extensions
3
3
  module ActionController
4
4
  module InstanceMethods
5
+ def self.included(controller_class)
6
+ super
7
+
8
+ controller_class.before_action do
9
+ honeycomb_initialize
10
+ end
11
+ end
12
+
13
+ def honeycomb_initialize
14
+ @honeycomb_metadata = {}
15
+ end
16
+
5
17
  # Hash of metadata to be added to the event we will send to Honeycomb
6
18
  # for the current request.
7
19
  #
@@ -11,9 +23,7 @@ module HoneycombRails
11
23
  # honeycomb_metadata[:num_posts] = @posts.size
12
24
  #
13
25
  # @return [Hash<String=>Any>]
14
- def honeycomb_metadata
15
- @honeycomb_metadata ||= {}
16
- end
26
+ attr_reader :honeycomb_metadata
17
27
  end
18
28
  end
19
29
  end
@@ -7,7 +7,7 @@ module HoneycombRails
7
7
  def append_info_to_payload(payload)
8
8
  super
9
9
 
10
- metadata = honeycomb_metadata
10
+ metadata = honeycomb_metadata || {}
11
11
 
12
12
  metadata.merge!(honeycomb_user_metadata)
13
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeycomb-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stokes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-01-23 00:00:00.000000000 Z
12
+ date: 2018-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: libhoney