bugsnag 2.0.1 → 2.0.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
  SHA1:
3
- metadata.gz: 3df43adc7e6a279be8b5d1e7e454745573c6ce6b
4
- data.tar.gz: 285955b0b0f441e442c2d888400d3049e2819371
3
+ metadata.gz: 3e431cd9b8e24c77a857706e4226447ca12b73f7
4
+ data.tar.gz: 9844d688bc0311ccad83c6997d8bf0274c8ccd7a
5
5
  SHA512:
6
- metadata.gz: 6e75646fd35a624c3b03d6be994fee9e44b019a90f791a4ec090479e11382c6b3fb580961ecae3a3cc8cd50ec2232b4779a98460da032b0930d229ab869b8292
7
- data.tar.gz: 1662f2351b795995731a4298d24831ba42eecc503de8101522e75c9681bdfddd3e3aa8976120253a17ad1e19e6a88380f59051912005c2c1525311651fd05101
6
+ metadata.gz: f12b1aec2e9a72a9557f5a9df16e0c519603ad51624ef2754280f30f6ce93ba17439bb2ad8ff4577cc5488eeb5483ac3cb4fbf0682a312721527b9ca1e3c7cbe
7
+ data.tar.gz: f9c0201a1a2c079ddcdc626c6a94e5a20b64259128998d7dda16d7162a77c76ebfb2c54dee8be7b7527f9702cc8630899862f4e09d60f351dae9604fd25cd769
@@ -1,6 +1,10 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 2.0.2
5
+ -----
6
+ - Fix encoding issue when ensuring utf8 string is valid
7
+
4
8
  2.0.1
5
9
  -----
6
10
  - Fix capistrano v3 after 2.0.0
data/README.md CHANGED
@@ -127,7 +127,7 @@ Bugsnag.before_notify_callbacks.clear
127
127
  ### Exceptions with Meta Data
128
128
 
129
129
  If you include the `Bugsnag::MetaData` module into your own exceptions, you can
130
- associate meta data with a paticular exception.
130
+ associate meta data with a particular exception.
131
131
 
132
132
  ```ruby
133
133
  class MyCustomException < Exception
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.0.2
@@ -26,7 +26,7 @@ module Bugsnag
26
26
  case obj
27
27
  when Hash
28
28
  clean_hash = {}
29
- obj.each do |k,v|
29
+ obj.each do |k,v|
30
30
  if filters && filters.any? {|f| k.to_s.include?(f.to_s)}
31
31
  clean_hash[k] = "[FILTERED]"
32
32
  else
@@ -41,7 +41,11 @@ module Bugsnag
41
41
  obj
42
42
  when String
43
43
  if defined?(obj.encoding) && defined?(Encoding::UTF_8)
44
- obj.encode('utf-8', obj.encoding == Encoding::UTF_8 ? 'binary' : obj.encoding, :invalid => :replace, :undef => :replace)
44
+ if obj.encoding == Encoding::UTF_8
45
+ obj.valid_encoding? ? obj : obj.encode('utf-16', {:invalid => :replace, :undef => :replace}).encode('utf-8')
46
+ else
47
+ obj.encode('utf-8', {:invalid => :replace, :undef => :replace})
48
+ end
45
49
  elsif defined?(Iconv)
46
50
  Iconv.conv('UTF-8//IGNORE', 'UTF-8', obj) || obj
47
51
  else
@@ -62,10 +66,10 @@ module Bugsnag
62
66
  return url unless filters
63
67
 
64
68
  filter_regex = Regexp.new("([?&](?:[^&=]*#{filters.to_a.join('|[^&=]*')}[^&=]*)=)[^&]*")
65
-
69
+
66
70
  url.gsub(filter_regex, '\1[FILTERED]')
67
71
  end
68
-
72
+
69
73
  def self.reduce_hash_size(hash)
70
74
  return {} unless hash.is_a?(Hash)
71
75
  hash.inject({}) do |h, (k,v)|
@@ -82,13 +86,13 @@ module Bugsnag
82
86
  h
83
87
  end
84
88
  end
85
-
89
+
86
90
  def self.flatten_meta_data(overrides)
87
91
  return nil unless overrides
88
92
 
89
93
  meta_data = overrides.delete(:meta_data)
90
94
  if meta_data.is_a?(Hash)
91
- overrides.merge(meta_data)
95
+ overrides.merge(meta_data)
92
96
  else
93
97
  overrides
94
98
  end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Bugsnag::Helpers do
@@ -27,6 +29,21 @@ describe Bugsnag::Helpers do
27
29
  expect(Bugsnag::Helpers.cleanup_obj(a)).to eq([["hello"], ["hello"]])
28
30
  end
29
31
 
32
+ it "cleans up UTF8 strings properly" do
33
+ obj = "André"
34
+ expect(Bugsnag::Helpers.cleanup_obj(obj)).to eq("André")
35
+ end
36
+
37
+ it "cleans up binary strings properly" do
38
+ if RUBY_VERSION > "1.9"
39
+ obj = "Andr\xc7\xff"
40
+ if obj.respond_to? :force_encoding
41
+ obj = obj.force_encoding('BINARY')
42
+ end
43
+ expect(Bugsnag::Helpers.cleanup_obj(obj)).to eq("Andr��")
44
+ end
45
+ end
46
+
30
47
  it "reduces hash size correctly" do
31
48
  meta_data = {
32
49
  :key_one => "this should not be truncated",
metadata CHANGED
@@ -1,103 +1,103 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-30 00:00:00.000000000 Z
11
+ date: 2014-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: httparty
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - <
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
- - - '>='
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: '0.6'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - <
41
+ - - "<"
42
42
  - !ruby/object:Gem::Version
43
43
  version: '1.0'
44
- - - '>='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0.6'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rspec
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rdoc
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - '>='
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: pry
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - '>='
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - '>='
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  description: Ruby notifier for bugsnag.com
@@ -108,10 +108,10 @@ extra_rdoc_files:
108
108
  - LICENSE.txt
109
109
  - README.md
110
110
  files:
111
- - .document
112
- - .gitignore
113
- - .rspec
114
- - .travis.yml
111
+ - ".document"
112
+ - ".gitignore"
113
+ - ".rspec"
114
+ - ".travis.yml"
115
115
  - CHANGELOG.md
116
116
  - Gemfile
117
117
  - LICENSE.txt
@@ -166,17 +166,17 @@ require_paths:
166
166
  - lib
167
167
  required_ruby_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - '>='
169
+ - - ">="
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - '>='
174
+ - - ">="
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  requirements: []
178
178
  rubyforge_project:
179
- rubygems_version: 2.0.3
179
+ rubygems_version: 2.2.2
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: Ruby notifier for bugsnag.com