danger-slack 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/slack/gem_version.rb +1 -1
- data/lib/slack/plugin.rb +9 -0
- data/spec/slack_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a76c1f3b065e285ee87c64d1e361105c9b44b399
|
4
|
+
data.tar.gz: bf53cec328fb659ae6e122b56a8d8bf5e44cc91b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 803f424570cd1123aae8648de3cc5c6d5825b191ff614425297bcc1736242d50a85d6d251463724fec66b81d812973fad35ee82f4a504377aa01efbec2f7b6de
|
7
|
+
data.tar.gz: 30acec9553b90ced943897895715577f48f4da3360726efea008538fffb1072bc9405c99e25f81bf0bd4f9a2928a1ce39f7e943409ff4a1dcd0fd58e6f75acf3
|
data/README.md
CHANGED
data/lib/slack/gem_version.rb
CHANGED
data/lib/slack/plugin.rb
CHANGED
@@ -51,6 +51,15 @@ module Danger
|
|
51
51
|
Array(JSON.parse(res.body)['channels'])
|
52
52
|
end
|
53
53
|
|
54
|
+
# get slack team groups (private channels)
|
55
|
+
# For more information, see also http://api.slack.com/methods/groups.list
|
56
|
+
#
|
57
|
+
# @return [[Hash]]
|
58
|
+
def groups
|
59
|
+
res = @conn.get 'groups.list', token: @api_token
|
60
|
+
Array(JSON.parse(res.body)['groups'])
|
61
|
+
end
|
62
|
+
|
54
63
|
# notify to Slack
|
55
64
|
#
|
56
65
|
# @param [String] channel
|
data/spec/slack_spec.rb
CHANGED
@@ -40,6 +40,16 @@ module Danger
|
|
40
40
|
expect(@my_plugin.channels).to eq [{ 'hoge' => 'fuga' }]
|
41
41
|
end
|
42
42
|
|
43
|
+
it 'groups' do
|
44
|
+
stub_request(:get, 'https://slack.com/api/groups.list')
|
45
|
+
.with(query: { token: 'hoge' })
|
46
|
+
.to_return(
|
47
|
+
body: '{"groups":[{"hoge":"fuga"}]}',
|
48
|
+
status: 200
|
49
|
+
)
|
50
|
+
expect(@my_plugin.groups).to eq [{ 'hoge' => 'fuga' }]
|
51
|
+
end
|
52
|
+
|
43
53
|
it 'notify with text' do
|
44
54
|
stub_request(:post, 'https://slack.com/api/chat.postMessage')
|
45
55
|
.with(query: hash_including(token: 'hoge'))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shunsuke maeda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|