pakyow-fail-hipchat 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 41339f77d5f103361cdfe11c62d16dda4ef80d95
4
+ data.tar.gz: b15ef711b87ad3284e333bfe8fe9043b06a47b20
5
+ SHA512:
6
+ metadata.gz: 57d62599c26ea8e6521c157768198cb887deb6a84fc1e5edf4894b232725a6f292763c13a30ba0b56039527160b01b63faaeae619bd88b5660e31fed5bee3a18
7
+ data.tar.gz: ea8aca7bf935380d2ac81880f71e864d14f3757a83c729f6418f55c0d6275305589647607be1a81ef719c7c9536a0eb53251b4728e0063ed459eb1eb5f7f7eb2
data/CHANGES ADDED
@@ -0,0 +1,3 @@
1
+ = 0.1.0 / 2015-01-09
2
+
3
+ * Initial gem release
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Bryan Powell
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,39 @@
1
+ require 'hipchat'
2
+
3
+ module Pakyow
4
+ module Fail
5
+ module Handlers
6
+ class Hipchat
7
+ NICENAME = :hipchat
8
+
9
+ # register and enable the handler
10
+ Pakyow::Fail::Handler.register(NICENAME, self, %i[hipchat_room hipchat_api_token])
11
+ Pakyow::Fail::Handler.enable(NICENAME)
12
+
13
+ # define default config options
14
+ Pakyow::Config.fail.opt(:hipchat_sender, lambda { "#{Pakyow::Config.app.name} Fail" })
15
+ Pakyow::Config.fail.opt(:hipchat_color, :red)
16
+
17
+ def initialize(app)
18
+ req = app.req
19
+
20
+ body = []
21
+ body << "<strong>#{req.method.upcase} #{req.path} (#{req.error.class.name}) #{CGI.escapeHTML(req.error.message)}</strong>"
22
+ body << "Params: #{app.params}"
23
+ body << "Session: #{app.session}"
24
+ body.concat(req.error.backtrace)
25
+
26
+ client[Config.fail.hipchat_room].send(Config.fail.hipchat_sender, body.join('<br>'), color: Config.fail.hipchat_color)
27
+ rescue StandardError => e
28
+ app.logger.error "pakyow-hipchat failed: #{e.message}"
29
+ end
30
+
31
+ private
32
+
33
+ def client
34
+ @client ||= HipChat::Client.new(Config.fail.hipchat_api_token)
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pakyow-fail-hipchat
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Bryan Powell
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pakyow-fail
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: hipchat
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.4'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.4'
41
+ description: An error handler for Pakyow apps that reports failures to a Hipchat room.
42
+ email: bryan@metabahn.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - "./CHANGES"
48
+ - "./MIT-LICENSE"
49
+ - "./lib/pakyow-fail-hipchat.rb"
50
+ homepage: http://pakyow.com
51
+ licenses:
52
+ - MIT
53
+ metadata: {}
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - "./lib"
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 2.0.0
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubyforge_project:
70
+ rubygems_version: 2.2.2
71
+ signing_key:
72
+ specification_version: 4
73
+ summary: Pakyow error handler for Hipchat.
74
+ test_files: []
75
+ has_rdoc: