exceptions_to_slack 1.1.0 → 2.0.0

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: e1041c85765abefc1378bcd1474ce18c48d487f3
4
- data.tar.gz: 1d982c665a395c011f0c2a83770b3da45ce1cac5
3
+ metadata.gz: 8044bd9d13db7f23842129dd74a4a246be8047d3
4
+ data.tar.gz: 137e8d0c5a0585c1c67c900f00d7cdfd968d0aa2
5
5
  SHA512:
6
- metadata.gz: f21b0a3358b1d1a67f5fb162c6bbd04bb899bf96e6da6499483084000e03c842569a5a5efa852bb67b81373ae850169337451d26ea6687de615740ca8b597033
7
- data.tar.gz: b72aaa2ac06cf42701b28933267490ccbba023f1fce26d8abef0982fe9fd462e6622f8d57e60cf56b8183263393650ef0940f202b08e4aa1040ea8a16361eab0
6
+ metadata.gz: c44792653cda9d21eea74bd6ff15ccf7a325cb9208bfebfbfc6f82c9d36001cb161dd7d619fc0471f25541c80f5f72b71a85bc85dd5d79cc3233e69bd9edda33
7
+ data.tar.gz: 4194838037dd11717e12342324d41d592a8bf28ec0c930c9ba14fa9fb3cdf6d949f04a174aff6c860bfdf6faffed8eb6249306b8068d4444abc92772859443f3
data/README.md CHANGED
@@ -14,8 +14,7 @@ Rails 3: add as rack middleware to `application.rb'
14
14
 
15
15
  ```ruby
16
16
  config.middleware.use ExceptionsToSlack::Notifier,
17
- team: 'your-team-name', # required
18
- token: 'your-api-token', # required, https://my.slack.com/services/new/incoming-webhook
17
+ url: 'your-incoming-webhook-url', # required, https://my.slack.com/services/new/incoming-webhook
19
18
  channel: '#general', # required
20
19
  user: 'Exception Notifier', # optional, defaults to Notifier
21
20
  ignore: /Foo/, # optional pattern for exceptions not to be sent
@@ -14,6 +14,6 @@ Gem::Specification.new do |gem|
14
14
  gem.require_paths = ["lib"]
15
15
  gem.version = ExceptionsToSlack::VERSION
16
16
 
17
- gem.add_dependency("slack-notifier", "~> 0.5.0")
17
+ gem.add_dependency("slack-notifier", "~> 1.4.0")
18
18
  gem.add_development_dependency("webmock", "~> 1.18.0")
19
19
  end
@@ -4,7 +4,7 @@ module ExceptionsToSlack
4
4
  class Notifier
5
5
  def initialize(app, options = {})
6
6
  @app = app
7
- @notifier = Slack::Notifier.new(team(options), token(options))
7
+ @notifier = Slack::Notifier.new(url(options))
8
8
  @notifier.channel = options[:channel] || raise("Channel is required")
9
9
  @notifier.username = options[:user] || "Notifier"
10
10
  @ignore = options[:ignore]
@@ -28,12 +28,8 @@ module ExceptionsToSlack
28
28
  end
29
29
  end
30
30
 
31
- def team(options)
32
- options[:team] || raise("Team name is required")
33
- end
34
-
35
- def token(options)
36
- options[:token] || raise("Token is required")
31
+ def url(options)
32
+ options[:url] || raise("URL is required")
37
33
  end
38
34
 
39
35
  def message_for(exception)
@@ -1,3 +1,3 @@
1
1
  module ExceptionsToSlack
2
- VERSION = '1.1.0'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -1,16 +1,14 @@
1
1
  require_relative '../test_helper'
2
2
 
3
3
  class TestNotifier < MiniTest::Unit::TestCase
4
- TEAM = 'the-team'
5
- TOKEN = 'the-token'
4
+ URL = 'https://the.url.com'
6
5
  CHANNEL = 'the-channel'
7
6
 
8
7
  def setup
9
8
  @app = MiniTest::Mock.new
10
9
 
11
10
  @notifier = ExceptionsToSlack::Notifier.new(@app, {
12
- team: TEAM,
13
- token: TOKEN,
11
+ url: URL,
14
12
  channel: CHANNEL,
15
13
  ignore: /ignored/
16
14
  })
@@ -19,7 +17,7 @@ class TestNotifier < MiniTest::Unit::TestCase
19
17
  def test_exceptions_are_sent_to_slack
20
18
  def @app.call(env) raise ':boom:' end
21
19
 
22
- WebMock.stub_request(:post, 'https://the-team.slack.com/services/hooks/incoming-webhook?token=the-token').with do |request|
20
+ WebMock.stub_request(:post, 'https://the.url.com').with do |request|
23
21
  form = URI.decode_www_form(request.body)
24
22
 
25
23
  assert_equal 1, form.size
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exceptions_to_slack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darrin Holst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-06 00:00:00.000000000 Z
11
+ date: 2015-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slack-notifier
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.0
19
+ version: 1.4.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
- version: 0.5.0
26
+ version: 1.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: webmock
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.18.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: 1.18.0
41
41
  description:
@@ -45,7 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
48
+ - ".gitignore"
49
49
  - Gemfile
50
50
  - LICENSE
51
51
  - README.md
@@ -65,17 +65,17 @@ require_paths:
65
65
  - lib
66
66
  required_ruby_version: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - '>='
68
+ - - ">="
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 2.2.2
78
+ rubygems_version: 2.4.6
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: Send rails exceptions to Slack