slack-ruby-client 0.7.4 → 0.7.5

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: df64328580f69c890ab8fabff98767786d92b37a
4
- data.tar.gz: 4c5ced46b270d5e67295043384bf598cb743c985
3
+ metadata.gz: 0ab20727bd044312d8d72e75e0446f5eeaaa8c4e
4
+ data.tar.gz: 327b7d49adb97983d7af8a2e6ce15d1652af8a83
5
5
  SHA512:
6
- metadata.gz: 64ca4a04c88a505476b2142fc5054d2560f79ce1fc82303631b5a5baeeab54456ed1edbcfe170489233a0c6e362d83ea1661b3dde3f248ea0d283fc17c9cf8f8
7
- data.tar.gz: afacac026a07847c3f4a0e79f8944d7f2a3d2442f7dad8c46cb1b39740749d6a30b6805769d59f17bf517fc100f01e5cc777eb30a7cd13f84f8f5b727bbb6590
6
+ metadata.gz: 27b9213982435f94b5b5688a592f9d6cd9d826766b960c31136c82394fd4af69d7f2ad31864d6de0073132ad3f3f2d6fbbbe5a404a7f94315854911172564f8c
7
+ data.tar.gz: 006f4ca17f893d53f989aaf6e9a739a45e3d505dec9e986fc838d4aa4a6b65e772611fa4a1ef0ef98d0752277c8fd4e2db9a60846b022f399cb89a2508f84de5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 0.7.5 (6/27/2016)
2
+
3
+ * Added `bots_info` to Web API - [@dblock](https://github.com/dblock).
4
+ * Added `team_profile_get` and `team_billableInfo` to Web API - [@dblock](https://github.com/dblock).
5
+ * Added `chat_meMessage` to Web API - [@dblock](https://github.com/dblock), [@aaronpk](https://github.com/aaronpk).
6
+ * Added `users_profile_get` and `users_profile_set` to Web API - [@dblock](https://github.com/dblock).
7
+ * The `stars_list` method no longer takes a user - [@dblock](https://github.com/dblock).
8
+
1
9
  ### 0.7.4 (5/28/2016)
2
10
 
3
11
  * [#93](https://github.com/dblock/slack-ruby-client/pull/93): Fix: When using Celluloid concurrency, handle input from the TCP socket asynchronously from reading more. - [@benzrf](https://github.com/benzrf).
data/README.md CHANGED
@@ -14,11 +14,11 @@ A Ruby client for the Slack [Web](https://api.slack.com/web) and [RealTime Messa
14
14
  * This piece of the puzzle will help you send messages to Slack via the Web API and send and receive messages via the Real Time API.
15
15
  * If you're trying to respond to slash commands, just write a basic web application and use this library to call the Slack Web API.
16
16
  * If you're trying to build a Real Time bot, use [slack-ruby-bot](https://github.com/dblock/slack-ruby-bot), which uses this library.
17
- * If you're trying to roll out a full service with Slack button integration to multiple teams, check out [slack-bot-server](https://github.com/dblock/slack-bot-server), which is built on top of slack-ruby-bot, which uses this library.
17
+ * If you're trying to roll out a full service with Slack button integration to multiple teams, check out [slack-ruby-bot-server](https://github.com/dblock/slack-ruby-bot-server), which is built on top of slack-ruby-bot, which uses this library.
18
18
 
19
19
  ## Stable Release
20
20
 
21
- You're reading the documentation for the **stable** release of slack-ruby-client, 0.7.4. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
21
+ You're reading the documentation for the **next** release of slack-ruby-client. Please see the documentation for the [last stable release, v0.7.4](https://github.com/dblock/slack-ruby-client/blob/v0.7.4/README.md) unless you're integrating with HEAD. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
22
22
 
23
23
  ## Installation
24
24
 
@@ -0,0 +1,13 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ desc 'Bots methods.'
4
+ command 'bots' do |g|
5
+ g.desc 'This method returns information about a bot user.'
6
+ g.long_desc %( This method returns information about a bot user. )
7
+ g.command 'info' do |c|
8
+ c.flag 'bot', desc: 'Bot user to get info on.'
9
+ c.action do |_global_options, options, _args|
10
+ puts JSON.dump($client.bots_info(options))
11
+ end
12
+ end
13
+ end
data/bin/commands/chat.rb CHANGED
@@ -13,6 +13,16 @@ command 'chat' do |g|
13
13
  end
14
14
  end
15
15
 
16
+ g.desc 'This method sends a me message to a channel from the calling user.'
17
+ g.long_desc %( This method sends a me message to a channel from the calling user. )
18
+ g.command 'meMessage' do |c|
19
+ c.flag 'channel', desc: 'Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.'
20
+ c.flag 'text', desc: 'Text of the message to send.'
21
+ c.action do |_global_options, options, _args|
22
+ puts JSON.dump($client.chat_meMessage(options))
23
+ end
24
+ end
25
+
16
26
  g.desc 'This method posts a message to a public channel, private channel, or direct message/IM channel.'
17
27
  g.long_desc %( This method posts a message to a public channel, private channel, or direct message/IM channel. )
18
28
  g.command 'postMessage' do |c|
@@ -14,10 +14,9 @@ command 'stars' do |g|
14
14
  end
15
15
  end
16
16
 
17
- g.desc 'This method lists the items starred by a user.'
18
- g.long_desc %( This method lists the items starred by a user. )
17
+ g.desc 'This method lists the items starred by the authed user.'
18
+ g.long_desc %( This method lists the items starred by the authed user. )
19
19
  g.command 'list' do |c|
20
- c.flag 'user', desc: 'Show stars by this user. Defaults to the authed user.'
21
20
  c.action do |_global_options, options, _args|
22
21
  puts JSON.dump($client.stars_list(options))
23
22
  end
data/bin/commands/team.rb CHANGED
@@ -10,6 +10,15 @@ command 'team' do |g|
10
10
  end
11
11
  end
12
12
 
13
+ g.desc 'This method lists billable information for each user on the team. Currently this consists solely of whether the user is'
14
+ g.long_desc %( This method lists billable information for each user on the team. Currently this consists solely of whether the user is subject to billing per Slack's Fair Billing policy. )
15
+ g.command 'billableInfo' do |c|
16
+ c.flag 'user', desc: 'A user to retrieve the billable information for. Defaults to all users.'
17
+ c.action do |_global_options, options, _args|
18
+ puts JSON.dump($client.team_billableInfo(options))
19
+ end
20
+ end
21
+
13
22
  g.desc 'This method provides information about your team.'
14
23
  g.long_desc %( This method provides information about your team. )
15
24
  g.command 'info' do |c|
@@ -0,0 +1,13 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ desc 'TeamProfile methods.'
4
+ command 'team_profile' do |g|
5
+ g.desc 'This method is used to get the profile field definitions for this team.'
6
+ g.long_desc %( This method is used to get the profile field definitions for this team. )
7
+ g.command 'get' do |c|
8
+ c.flag 'visibility', desc: 'Filter by visibility.'
9
+ c.action do |_global_options, options, _args|
10
+ puts JSON.dump($client.team_profile_get(options))
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,26 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ desc 'UsersProfile methods.'
4
+ command 'users_profile' do |g|
5
+ g.desc 'This method is used to get the profile information for a user.'
6
+ g.long_desc %( This method is used to get the profile information for a user. )
7
+ g.command 'get' do |c|
8
+ c.flag 'user', desc: 'User to retrieve profile info for.'
9
+ c.flag 'include_labels', desc: 'Include labels for each ID in custom profile fields.'
10
+ c.action do |_global_options, options, _args|
11
+ puts JSON.dump($client.users_profile_get(options))
12
+ end
13
+ end
14
+
15
+ g.desc 'This method is used to set the profile information for a user.'
16
+ g.long_desc %( This method is used to set the profile information for a user. )
17
+ g.command 'set' do |c|
18
+ c.flag 'user', desc: 'ID of user to change. This argument may only be specified by team admins.'
19
+ c.flag 'profile', desc: 'Collection of key:value pairs presented as a URL-encoded JSON hash.'
20
+ c.flag 'name', desc: 'Name of a single key to set. Usable only if profile is not passed.'
21
+ c.flag 'value', desc: 'Value to set a single key to. Usable only if profile is not passed.'
22
+ c.action do |_global_options, options, _args|
23
+ puts JSON.dump($client.users_profile_set(options))
24
+ end
25
+ end
26
+ end
data/bin/commands.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'commands/api'
4
4
  require 'commands/auth'
5
+ require 'commands/bots'
5
6
  require 'commands/channels'
6
7
  require 'commands/chat'
7
8
  require 'commands/dnd'
@@ -19,6 +20,8 @@ require 'commands/rtm'
19
20
  require 'commands/search'
20
21
  require 'commands/stars'
21
22
  require 'commands/team'
23
+ require 'commands/team_profile'
22
24
  require 'commands/usergroups'
23
25
  require 'commands/usergroups_users'
24
26
  require 'commands/users'
27
+ require 'commands/users_profile'
data/lib/slack/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slack
2
- VERSION = '0.7.4'.freeze
2
+ VERSION = '0.7.5'.freeze
3
3
  end
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ module Slack
4
+ module Web
5
+ module Api
6
+ module Endpoints
7
+ module Bots
8
+ #
9
+ # This method returns information about a bot user.
10
+ #
11
+ # @option options [Object] :bot
12
+ # Bot user to get info on.
13
+ # @see https://api.slack.com/methods/bots.info
14
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/bots/bots.info.json
15
+ def bots_info(options = {})
16
+ post('bots.info', options)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -23,6 +23,21 @@ module Slack
23
23
  post('chat.delete', options)
24
24
  end
25
25
 
26
+ #
27
+ # This method sends a me message to a channel from the calling user.
28
+ #
29
+ # @option options [channel] :channel
30
+ # Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.
31
+ # @option options [Object] :text
32
+ # Text of the message to send.
33
+ # @see https://api.slack.com/methods/chat.meMessage
34
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.meMessage.json
35
+ def chat_meMessage(options = {})
36
+ throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
37
+ throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
38
+ post('chat.meMessage', options)
39
+ end
40
+
26
41
  #
27
42
  # This method posts a message to a public channel, private channel, or direct message/IM channel.
28
43
  #
@@ -25,14 +25,11 @@ module Slack
25
25
  end
26
26
 
27
27
  #
28
- # This method lists the items starred by a user.
28
+ # This method lists the items starred by the authed user.
29
29
  #
30
- # @option options [user] :user
31
- # Show stars by this user. Defaults to the authed user.
32
30
  # @see https://api.slack.com/methods/stars.list
33
31
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/stars/stars.list.json
34
32
  def stars_list(options = {})
35
- options = options.merge(user: users_id(options)['user']['id']) if options[:user]
36
33
  post('stars.list', options)
37
34
  end
38
35
 
@@ -14,6 +14,19 @@ module Slack
14
14
  post('team.accessLogs', options)
15
15
  end
16
16
 
17
+ #
18
+ # This method lists billable information for each user on the team. Currently this consists solely of whether the user is
19
+ # subject to billing per Slack's Fair Billing policy.
20
+ #
21
+ # @option options [user] :user
22
+ # A user to retrieve the billable information for. Defaults to all users.
23
+ # @see https://api.slack.com/methods/team.billableInfo
24
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/team/team.billableInfo.json
25
+ def team_billableInfo(options = {})
26
+ options = options.merge(user: users_id(options)['user']['id']) if options[:user]
27
+ post('team.billableInfo', options)
28
+ end
29
+
17
30
  #
18
31
  # This method provides information about your team.
19
32
  #
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ module Slack
4
+ module Web
5
+ module Api
6
+ module Endpoints
7
+ module TeamProfile
8
+ #
9
+ # This method is used to get the profile field definitions for this team.
10
+ #
11
+ # @option options [Object] :visibility
12
+ # Filter by visibility.
13
+ # @see https://api.slack.com/methods/team.profile.get
14
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/team.profile/team.profile.get.json
15
+ def team_profile_get(options = {})
16
+ post('team.profile.get', options)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,43 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ module Slack
4
+ module Web
5
+ module Api
6
+ module Endpoints
7
+ module UsersProfile
8
+ #
9
+ # This method is used to get the profile information for a user.
10
+ #
11
+ # @option options [user] :user
12
+ # User to retrieve profile info for.
13
+ # @option options [Object] :include_labels
14
+ # Include labels for each ID in custom profile fields.
15
+ # @see https://api.slack.com/methods/users.profile.get
16
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/users.profile/users.profile.get.json
17
+ def users_profile_get(options = {})
18
+ options = options.merge(user: users_id(options)['user']['id']) if options[:user]
19
+ post('users.profile.get', options)
20
+ end
21
+
22
+ #
23
+ # This method is used to set the profile information for a user.
24
+ #
25
+ # @option options [user] :user
26
+ # ID of user to change. This argument may only be specified by team admins.
27
+ # @option options [Object] :profile
28
+ # Collection of key:value pairs presented as a URL-encoded JSON hash.
29
+ # @option options [Object] :name
30
+ # Name of a single key to set. Usable only if profile is not passed.
31
+ # @option options [Object] :value
32
+ # Value to set a single key to. Usable only if profile is not passed.
33
+ # @see https://api.slack.com/methods/users.profile.set
34
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/users.profile/users.profile.set.json
35
+ def users_profile_set(options = {})
36
+ options = options.merge(user: users_id(options)['user']['id']) if options[:user]
37
+ post('users.profile.set', options)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'slack/web/api/endpoints/api'
4
4
  require 'slack/web/api/endpoints/auth'
5
+ require 'slack/web/api/endpoints/bots'
5
6
  require 'slack/web/api/endpoints/channels'
6
7
  require 'slack/web/api/endpoints/chat'
7
8
  require 'slack/web/api/endpoints/dnd'
@@ -19,9 +20,11 @@ require 'slack/web/api/endpoints/rtm'
19
20
  require 'slack/web/api/endpoints/search'
20
21
  require 'slack/web/api/endpoints/stars'
21
22
  require 'slack/web/api/endpoints/team'
23
+ require 'slack/web/api/endpoints/team_profile'
22
24
  require 'slack/web/api/endpoints/usergroups'
23
25
  require 'slack/web/api/endpoints/usergroups_users'
24
26
  require 'slack/web/api/endpoints/users'
27
+ require 'slack/web/api/endpoints/users_profile'
25
28
 
26
29
  module Slack
27
30
  module Web
@@ -33,6 +36,7 @@ module Slack
33
36
 
34
37
  include Api
35
38
  include Auth
39
+ include Bots
36
40
  include Channels
37
41
  include Chat
38
42
  include Dnd
@@ -50,9 +54,11 @@ module Slack
50
54
  include Search
51
55
  include Stars
52
56
  include Team
57
+ include TeamProfile
53
58
  include Usergroups
54
59
  include UsergroupsUsers
55
60
  include Users
61
+ include UsersProfile
56
62
  end
57
63
  end
58
64
  end
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Slack::Web::Api::Endpoints::Bots do
6
+ let(:client) { Slack::Web::Client.new }
7
+ end
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Slack::Web::Api::Endpoints::TeamProfile do
6
+ let(:client) { Slack::Web::Client.new }
7
+ end
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Slack::Web::Api::Endpoints::UsersProfile do
6
+ let(:client) { Slack::Web::Client.new }
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-28 00:00:00.000000000 Z
11
+ date: 2016-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -230,6 +230,7 @@ files:
230
230
  - bin/commands.rb
231
231
  - bin/commands/api.rb
232
232
  - bin/commands/auth.rb
233
+ - bin/commands/bots.rb
233
234
  - bin/commands/channels.rb
234
235
  - bin/commands/chat.rb
235
236
  - bin/commands/dnd.rb
@@ -247,9 +248,11 @@ files:
247
248
  - bin/commands/search.rb
248
249
  - bin/commands/stars.rb
249
250
  - bin/commands/team.rb
251
+ - bin/commands/team_profile.rb
250
252
  - bin/commands/usergroups.rb
251
253
  - bin/commands/usergroups_users.rb
252
254
  - bin/commands/users.rb
255
+ - bin/commands/users_profile.rb
253
256
  - bin/slack
254
257
  - examples/hi_real_time/Gemfile
255
258
  - examples/hi_real_time/hi.gif
@@ -302,6 +305,7 @@ files:
302
305
  - lib/slack/web/api/endpoints.rb
303
306
  - lib/slack/web/api/endpoints/api.rb
304
307
  - lib/slack/web/api/endpoints/auth.rb
308
+ - lib/slack/web/api/endpoints/bots.rb
305
309
  - lib/slack/web/api/endpoints/channels.rb
306
310
  - lib/slack/web/api/endpoints/chat.rb
307
311
  - lib/slack/web/api/endpoints/dnd.rb
@@ -320,9 +324,11 @@ files:
320
324
  - lib/slack/web/api/endpoints/search.rb
321
325
  - lib/slack/web/api/endpoints/stars.rb
322
326
  - lib/slack/web/api/endpoints/team.rb
327
+ - lib/slack/web/api/endpoints/team_profile.rb
323
328
  - lib/slack/web/api/endpoints/usergroups.rb
324
329
  - lib/slack/web/api/endpoints/usergroups_users.rb
325
330
  - lib/slack/web/api/endpoints/users.rb
331
+ - lib/slack/web/api/endpoints/users_profile.rb
326
332
  - lib/slack/web/api/error.rb
327
333
  - lib/slack/web/api/mixins.rb
328
334
  - lib/slack/web/api/mixins/channels.id.json
@@ -385,6 +391,7 @@ files:
385
391
  - spec/slack/slack_spec.rb
386
392
  - spec/slack/version_spec.rb
387
393
  - spec/slack/web/api/endpoints/api_spec.rb
394
+ - spec/slack/web/api/endpoints/bots_spec.rb
388
395
  - spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
389
396
  - spec/slack/web/api/endpoints/custom_specs/channels_spec.rb
390
397
  - spec/slack/web/api/endpoints/custom_specs/chat_spec.rb
@@ -403,9 +410,11 @@ files:
403
410
  - spec/slack/web/api/endpoints/rtm_spec.rb
404
411
  - spec/slack/web/api/endpoints/search_spec.rb
405
412
  - spec/slack/web/api/endpoints/stars_spec.rb
413
+ - spec/slack/web/api/endpoints/team_profile_spec.rb
406
414
  - spec/slack/web/api/endpoints/team_spec.rb
407
415
  - spec/slack/web/api/endpoints/usergroups_spec.rb
408
416
  - spec/slack/web/api/endpoints/usergroups_users_spec.rb
417
+ - spec/slack/web/api/endpoints/users_profile_spec.rb
409
418
  - spec/slack/web/api/error_spec.rb
410
419
  - spec/slack/web/api/mixins/channels_spec.rb
411
420
  - spec/slack/web/api/mixins/groups_spec.rb
@@ -472,6 +481,7 @@ test_files:
472
481
  - spec/slack/slack_spec.rb
473
482
  - spec/slack/version_spec.rb
474
483
  - spec/slack/web/api/endpoints/api_spec.rb
484
+ - spec/slack/web/api/endpoints/bots_spec.rb
475
485
  - spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
476
486
  - spec/slack/web/api/endpoints/custom_specs/channels_spec.rb
477
487
  - spec/slack/web/api/endpoints/custom_specs/chat_spec.rb
@@ -490,9 +500,11 @@ test_files:
490
500
  - spec/slack/web/api/endpoints/rtm_spec.rb
491
501
  - spec/slack/web/api/endpoints/search_spec.rb
492
502
  - spec/slack/web/api/endpoints/stars_spec.rb
503
+ - spec/slack/web/api/endpoints/team_profile_spec.rb
493
504
  - spec/slack/web/api/endpoints/team_spec.rb
494
505
  - spec/slack/web/api/endpoints/usergroups_spec.rb
495
506
  - spec/slack/web/api/endpoints/usergroups_users_spec.rb
507
+ - spec/slack/web/api/endpoints/users_profile_spec.rb
496
508
  - spec/slack/web/api/error_spec.rb
497
509
  - spec/slack/web/api/mixins/channels_spec.rb
498
510
  - spec/slack/web/api/mixins/groups_spec.rb