blabbermouth-rollbar 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6588824d19bf59c434ab4f01943a792e647f0b59
4
+ data.tar.gz: 24eb328e3f7fc5bd0494353b2f3616ef9f1170ad
5
+ SHA512:
6
+ metadata.gz: 0941d8d9d785938137177e74db021449d376309e7f3d90ce2f43166cb7cb219d42f2a174ca0505e5adaa61aa4c2adab183b0b8ac29b4edb2e9c509f629d28cba
7
+ data.tar.gz: 02e119ffd64d93dcfd4b7f139788d0147f552fbbaa9dda06123274617a1b83c5b4b68acd879c6746f26ccc0594bf38c3c54dbe05ef2af0391607a91e8244755a
@@ -0,0 +1,2 @@
1
+ require 'blabbermouth'
2
+ require 'blabbermouth/gawkers/rollbar'
@@ -0,0 +1,47 @@
1
+ require 'blabbermouth/exceptions'
2
+
3
+ module Blabbermouth
4
+ module Gawkers
5
+ class Rollbar < Base
6
+ def error(key, e, *args)
7
+ data, opts, args = parse_args(*args)
8
+ rollbar!
9
+ ::Rollbar.error(Blabbermouth::Error.new(key, e), data)
10
+ end
11
+
12
+ def info(key, msg=nil, *args)
13
+ data, opts, args = parse_args(*args)
14
+ rollbar!
15
+ ::Rollbar.info(Blabbermouth::Info.new(key, msg), data)
16
+ end
17
+
18
+ def increment(key, by=1, *args)
19
+ data, opts, args = parse_args(*args)
20
+ rollbar!
21
+ ::Rollbar.info(Blabbermouth::Increment.new(key, by), data)
22
+ end
23
+
24
+ def count(key, total, *args)
25
+ data, opts, args = parse_args(*args)
26
+ rollbar!
27
+ ::Rollbar.info(Blabbermouth::Count.new(key, total), data)
28
+ end
29
+
30
+ def time(key, duration, *args)
31
+ data, opts, args = parse_args(*args)
32
+ rollbar!
33
+ ::Rollbar.info(Blabbermouth::Time.new(key, duration), data)
34
+ end
35
+
36
+ protected
37
+
38
+ def rollbar?
39
+ defined?(::Rollbar)
40
+ end
41
+
42
+ def rollbar!
43
+ raise "You must require and configure the rollbar gem to use it as a gawker" unless rollbar?
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,48 @@
1
+ class Rollbar
2
+ attr_reader :infos, :errors
3
+
4
+ class << self
5
+ def rollbar
6
+ @rollbar ||= new
7
+ end
8
+
9
+ def infos
10
+ rollbar.infos
11
+ end
12
+
13
+ def errors
14
+ rollbar.errors
15
+ end
16
+
17
+ def info(e, data)
18
+ rollbar.info(e, data)
19
+ end
20
+
21
+ def error(e, data)
22
+ rollbar.error(e, data)
23
+ end
24
+
25
+ def clear!
26
+ rollbar.clear!
27
+ end
28
+ end
29
+
30
+ def info(e, data)
31
+ @infos << [e, data]
32
+ end
33
+
34
+ def error(e, data)
35
+ @errors << [e, data]
36
+ end
37
+
38
+ def clear!
39
+ @infos = []
40
+ @errors = []
41
+ end
42
+
43
+ protected
44
+
45
+ def initialize
46
+ clear!
47
+ end
48
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blabbermouth-rollbar
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Mark Rebec
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: blabbermouth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rollbar
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Gawker for Blabbermouth that posts to Rollbar
70
+ email:
71
+ - mark@markrebec.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - lib/blabbermouth-rollbar.rb
77
+ - lib/blabbermouth/gawkers/rollbar.rb
78
+ - spec/support/rollbar.rb
79
+ homepage: http://github.com/markrebec/blabbermouth
80
+ licenses: []
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.2.2
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Rollbar gawker for Blabbermouth
102
+ test_files:
103
+ - spec/support/rollbar.rb