bugsnag-delivery-fluent 0.1.0 → 0.1.1

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: f0e1cf241f45aa28970d3969e326dcd42d0ad0b8
4
- data.tar.gz: 5a47e4b8e08374fadd67419776d132fd629f1814
3
+ metadata.gz: 8c61474321fae625c82307452d19a78af1838dbb
4
+ data.tar.gz: a41c1924b7b84ba5feff23d671c350b7af715268
5
5
  SHA512:
6
- metadata.gz: 79e011eac735c8ff9f8607ac4f5cb4280c479391b110c9048787bd7662a7e7acb29f5a8a0201bb840d1478051f970b59a1de241fabb5266b68f27e5dbcd03255
7
- data.tar.gz: a7255ca6ad7e9d165c031600e489a7a808a6da6eff4a47de5a27f820a0706d223cc58bbc8fe3e1fef83c0a7ae9efc435d9e561ed16d6a59cb22939d1e1168329
6
+ metadata.gz: f5a45d731a75607db7a44da68c3237c493b1c18be203e40e62495a2db27be2cea138e7077388905caec2baaf52ea3cbf50df91fbb91f81720d3ad650d66b3bc6
7
+ data.tar.gz: f35ce37709b2632b5f340e976e73926dffa7bb64a48f6c93ff95f81e5d47539fe6cb11b8839e20fae5a724c68feb1b2bbff96afc419013c7702311d14473b8b8
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ [![Gem Version](https://badge.fury.io/rb/bugsnag-delivery-fluent.svg)](http://badge.fury.io/rb/bugsnag-delivery-fluent)
2
+ ![Build Status](https://circleci.com/gh/koshigoe/bugsnag-delivery-fluent.svg?style=shield)
3
+
1
4
  # Bugsnag::Delivery::Fluent
2
5
 
3
6
  This gem adds a `delivery_method` to [bugsnag/bugsnag-ruby](https://github.com/bugsnag/bugsnag-ruby) for sending to fluentd.
data/Rakefile CHANGED
@@ -1,2 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
2
3
 
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency "bundler", "~> 1.8"
22
+ spec.add_development_dependency "bundler"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
  spec.add_development_dependency 'rspec'
25
25
  spec.add_development_dependency 'rspec-mocks'
@@ -1,7 +1,7 @@
1
1
  module Bugsnag
2
2
  module Delivery
3
3
  class Fluent
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
  end
7
7
  end
@@ -24,13 +24,22 @@ module Bugsnag
24
24
  module Delivery
25
25
  class Fluent
26
26
  def self.deliver(url, body, configuration)
27
- logger = ::Fluent::Logger::FluentLogger.new(
28
- configuration.fluent_tag_prefix,
29
- :host => configuration.fluent_host,
30
- :port => configuration.fluent_port
31
- )
32
- unless logger.post('deliver', { :url => url, :body => body })
33
- configuration.logger.error logger.last_error
27
+ begin
28
+ logger = ::Fluent::Logger::FluentLogger.new(
29
+ configuration.fluent_tag_prefix,
30
+ :host => configuration.fluent_host,
31
+ :port => configuration.fluent_port
32
+ )
33
+ if logger.post('deliver', { :url => url, :body => body })
34
+ Bugsnag.debug("Notification to #{url} finished, payload was #{body}")
35
+ else
36
+ Bugsnag.warn(logger.last_error)
37
+ end
38
+ rescue StandardError => e
39
+ raise if e.class.to_s == "RSpec::Expectations::ExpectationNotMetError"
40
+
41
+ Bugsnag.warn("Notification to #{url} failed, #{e.inspect}")
42
+ Bugsnag.warn(e.backtrace)
34
43
  end
35
44
  end
36
45
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag-delivery-fluent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - koshigoe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: '1.8'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-mocks
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bugsnag
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: fluent-logger
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Delivery method send to fluent for bugsnag/bugsnag-ruby.
@@ -101,9 +101,9 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - ".gitignore"
105
- - ".rspec"
106
- - ".travis.yml"
104
+ - .gitignore
105
+ - .rspec
106
+ - .travis.yml
107
107
  - Gemfile
108
108
  - README.md
109
109
  - Rakefile
@@ -122,17 +122,17 @@ require_paths:
122
122
  - lib
123
123
  required_ruby_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - ">="
125
+ - - '>='
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ">="
130
+ - - '>='
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
134
  rubyforge_project:
135
- rubygems_version: 2.4.5
135
+ rubygems_version: 2.0.14
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: Delivery method send to fluent for bugsnag/bugsnag-ruby.