hangouts-chat 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +7 -4
- data/lib/hangouts_chat/http.rb +1 -2
- data/lib/hangouts_chat/version.rb +1 -1
- data/test/hangouts_chat_test.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beff61be4ee8a8cf2e9dfbc44da4356fb38a438607a98ed037e0aefbc36c4fb1
|
4
|
+
data.tar.gz: 3db614404c6eee2370b2cc9267b637053d5a752b15cefa0e5a1d1b4697e42b85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2687dd752dd9f722dd6752ad16ed797873376ae94f1154d6c6947c0847fd6f4142f850c0a91609363d89a9d8ae7cb7f1601264733626ac605048212bb0924ae9
|
7
|
+
data.tar.gz: 76147f6d6fa2d58b410e8bea6bc8049fd49b6fe0729bb5aa4b7b5a84cd2b89f1a6202eb349e4356582b340d089cf55e01318e2552ba95bf0fc5691eef96fde33
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -13,11 +13,14 @@ $ gem install hangouts-chat
|
|
13
13
|
|
14
14
|
or add to your Gemfile
|
15
15
|
|
16
|
-
```
|
17
|
-
|
16
|
+
```
|
17
|
+
gem 'hangouts-chat'
|
18
18
|
```
|
19
19
|
|
20
20
|
## Usage
|
21
|
+
```ruby
|
22
|
+
require 'hangouts_chat'
|
23
|
+
```
|
21
24
|
### Simple Text Message
|
22
25
|
Simple messages that appear inline as if typed by a user. Details and format: [Simple Text Messages](https://developers.google.com/hangouts/chat/reference/message-formats/basic)
|
23
26
|
```ruby
|
@@ -32,8 +35,8 @@ sender = HangoutsChat::Sender.new 'webhook_URL'
|
|
32
35
|
header = { title: 'Pizza Bot Customer Support',
|
33
36
|
subtitle: 'pizzabot@example.com',
|
34
37
|
imageUrl: 'https://goo.gl/aeDtrS' }
|
35
|
-
sections = [{ keyValue: { topLabel: 'Order No.', content: '12345' } },
|
36
|
-
|
38
|
+
sections = [{ widgets: [{ keyValue: { topLabel: 'Order No.', content: '12345' } },
|
39
|
+
{ keyValue: { topLabel: 'Status', content: 'In Delivery' } }] }]
|
37
40
|
|
38
41
|
sender.card(header, sections)
|
39
42
|
```
|
data/lib/hangouts_chat/http.rb
CHANGED
@@ -22,10 +22,9 @@ module HangoutsChat
|
|
22
22
|
def post(payload)
|
23
23
|
@req.body = payload.to_json
|
24
24
|
|
25
|
-
|
25
|
+
Net::HTTP.start(@uri.hostname, @uri.port, :ENV, use_ssl: true) do |http|
|
26
26
|
http.request(@req)
|
27
27
|
end
|
28
|
-
res
|
29
28
|
end
|
30
29
|
end
|
31
30
|
end
|
data/test/hangouts_chat_test.rb
CHANGED
@@ -29,8 +29,8 @@ class HangoutsChatTest < Minitest::Test
|
|
29
29
|
header = { title: 'Pizza Bot Customer Support',
|
30
30
|
subtitle: 'pizzabot@example.com',
|
31
31
|
imageUrl: 'https://goo.gl/aeDtrS' }
|
32
|
-
sections = [{ keyValue: { topLabel: 'Order No.', content: '12345' } },
|
33
|
-
|
32
|
+
sections = [{ widgets: [{ keyValue: { topLabel: 'Order No.', content: '12345' } },
|
33
|
+
{ keyValue: { topLabel: 'Status', content: 'In Delivery' } }] }]
|
34
34
|
|
35
35
|
@sender.card(header, sections)
|
36
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hangouts-chat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- enzinia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|