bugsnag 1.3.7 → 1.3.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bugsnag.gemspec +2 -2
- data/lib/bugsnag/helpers.rb +3 -1
- data/spec/helper_spec.rb +25 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.8
|
data/bugsnag.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bugsnag}
|
8
|
-
s.version = "1.3.
|
8
|
+
s.version = "1.3.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["James Smith"]
|
12
|
-
s.date = %q{2013-
|
12
|
+
s.date = %q{2013-06-12}
|
13
13
|
s.description = %q{Ruby notifier for bugsnag.com}
|
14
14
|
s.email = %q{james@bugsnag.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/bugsnag/helpers.rb
CHANGED
@@ -49,7 +49,9 @@ module Bugsnag
|
|
49
49
|
elsif v.is_a?(Array) || v.is_a?(Set)
|
50
50
|
h[k] = v.map {|el| reduce_hash_size(el) }
|
51
51
|
else
|
52
|
-
|
52
|
+
val = v.to_s
|
53
|
+
val = val.slice(0, MAX_STRING_LENGTH) + "[TRUNCATED]" if val.length > MAX_STRING_LENGTH
|
54
|
+
h[k] = val
|
53
55
|
end
|
54
56
|
|
55
57
|
h
|
data/spec/helper_spec.rb
CHANGED
@@ -1,6 +1,31 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Bugsnag::Helpers do
|
4
|
+
it "should reduce hash size correctly" do
|
5
|
+
meta_data = {
|
6
|
+
:key_one => "this should not be truncated",
|
7
|
+
:key_two => ""
|
8
|
+
}
|
9
|
+
|
10
|
+
1000.times {|i| meta_data[:key_two] += "this should be truncated " }
|
11
|
+
|
12
|
+
meta_data[:key_two].length.should > 4096
|
13
|
+
|
14
|
+
meta_data_return = Bugsnag::Helpers.reduce_hash_size meta_data
|
15
|
+
|
16
|
+
meta_data_return[:key_one].length.should == 28
|
17
|
+
meta_data_return[:key_one].should == "this should not be truncated"
|
18
|
+
|
19
|
+
meta_data_return[:key_two].length.should == 4107
|
20
|
+
meta_data_return[:key_two].match(/\[TRUNCATED\]$/).nil?.should == false
|
21
|
+
|
22
|
+
meta_data[:key_two].length.should > 4096
|
23
|
+
meta_data[:key_two].match(/\[TRUNCATED\]$/).nil?.should == true
|
24
|
+
|
25
|
+
meta_data[:key_one].length.should == 28
|
26
|
+
meta_data[:key_one].should == "this should not be truncated"
|
27
|
+
end
|
28
|
+
|
4
29
|
it "should work with no filters configured" do
|
5
30
|
url = Bugsnag::Helpers.cleanup_url "/dir/page?param1=value1¶m2=value2"
|
6
31
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 1.3.
|
8
|
+
- 8
|
9
|
+
version: 1.3.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- James Smith
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2013-
|
17
|
+
date: 2013-06-12 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|