sensu-plugins-slack 1.1.0 → 1.1.1

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: 69f0b3777097fb1a163e2e5f07b1f3e91acfa5b2
4
- data.tar.gz: fddcfcbf75a6938e24357c7fa73c3b2b8d7c0270
3
+ metadata.gz: 9db07df331e402395365319e4772798ce55f79ba
4
+ data.tar.gz: 5c44de22dd791ddf483ddcb9b355721cb7cef070
5
5
  SHA512:
6
- metadata.gz: 4b9ac03a6e9e46669b0cf015f82cf2a5f4c8dbf9fa600f278205b6411c46ba79dbed45d870037fd727d19183f3262ddac47287f1f97279dc57f7d68fcdc7f2bc
7
- data.tar.gz: dd166527f1daa5174251018b62daa97b79972c634bf525acc3fea43fd3b6b07e3697f059c1bed16f5524eab62c96062ba5f7fc26bb3f066f230c122333e6f013
6
+ metadata.gz: 74fb4ba744491325b6c151329c95cb727d3bb392044d7c95fd91a745066ba387dd61e84b5c4839bf23d226ca73f2206669e8c95250d25b72d794789391dde230
7
+ data.tar.gz: 021347360047ba11bc4e35aa86e8c6f32f897dc7a69377a0b97dc008801bc231735280c691ebdb01df773bd26f6a184529a9fb795d98b29bfa3bd062e3609aac
@@ -5,6 +5,12 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.1.1] - 2017-06-24
9
+ ### Fixed
10
+ - Ran rubocop against `bin/slack-handler.rb` and `bin/slack-handler-multichannel.rb` (@pgporada)
11
+ - Fixed occurrences of http:// needing to be https:// by default (@pgporada)
12
+ - Fixed the location of the Sensu image that gets pulled in (@pgporada)
13
+
8
14
  ## [1.1.0] - 2017-06-22
9
15
  ### Added
10
16
  - `slack-handler-multichannel.rb`: Add title line to mirror functionality of slack-handler.rb (@zer0nimbus)
@@ -74,7 +80,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
74
80
  ### Added
75
81
  - initial release
76
82
 
77
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.1.0...HEAD
83
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.1.1...HEAD
84
+ [1.1.1]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.1.0...1.1.1.
78
85
  [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.0.0...1.1.0
79
86
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/v0.1.2...1.0.0
80
87
  [0.1.2]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/0.1.1...v0.1.2
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ## Sensu-Plugins-slack
2
2
 
3
3
  [![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-slack.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-slack)
4
- [![Gem Version](https://badge.fury.io/rb/sensu-plugins-slack.svg)](http://badge.fury.io/rb/sensu-plugins-slack)
4
+ [![Gem Version](https://badge.fury.io/rb/sensu-plugins-slack.svg)](https://badge.fury.io/rb/sensu-plugins-slack)
5
5
  [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack)
6
6
  [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack)
7
7
  [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-slack.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-slack)
@@ -29,7 +29,7 @@
29
29
  "proxy_port": "The HTTP proxy port (if there is a proxy)",
30
30
  "proxy_username": "The HTTP proxy username (if there is a proxy)",
31
31
  "proxy_password": "The HTTP proxy user password (if there is a proxy)",
32
- "icon_url": "http://sensuapp.org/img/sensu_logo_large-c92d73db.png",
32
+ "icon_url": "https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png",
33
33
  "icon_emoji": ":snowman:",
34
34
  "fields": [
35
35
  "list",
@@ -44,7 +44,7 @@
44
44
 
45
45
  ## Installation
46
46
 
47
- [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
47
+ [Installation and Setup](https://sensu-plugins.io/docs/installation_instructions.html)
48
48
 
49
49
  ## Notes
50
50
 
@@ -61,6 +61,10 @@ class Slack < Sensu::Handler
61
61
  get_setting('template') || get_setting('message_template')
62
62
  end
63
63
 
64
+ def slack_icon_url
65
+ get_setting('icon_url')
66
+ end
67
+
64
68
  def slack_webhook_url
65
69
  get_setting('webhook_url')
66
70
  end
@@ -170,18 +174,18 @@ class Slack < Sensu::Handler
170
174
  end
171
175
 
172
176
  def build_description
173
- if message_template && File.readable?(message_template)
174
- template = File.read(message_template)
175
- else
176
- template = '''<%=
177
- [
178
- @event["check"]["output"].gsub(\'"\', \'\\"\'),
179
- @event["client"]["address"],
180
- @event["client"]["subscriptions"].join(",")
181
- ].join(" : ")
182
- %>
183
- '''
184
- end
177
+ template = if message_template && File.readable?(message_template)
178
+ File.read(message_template)
179
+ else
180
+ '''<%=
181
+ [
182
+ @event["check"]["output"].gsub(\'"\', \'\\"\'),
183
+ @event["client"]["address"],
184
+ @event["client"]["subscriptions"].join(",")
185
+ ].join(" : ")
186
+ %>
187
+ '''
188
+ end
185
189
  eruby = Erubis::Eruby.new(template)
186
190
  eruby.result(binding)
187
191
  end
@@ -228,7 +232,7 @@ class Slack < Sensu::Handler
228
232
 
229
233
  def payload(notice, channel)
230
234
  {
231
- icon_url: 'http://sensuapp.org/img/sensu_logo_large-c92d73db.png',
235
+ icon_url: slack_icon_url ? slack_icon_url : 'https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png',
232
236
  attachments: [{
233
237
  title: "#{@event['client']['address']} - #{translate_status}",
234
238
  text: [slack_message_prefix, notice].compact.join(' '),
@@ -107,18 +107,18 @@ class Slack < Sensu::Handler
107
107
  end
108
108
 
109
109
  def build_description
110
- if message_template && File.readable?(message_template)
111
- template = File.read(message_template)
112
- else
113
- template = '''<%=
114
- [
115
- @event["check"]["output"].gsub(\'"\', \'\\"\'),
116
- @event["client"]["address"],
117
- @event["client"]["subscriptions"].join(",")
118
- ].join(" : ")
119
- %>
120
- '''
121
- end
110
+ template = if message_template && File.readable?(message_template)
111
+ File.read(message_template)
112
+ else
113
+ '''<%=
114
+ [
115
+ @event["check"]["output"].gsub(\'"\', \'\\"\'),
116
+ @event["client"]["address"],
117
+ @event["client"]["subscriptions"].join(",")
118
+ ].join(" : ")
119
+ %>
120
+ '''
121
+ end
122
122
  eruby = Erubis::Eruby.new(template)
123
123
  eruby.result(binding)
124
124
  end
@@ -171,7 +171,7 @@ class Slack < Sensu::Handler
171
171
  end
172
172
 
173
173
  {
174
- icon_url: slack_icon_url ? slack_icon_url : 'http://sensuapp.org/img/sensu_logo_large-c92d73db.png',
174
+ icon_url: slack_icon_url ? slack_icon_url : 'https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png',
175
175
  attachments: [{
176
176
  title: "#{@event['client']['address']} - #{translate_status}",
177
177
  text: [slack_message_prefix, notice].compact.join(' '),
@@ -2,7 +2,7 @@ module SensuPluginsSlack
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-slack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-23 00:00:00.000000000 Z
11
+ date: 2017-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis