microsoft_teams_incoming_webhook_ruby 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: 39b4271906654ad2de7ff8ec2498b3aff1fd06254d2907cf2c7057ce56953b2c
4
- data.tar.gz: f0aafd0aa31ef6f89e9d757754006bd02a96eab0771cfe79469df497b8fb4558
3
+ metadata.gz: bcd7a6c0a9d8ea6bd4b3976f79228ad531a1b197cda04651d61cb52eca8bc1d8
4
+ data.tar.gz: edf51a1ce9e09fbe251ea346f404cea4590e963cd191fecb9894bff3eebc0178
5
5
  SHA512:
6
- metadata.gz: 9378f2e20942e2b655e11f3d7f0fb185f20f21086e2ddb4a593824bdd308dbfb4286107965f1b10fc9e6507ab81bfd632be8d9d2a0541e141610f0798b377d6e
7
- data.tar.gz: 6560b0e12bcd0787255fc63351cecc2e71700caa4d30665426f1b853415c7a05a7736e8b56fb96d47c4667311084c289c596b141c622ce38e7bfeacd87451be4
6
+ metadata.gz: 528b547f7cffc24ef983e8da8cb6d24ed199708c7f8886aea3fd9116c2eb45a2bb91edd496dd587cb0ea9d07b9867f43fa7dde35edff8034d92e80e27f84f759
7
+ data.tar.gz: c01e7874cef3041c89bba79548d447b071cd606da990d0c1b4add89e79b6428fd98b27e259622d6971766f676efb677dd2615eed09e592f53d8c396dc3adf8c6
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [1.0.0] - 2021-09-XX
3
+ ## [1.0.1] - 2021-09-25
4
+
5
+ - Documentation improvements
6
+ - Gemspec fixes
7
+ - Disable SSL verification
8
+
9
+ ## [1.0.0] - 2021-09-25
4
10
 
5
11
  - Initial release
6
12
  - Setup of automation for rubygems publishing
data/README.md CHANGED
@@ -37,7 +37,7 @@ gem install microsoft_teams_incoming_webhook_ruby
37
37
 
38
38
  ### Configuration of Incoming Webhook connector on your Teams channels
39
39
 
40
- The first step before using this gem is to configure the connector inside your Team channels.
40
+ The first step before using this gem is to configure the connector inside your Teams channels.
41
41
 
42
42
  For this purpose, please check the official documentation from Microsoft. It's listed below some useful links:
43
43
 
@@ -57,7 +57,7 @@ Once you have configured Incoming Webhook inside your Teams channels, you can se
57
57
  require 'microsoft_teams_incoming_webhook_ruby'
58
58
 
59
59
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
60
- m.url = 'YOUR INCOMING WEBHOOK URL HERE'
60
+ m.url = 'YOUR INCOMING WEBHOOK URL HERE'
61
61
  m.text = 'Hello World!'
62
62
  end
63
63
 
@@ -85,8 +85,6 @@ The Microsoft Incoming Webhook API allows us to send a variety of fields, that w
85
85
 
86
86
  Because of this, the gem will not enforce any schema in message structure. The only required parameters are `url` and `text`. Any other options will be accepted, considering that Microsoft Incoming Webhook API accepts it.
87
87
 
88
- ### Configuration of message structure lately of initialization
89
-
90
88
  The message structure and its fields can be defined in two moments:
91
89
 
92
90
  - Initialization of `MicrosoftTeamsIncomingWebhookRuby::Message` object
@@ -102,42 +100,40 @@ Below there are some examples of this manipulation:
102
100
  require 'microsoft_teams_incoming_webhook_ruby'
103
101
 
104
102
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
105
- m.url = 'YOUR INCOMING WEBHOOK URL HERE'
106
- m.text = 'Hello World!'
107
-
108
- m.my_arbitrary_field = 'My value'
103
+ m.url = 'YOUR INCOMING WEBHOOK URL HERE'
104
+ m.text = 'Hello World!'
105
+ m.my_arbitrary_field = 'My value'
109
106
  m.my_another_arbitrary_field = { my: 'value' }
110
107
  end
111
108
 
112
109
  message.send
113
110
  ```
114
111
 
115
- - Adding of attribute after object initialization, but before `send` method call
112
+ - Addition of attribute after object initialization, but before `send` method call
116
113
 
117
114
  ```ruby
118
115
  require 'microsoft_teams_incoming_webhook_ruby'
119
116
 
120
117
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
121
- m.url = 'YOUR INCOMING WEBHOOK URL HERE'
118
+ m.url = 'YOUR INCOMING WEBHOOK URL HERE'
122
119
  m.text = 'Hello World!'
123
120
  end
124
121
 
