airbrake-user_informer 0.4.0 → 0.5.0

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: 8bef6fb29d356cb4a607d301e51f91a29a0549db
4
- data.tar.gz: 91dd8112e6d98cca679de0350a722ebac4799d43
3
+ metadata.gz: e43717daf709666c6d791f9771ba18db29e043a8
4
+ data.tar.gz: 3ee3eceee8043d7dd1e7b4e510ff99a66b83d230
5
5
  SHA512:
6
- metadata.gz: 28cb9a832e41f1d09ef695b825cd227c3aacf0f4007740f5940d53c3ff2700dbdb33df6e9797a014c8c3704c8c1299b43f8b896674eb5df885bba376a659041b
7
- data.tar.gz: 9fcd2cf84bd8ffc05dcd46447c0723478e4de126774670112b200894efb32d88874f14bd87d01ccee1af7b0602bc3c0cb7c15d81b8ecb2983d53926b6884c273
6
+ metadata.gz: d3f15f50580e40232b177252da4e2b0bf1449b028816b75c15229a95fb3423241e838637c7e1d99e4b53a1f7e9c8046b92b4ffdecd3f36b85ec158c8642da7a7
7
+ data.tar.gz: a83073373d1c06eea66a3d4a586efce83edc0af37326714d7e1e803a9ecc6ae401829ced2693e343b0423e974607a1fe32c4ab3bda4c0d7646de39f7f882e20d
@@ -14,9 +14,9 @@ module Airbrake
14
14
  # stolen from https://github.com/airbrake/airbrake/blob/v4.3.8/lib/airbrake/user_informer.rb
15
15
  class Middleware
16
16
  ENV_KEY = "airbrake.promise"
17
- PLACEHOLDER = "<!-- AIRBRAKE ERROR -->"
18
17
  TIMEOUT = 1.0 # seconds
19
18
  STEPS = 100
19
+ DEFAULT_PLACEHOLDER = "<!-- AIRBRAKE ERROR -->"
20
20
 
21
21
  def initialize(app)
22
22
  @app = app
@@ -54,7 +54,7 @@ module Airbrake
54
54
  # - always call .close on the old body so it can get garbage collected if it is a File
55
55
  def replace_placeholder(replacement, body, headers)
56
56
  new_body = []
57
- body.each { |chunk| new_body << chunk.gsub(PLACEHOLDER, replacement) }
57
+ body.each { |chunk| new_body << chunk.gsub(Airbrake.user_information_placeholder || DEFAULT_PLACEHOLDER, replacement) }
58
58
  headers["Content-Length"] = new_body.inject(0) { |sum, x| sum + x.bytesize }.to_s
59
59
  new_body
60
60
  ensure
@@ -66,6 +66,7 @@ end
66
66
 
67
67
  class << Airbrake
68
68
  attr_accessor :user_information
69
+ attr_accessor :user_information_placeholder
69
70
  end
70
71
 
71
72
  if defined?(::Rails::Railtie)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Airbrake
3
3
  module UserInformer
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake-user_informer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-24 00:00:00.000000000 Z
11
+ date: 2018-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties