exception_notification-hato_notifier 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b028d1832fd30775f54a28a0da29c6c0c6140ac
4
- data.tar.gz: 74a2002c31177261b0e67c0bcf28510361cfaa8b
3
+ metadata.gz: 60cb9db24591ce464fc563916c17b68252cc51e6
4
+ data.tar.gz: 5fc6ca50095d94d32c698c8ca07c7cb7d668d6ca
5
5
  SHA512:
6
- metadata.gz: 7c73ea662fcdc7e723e9cc6ee8977a3298f20e85bbc40b73a366c80804ffd76c49de7b40e3eeef80bd107a108d42ef79bacee9e2d414eabd606b08176c03b2f3
7
- data.tar.gz: 205c77ddb48b8937112e9f3faf0520bf651ebb06ec20a40499a781bd1bb2f3041f26f95888e93f991c1f281a3c5ae3cb33248c56eda461be6381cca28991a46d
6
+ metadata.gz: 5aea5d9c10382207483bbc8334b89587a7db2308a88222a9b713e7f0b3ee2a87e53477d7c118e8e1d2c4756204538b1e3b7cd84e01ae3f3d6349bbf5e8fc5130
7
+ data.tar.gz: de19f498d78de46a68695ce42c81b3aaa60e99ae483569ed1aac14c4b7bc87babacae3e1a1055b98e6dfbe00e4eca8e91a37f2a5d8949acde4164c5f17c8b061
data/example/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'exception_notification'
4
+ gem 'exception_notification-hato_notifier', path: '../'
5
+
6
+ gem 'hato'
7
+ gem 'hato-plugin-ikachan'
8
+ gem 'sinatra'
9
+ gem 'foreman'
data/example/Procfile ADDED
@@ -0,0 +1,2 @@
1
+ hato: bundle exec hato -c hato_config.rb
2
+ app: bundle exec rackup
data/example/app.rb ADDED
@@ -0,0 +1,22 @@
1
+ require 'sinatra/base'
2
+ require 'exception_notification'
3
+ require 'exception_notifier/hato_notifier'
4
+
5
+ class ExampleApp < Sinatra::Base
6
+ use ExceptionNotification::Rack,
7
+ hato: {
8
+ host: 'localhost',
9
+ port: 9699,
10
+ api_key: 'example',
11
+ template: {
12
+ tag: ->(exception, options) { "exception.#{exception.class}" },
13
+ message: ->(exception, options) { "Exception: #{exception.class}: #{exception.message}" },
14
+ },
15
+ }
16
+
17
+ class Exception < ::Exception; end
18
+
19
+ get '/' do
20
+ raise Exception.new('Example exception')
21
+ end
22
+ end
data/example/config.ru ADDED
@@ -0,0 +1,2 @@
1
+ require ::File.expand_path('../app', __FILE__)
2
+ run ExampleApp
@@ -0,0 +1,20 @@
1
+ services = {
2
+ 'ExampleApp' => %w[example_app_team],
3
+ }
4
+
5
+ Hato::Config.define do
6
+ api_key 'example'
7
+ host '0.0.0.0'
8
+ port 9699
9
+
10
+ # ExampleApp::Exception will be sent to #example_app_team channel via Ikachan
11
+ tag /^exception\.([^.:]+)/ do |service|
12
+ if channel = services[service]
13
+ plugin 'Ikachan' do
14
+ host 'ikachan.example.com'
15
+ port 4979
16
+ channel channel
17
+ end
18
+ end
19
+ end
20
+ end
@@ -43,8 +43,9 @@ module ExceptionNotifier
43
43
  client = Net::HTTP.new(@host, @port)
44
44
  req = Net::HTTP::Post.new('/notify')
45
45
 
46
- req.form_data = { tag: tag, message: message }
47
- req.form_data.merge!(api_key: api_key) if @api_key
46
+ form_data = { 'tag' => tag, 'message' => message }
47
+ form_data.merge!('api_key' => @api_key) if @api_key
48
+ req.set_form_data(form_data)
48
49
 
49
50
  client.request(req)
50
51
  end
@@ -1,5 +1,5 @@
1
1
  module ExceptionNotifier
2
2
  class HatoNotifier
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_notification-hato_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaro Kuribayashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-17 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webmock
@@ -79,6 +79,11 @@ files:
79
79
  - LICENSE.txt
80
80
  - README.md
81
81
  - Rakefile
82
+ - example/Gemfile
83
+ - example/Procfile
84
+ - example/app.rb
85
+ - example/config.ru
86
+ - example/hato_config.rb
82
87
  - exception_notification-hato_nitifier.gemspec
83
88
  - lib/exception_notifier/hato_notifier.rb
84
89
  - lib/exception_notifier/hato_notifier/version.rb