dev_training_bot 1.0.5 → 1.1.0

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: 87b2d3b23fe88e777a8b8415ed5b78c9868e1819413ab0d0a33493eb7396be0e
4
- data.tar.gz: 281281bf8936e52ddd00143eaf3402c841d8b78e44f0ade8c1469f7506dcde8a
3
+ metadata.gz: 35194d81f801d6bffaf4cd64320d3aef488681087d12f1ff40af5268494a92ef
4
+ data.tar.gz: ecbaef26de77f59111412a27ba519f7bb92d2c9b732993cd96e94a449c0b51d8
5
5
  SHA512:
6
- metadata.gz: 7774d8dc188f35d27ca522397076a2f02ec15388a23beeda2ad5a753e89625be519c5271e43590ce4535d7bcc001bb253a0719a80eae9dd237e79a2135367495
7
- data.tar.gz: f1bc68e7d4fb6cd01ca297d328cd858b5f2a5f3eaa592d3df11e328bb84cdc1cf0cc4fee9ce2db1dd3c729f995e57bbf6268e763b80a950d82f52a515f59ed6e
6
+ metadata.gz: 0ef9ad25829c9fe845c752e76feedce616b745c1219ef46825a3d9de06694391780f656df69c54c41bc97bd6966e77d642ee75ab8bf180088404e642f469f838
7
+ data.tar.gz: d546749b38dc56c1a5163af8757e9a868bc83815271238dac941543e3e1116ee8dbf075dab67256795dcefbd6b207ef9004025c8e14140564ca37699e36fb59a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dev_training_bot (1.0.5)
4
+ dev_training_bot (1.1.0)
5
5
  chronic (~> 0.10)
6
6
  google-api-client (~> 0.23)
7
7
  launchy (~> 2.4)
@@ -171,4 +171,4 @@ DEPENDENCIES
171
171
  webmock (~> 3.4)
172
172
 
173
173
  BUNDLED WITH
174
- 1.16.2
174
+ 1.16.3
data/README.md CHANGED
@@ -18,6 +18,7 @@ Generate a [token](https://api.slack.com/custom-integrations/legacy-tokens) for
18
18
  Configure the following environment variables:
19
19
  ```sh
20
20
  CLIENT_SECRETS_PATH="$HOME/.client_secrets.json"
21
+ CLIENT_TOKEN_PATH="$HOME/.token.yaml"
21
22
  FILE_ID=<Google Docs file id>
22
23
  SLACK_API_TOKEN=<your slack user token>
23
24
  SLACK_CHANNEL="#your_channel"
@@ -32,8 +32,13 @@ module DevTrainingBot
32
32
  end
33
33
 
34
34
  desc 'publish', "Send a poll to the #{ENV['SLACK_CHANNEL']} channel"
35
+ method_option :exclude,
36
+ aliases: '-e',
37
+ type: :array,
38
+ desc: 'Exclude authors from the final list'
35
39
  def publish
36
- slack_service.create_poll(topic_service.to_poll)
40
+ topics = topic_service.to_poll(exclude: options[:exclude])
41
+ slack_service.create_poll(topics)
37
42
  slack_service.link_doc
38
43
  say 'Successfully published the poll!', :green
39
44
  end
@@ -6,7 +6,7 @@ module DevTrainingBot
6
6
  OOB_URI = 'urn:ietf:wg:oauth:2.0:oob'.freeze
7
7
  APPLICATION_NAME = 'Dev Training Bot'.freeze
8
8
  CLIENT_SECRETS_PATH = ENV['CLIENT_SECRETS_PATH'].freeze
9
- CREDENTIALS_PATH = 'token.yaml'.freeze
9
+ CREDENTIALS_PATH = ENV['CLIENT_TOKEN_PATH'].freeze
10
10
  SCOPE = Google::Apis::DriveV3::AUTH_DRIVE_READONLY
11
11
  DOC_URL = "https://docs.google.com/document/d/#{ENV['FILE_ID']}".freeze
12
12
  FORMATS = {
@@ -7,9 +7,9 @@ module DevTrainingBot
7
7
  @drive_service = drive_service
8
8
  end
9
9
 
10
- def to_poll
10
+ def to_poll(exclude: [])
11
11
  return '' if empty?
12
- "\"#{topics.first(10).join('" "')}\""
12
+ "\"#{topics.reject { |topic| topic.author.in?(exclude) }.first(10).join('" "')}\""
13
13
  end
14
14
 
15
15
  def content
@@ -1,3 +1,3 @@
1
1
  module DevTrainingBot
2
- VERSION = '1.0.5'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_training_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Marchante
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-03 00:00:00.000000000 Z
11
+ date: 2018-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic