nine_one_one 2.0.3 → 2.0.4

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
- SHA256:
3
- metadata.gz: 78b09a52e2a4ac433a64cabe0c2d1e977a55b8a285b9de3c64f373ff094def87
4
- data.tar.gz: 4da281ecbb7a6635387196d519ea775ff6cdfd899c2924cc2629b1a5a978b1ce
2
+ SHA1:
3
+ metadata.gz: ba4ec764772f241f23b6377c0fe39a1de964bbfa
4
+ data.tar.gz: 2b907c93c2ea597ddd46c2f677e077db4c2d2117
5
5
  SHA512:
6
- metadata.gz: f7b8ae8c70b6f10abcd3e94a5b482b297afae532ef83eee08d6a244a716d830a29febaf8e3c3ad632cb2b54f7cb826e2682def14888f29d3f104302447ac1317
7
- data.tar.gz: 0f98e14b0d9eeef2943fb1e6e39178876860a9ce0d9cdd4ea62faa75d6166afea11e12153a78dd82a24a0973780e153f12f21aa5b46a0195b21e3214323074b8
6
+ metadata.gz: 5f89b54ead1e9a4bc6cb7420fdd50d30579a4584d65c4ff410f8e2d0a11c55776accc2f3cadddfb7418687154b5af1fd0e69bad4035b25f17fb603ab954be8b0
7
+ data.tar.gz: 82cda078425b07e0526a270c1e8ee1175d2efad7f49caac7bd1f67bf784e50a7ddf8a122bdbd04b91cfdcfd728655d816d2a0707e2f5c6737b1b476548ada6e3
data/README.md CHANGED
@@ -77,14 +77,14 @@ NineOneOne.notify('Something happened!')
77
77
  NineOneOne.notify({attachments: [{title: 'Something happened!', text: 'More info'}]})
78
78
 
79
79
  # Send pager or log emergency using logger depending on the `send_pagers` config parameter
80
- NineOneOne.emergency('Emergency message!', 'Error source info', details_hash: { optional_hash: 'with details' })
80
+ NineOneOne.emergency('Emergency message!', details_hash: { optional_hash: 'with details' })
81
81
 
82
82
  # Send multiple pagers that will be grouped into one incident
83
- NineOneOne.emergency('Emergency message!', 'Error source info', dedup_key: 'Kinda unique key')
83
+ NineOneOne.emergency('Emergency message!', dedup_key: 'Kinda unique key')
84
84
 
85
85
  # same for custom configurations
86
86
  NineOneOne.use(:my_custom_configuration).notify('Something happened!')
87
- NineOneOne.use(:my_custom_configuration).emergency('Emergency message!', 'Error source info', details_hash: { optional_hash: 'with details' })
87
+ NineOneOne.use(:my_custom_configuration).emergency('Emergency message!', details_hash: { optional_hash: 'with details' })
88
88
  ```
89
89
 
90
90
  ## Development
@@ -4,8 +4,8 @@ module NineOneOne
4
4
  @logger = logger
5
5
  end
6
6
 
7
- def trigger_event(description, source, details_hash, severity)
8
- logger.error "TRIGGERED INCIDENT (#{severity}): #{description} | #{details_hash} | #{source}"
7
+ def trigger_event(description, details_hash)
8
+ logger.error("TRIGGERED INCIDENT: #{description} (#{details_hash})")
9
9
  end
10
10
 
11
11
  def notify(message)
@@ -7,7 +7,7 @@ module NineOneOne
7
7
  def emergency(description, source: Socket.gethostname, dedup_key: nil,
8
8
  severity: PagerDutyService::HIGH_URGENCY_ERROR, details_hash: nil)
9
9
  emergency_service.trigger_event(description, source: source, dedup_key: dedup_key, severity: severity,
10
- details_hash: details_hash)
10
+ details_hash: details_hash)
11
11
  end
12
12
 
13
13
  def notify(message)
@@ -24,8 +24,7 @@ module NineOneOne
24
24
 
25
25
  def notification_service
26
26
  if config.slack_enabled
27
- SlackService.new(config.slack_webhook_url, username: config.slack_username,
28
- channel: config.slack_channel)
27
+ SlackService.new(config.slack_webhook_url, username: config.slack_username, channel: config.slack_channel)
29
28
  else
30
29
  LogService.new(config.logger)
31
30
  end
@@ -11,7 +11,7 @@ module NineOneOne
11
11
 
12
12
  def notify(message)
13
13
  body = request_body(message)
14
- headers = {'Content-Type' => 'application/json'}
14
+ headers = { 'Content-Type' => 'application/json' }
15
15
  http.post(path, body, headers)
16
16
  end
17
17
 
@@ -20,7 +20,7 @@ module NineOneOne
20
20
  attr_reader :channel, :http, :path, :username
21
21
 
22
22
  def request_body(message)
23
- body = message.is_a?(Hash) ? message : {text: message}
23
+ body = message.is_a?(Hash) ? message : { text: message }
24
24
  body[:channel] = channel unless channel.nil?
25
25
  body[:username] = username unless username.nil?
26
26
 
@@ -1,3 +1,3 @@
1
1
  module NineOneOne
2
- VERSION = '2.0.3'.freeze
2
+ VERSION = '2.0.4'.freeze
3
3
  end
data/lib/nine_one_one.rb CHANGED
@@ -30,8 +30,7 @@ module NineOneOne
30
30
  def self.emergency(description, source: Socket.gethostname, dedup_key: nil,
31
31
  severity: PagerDutyService::HIGH_URGENCY_ERROR, details_hash: nil)
32
32
  use(:default).emergency(description, source: source, dedup_key: dedup_key, severity: severity,
33
- details_hash: details_hash)
34
-
33
+ details_hash: details_hash)
35
34
  end
36
35
 
37
36
  def self.notify(message)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nine_one_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kacper Madej
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-07-25 00:00:00.000000000 Z
12
+ date: 2018-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  requirements: []
216
216
  rubyforge_project:
217
- rubygems_version: 2.7.6
217
+ rubygems_version: 2.6.11
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: Alerts and notifications via PagerDuty and Slack for Ruby apps