125
- message.builder.my_arbitrary_field = 'My value'
122
+ message.builder.my_arbitrary_field = 'My value'
126
123
  message.builder.my_another_arbitrary_field = { my: 'value' }
127
124
 
128
125
  message.send
129
126
  ```
130
127
 
131
- - Removing of attributes after object initialization, but before `send` method call
128
+ - Remotion of attributes after object initialization, but before `send` method call
132
129
 
133
130
  ```ruby
134
131
  require 'microsoft_teams_incoming_webhook_ruby'
135
132
 
136
133
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
137
- m.url = 'YOUR INCOMING WEBHOOK URL HERE'
138
- m.text = 'Hello World!'
139
-
140
- m.my_custom_field = 'My custom value'
134
+ m.url = 'YOUR INCOMING WEBHOOK URL HERE'
135
+ m.text = 'Hello World!'
136
+ m.my_custom_field = 'My custom value'
141
137
  end
142
138
 
143
139
  message.builder.delete_field :my_custom_field
@@ -145,16 +141,15 @@ message.builder.delete_field :my_custom_field
145
141
  message.send
146
142
  ```
147
143
 
148
- - Redefing of attributes after object initialization, but before `send` method call
144
+ - Redefinition of attributes after object initialization, but before `send` method call
149
145
 
150
146
  ```ruby
151
147
  require 'microsoft_teams_incoming_webhook_ruby'
152
148
 
153
149
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
154
- m.url = 'YOUR INCOMING WEBHOOK URL HERE'
155
- m.text = 'Hello World!'
156
-
157
- m.my_custom_field = 'My custom value'
150
+ m.url = 'YOUR INCOMING WEBHOOK URL HERE'
151
+ m.text = 'Hello World!'
152
+ m.my_custom_field = 'My custom value'
158
153
  end
159
154
 
160
155
  message.builder.my_custom_field = 'Updated value'
@@ -162,14 +157,14 @@ message.builder.my_custom_field = 'Updated value'
162
157
  message.send
163
158
  ```
164
159
 
165
- In case of keys that starts with **@**, is necessary to use brackets notation:
160
+ In case of keys that starts with **@**, it is necessary to use brackets notation:
166
161
 
167
162
  ```ruby
168
163
  require 'microsoft_teams_incoming_webhook_ruby'
169
164
 
170
165
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
171
- m.url = 'YOUR INCOMING WEBHOOK URL HERE'
172
- m.text = 'Hello World!'
166
+ m.url = 'YOUR INCOMING WEBHOOK URL HERE'
167
+ m.text = 'Hello World!'
173
168
  m['@my_field'] = 'Lorem ipsum'
174
169
  end
175
170
 
@@ -186,11 +181,11 @@ If the builder object turn itself invalid before invocation of `send` method, th
186
181
  require 'microsoft_teams_incoming_webhook_ruby'
187
182
 
188
183
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
189
- m.url = 'YOUR INCOMING WEBHOOK URL HERE'
190
- m.text = 'Hello World!'
184
+ m.url = 'YOUR INCOMING WEBHOOK URL HERE'
185
+ m.text = 'Hello World!'
191
186
  end
192
187
 
193
- message.delete_field :url
188
+ message.builder.delete_field :url
194
189
 
195
190
  begin
196
191
  message.send
@@ -217,8 +212,8 @@ If a non-successful response code be returned by API (1xx, 4xx or 5xx), the gem
217
212
  require 'microsoft_teams_incoming_webhook_ruby'
218
213
 
219
214
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
220
- m.url = 'YOUR INCOMING WEBHOOK URL HERE'
221
- m.text = 'My message'
215
+ m.url = 'YOUR INCOMING WEBHOOK URL HERE'
216
+ m.text = 'My message'
222
217
  end
223
218
 
224
219
  begin
@@ -250,7 +245,7 @@ require 'microsoft_teams_incoming_webhook_ruby'
250
245
  webhook_url = 'YOUR INCOMING WEBHOOK URL HERE'
251
246
 
252
247
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
253
- m.url = webhook_url
248
+ m.url = webhook_url
254
249
  m.text = 'Minimal message!'
255
250
  end
256
251
 
@@ -265,8 +260,8 @@ require 'microsoft_teams_incoming_webhook_ruby'
265
260
  webhook_url = 'YOUR INCOMING WEBHOOK URL HERE'
266
261
 
267
262
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
268
- m.url = webhook_url
269
- m.text = 'Message with theme color!'
263
+ m.url = webhook_url
264
+ m.text = 'Message with theme color!'
270
265
  m.themeColor = 'FF0000'
271
266
  end
272
267
 
