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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e678871afb7cf5d4e36e29f7fb6b48c6f17e8946
4
- data.tar.gz: b21737558133b510cc426822004dcfefc6ab0323
3
+ metadata.gz: a76c1f3b065e285ee87c64d1e361105c9b44b399
4
+ data.tar.gz: bf53cec328fb659ae6e122b56a8d8bf5e44cc91b
5
5
  SHA512:
6
- metadata.gz: 74684cd390d1d6437c9c7e113930b51a3fb57b8af60904e9032fa680f0d90040f73cd00461d58eb8eb612fd2ad09fd42d91160659eb0c6ad7c695055d597f45d
7
- data.tar.gz: '09d99fa0c7e8f7268fbfdc5ac99be54beaa3e56d64a235583c316b1a410b615f66c6fce8d42d4de33bfca1a88ca2ed74c9620e340951d523f5115ff0f964ad85'
6
+ metadata.gz: 803f424570cd1123aae8648de3cc5c6d5825b191ff614425297bcc1736242d50a85d6d251463724fec66b81d812973fad35ee82f4a504377aa01efbec2f7b6de
7
+ data.tar.gz: 30acec9553b90ced943897895715577f48f4da3360726efea008538fffb1072bc9405c99e25f81bf0bd4f9a2928a1ce39f7e943409ff4a1dcd0fd58e6f75acf3
data/README.md CHANGED
@@ -28,6 +28,11 @@ Get members
28
28
  slack.members
29
29
  ```
30
30
 
31
+ Get groups
32
+ ```ruby
33
+ slack.groups
34
+ ```
35
+
31
36
  Notify danger reports to slack
32
37
  ```ruby
33
38
  slack.notify(channel: '#your_channel')
@@ -1,3 +1,3 @@
1
1
  module Slack
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
@@ -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
@@ -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.2
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-03-30 00:00:00.000000000 Z
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