@@ -281,9 +276,9 @@ require 'microsoft_teams_incoming_webhook_ruby'
281
276
  webhook_url = 'YOUR INCOMING WEBHOOK URL HERE'
282
277
 
283
278
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
284
- m.url = webhook_url
285
- m.text = 'Message with title!'
286
- m.title = 'FF0000'
279
+ m.url = webhook_url
280
+ m.text = 'Message with title!'
281
+ m.title = 'My title'
287
282
  end
288
283
 
289
284
  message.send
@@ -297,8 +292,8 @@ require 'microsoft_teams_incoming_webhook_ruby'
297
292
  webhook_url = 'YOUR INCOMING WEBHOOK URL HERE'
298
293
 
299
294
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
300
- m.url = webhook_url
301
- m.text = 'Message with summary!'
295
+ m.url = webhook_url
296
+ m.text = 'Message with summary!'
302
297
  m.summary = 'My summary'
303
298
  end
304
299
 
@@ -313,8 +308,8 @@ require 'microsoft_teams_incoming_webhook_ruby'
313
308
  webhook_url = 'YOUR INCOMING WEBHOOK URL HERE'
314
309
 
315
310
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
316
- m.url = webhook_url
317
- m.text = 'Message with potential action!'
311
+ m.url = webhook_url
312
+ m.text = 'Message with potential action!'
318
313
  m.potentialAction = [
319
314
  {
320
315
  '@type': 'ActionCard',
@@ -365,8 +360,8 @@ require 'microsoft_teams_incoming_webhook_ruby'
365
360
  webhook_url = 'YOUR INCOMING WEBHOOK URL HERE'
366
361
 
367
362
  message = MicrosoftTeamsIncomingWebhookRuby::Message.new do |m|
368
- m.url = webhook_url
369
- m.text = 'Message with sections!'
363
+ m.url = webhook_url
364
+ m.text = 'Message with sections!'
370
365
  m.sections = [
371
366
  {
372
367
  'text': 'Lorem ipsum vastium',
@@ -407,6 +402,7 @@ There are similar and great open source libraries that shares the same purpose o
407
402
  - https://github.com/shirts/microsoft-teams-ruby
408
403
  - https://github.com/oooooooo/msteams-ruby-client
409
404
  - https://github.com/eduardolagares/msteams_webhook
405
+ - https://github.com/adventistmedia/msteams_notifier
410
406
 
411
407
  ## Contributing
412
408
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'net/http'
4
4
  require 'json'
5
+ require 'openssl'
5
6
 
6
7
  module MicrosoftTeamsIncomingWebhookRuby
7
8
  class Message
@@ -41,9 +42,10 @@ module MicrosoftTeamsIncomingWebhookRuby
41
42
  end
42
43
 
43
44
  def send_by_http
44
- uri = URI.parse(@builder.url)
45
- http = Net::HTTP.new(uri.host, uri.port)
46
- http.use_ssl = true
45
+ uri = URI.parse(@builder.url)
46
+ http = Net::HTTP.new(uri.host, uri.port)
47
+ http.use_ssl = true
48
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
47
49
  http.post(uri.path, @builder.to_h.to_json, 'Content-Type': 'application/json')
48
50
  end
49
51
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MicrosoftTeamsIncomingWebhookRuby
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
@@ -14,15 +14,11 @@ Gem::Specification.new do |spec|
14
14
  spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
15
15
  spec.metadata["homepage_uri"] = spec.homepage
16
16
  spec.metadata["source_code_uri"] = spec.homepage
17
- spec.metadata["changelog_uri"] = "#{spec.homepage}/CHANGELOG.md"
18
-
19
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
- end
22
-
23
- spec.bindir = 'exe'
24
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
- spec.require_paths = ['lib']
17
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
18
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) { `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } }
19
+ spec.bindir = 'exe'
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ['lib']
26
22
 
27
23
  spec.add_development_dependency 'rake'
28
24
  spec.add_development_dependency 'rspec'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: microsoft_teams_incoming_webhook_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Furtado
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-25 00:00:00.000000000 Z
11
+ date: 2021-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -112,7 +112,7 @@ licenses:
112
112
  metadata:
113
113
  homepage_uri: https://github.com/pedrofurtado/microsoft_teams_incoming_webhook_ruby
114
114
  source_code_uri: https://github.com/pedrofurtado/microsoft_teams_incoming_webhook_ruby
115
- changelog_uri: https://github.com/pedrofurtado/microsoft_teams_incoming_webhook_ruby/CHANGELOG.md
115
+ changelog_uri: https://github.com/pedrofurtado/microsoft_teams_incoming_webhook_ruby/blob/master/CHANGELOG.md
116
116
  post_install_message:
117
117
  rdoc_options: []
118
118
  require_paths: