Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* [#134](https://github.com/slack-ruby/slack-ruby-client/issues/134): Set `start_options[:request][:timeout]`, used with `rtm.start` in `Slack::RealTime::Client`, to 180 seconds - [@dblock](https://github.com/dblock).
* [#136](https://github.com/slack-ruby/slack-ruby-client/pull/136): Pass request options in web client calls - [@dblock](https://github.com/dblock).
* [#121](https://github.com/slack-ruby/slack-ruby-client/pull/121): Fix: check that the current Celluloid actor is running before calling `terminate` - [@newdark](https://github.com/newdark).
* [#138](https://github.com/slack-ruby/slack-ruby-client/pull/138): Added `validate` option to `channels_create`, `channels_join`, `channels_rename`, `groups_create` and `groups_rename` Web APIs - [@dblock](https://github.com/dblock).
* [#138](https://github.com/slack-ruby/slack-ruby-client/pull/138): Removed `channel` option from `files_comments_add` Web API - [@dblock](https://github.com/dblock).
* Your contribution here.

### 0.7.9 (2/9/2017)
Expand Down
3 changes: 3 additions & 0 deletions bin/commands/channels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
g.long_desc %( This method is used to create a channel. )
g.command 'create' do |c|
c.flag 'name', desc: 'Name of channel to create.'
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.channels_create(options))
end
Expand Down Expand Up @@ -56,6 +57,7 @@
g.long_desc %( This method is used to join a channel. If the channel does not exist, it is created. )
g.command 'join' do |c|
c.flag 'name', desc: 'Name of channel to join.'
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.channels_join(options))
end
Expand Down Expand Up @@ -104,6 +106,7 @@
g.command 'rename' do |c|
c.flag 'channel', desc: 'Channel to rename.'
c.flag 'name', desc: 'New name for channel.'
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.channels_rename(options))
end
Expand Down
1 change: 0 additions & 1 deletion bin/commands/files_comments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
g.command 'add' do |c|
c.flag 'file', desc: 'File to add a comment to.'
c.flag 'comment', desc: 'Text of the comment to add.'
c.flag 'channel', desc: 'Channel id (encoded) of which location to associate with the new comment.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.files_comments_add(options))
end
Expand Down
2 changes: 2 additions & 0 deletions bin/commands/groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
g.long_desc %( This method creates a private channel. )
g.command 'create' do |c|
c.flag 'name', desc: 'Name of private channel to create.'
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.groups_create(options))
end
Expand Down Expand Up @@ -122,6 +123,7 @@
g.command 'rename' do |c|
c.flag 'channel', desc: 'Private channel to rename.'
c.flag 'name', desc: 'New name for private channel.'
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.groups_rename(options))
end
Expand Down
6 changes: 3 additions & 3 deletions bin/commands/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
c.flag 'query', desc: 'Search query. May contains booleans, etc.'
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
c.flag 'highlight', desc: 'Pass a value of 1 to enable query highlight markers (see below).'
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
c.action do |_global_options, options, _args|
puts JSON.dump($client.search_all(options))
end
Expand All @@ -20,7 +20,7 @@
c.flag 'query', desc: 'Search query. May contain booleans, etc.'
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
c.flag 'highlight', desc: 'Pass a value of 1 to enable query highlight markers (see below).'
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
c.action do |_global_options, options, _args|
puts JSON.dump($client.search_files(options))
end
Expand All @@ -32,7 +32,7 @@
c.flag 'query', desc: 'Search query. May contains booleans, etc.'
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
c.flag 'highlight', desc: 'Pass a value of 1 to enable query highlight markers (see below).'
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
c.action do |_global_options, options, _args|
puts JSON.dump($client.search_messages(options))
end
Expand Down
6 changes: 6 additions & 0 deletions lib/slack/web/api/endpoints/channels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def channels_archive(options = {})
#
# @option options [Object] :name
# Name of channel to create.
# @option options [Object] :validate
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
# @see https://api.slack.com/methods/channels.create
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.create.json
def channels_create(options = {})
Expand Down Expand Up @@ -87,6 +89,8 @@ def channels_invite(options = {})
#
# @option options [Object] :name
# Name of channel to join.
# @option options [Object] :validate
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
# @see https://api.slack.com/methods/channels.join
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.join.json
def channels_join(options = {})
Expand Down Expand Up @@ -158,6 +162,8 @@ def channels_mark(options = {})
# Channel to rename.
# @option options [Object] :name
# New name for channel.
# @option options [Object] :validate
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
# @see https://api.slack.com/methods/channels.rename
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.rename.json
def channels_rename(options = {})
Expand Down
3 changes: 0 additions & 3 deletions lib/slack/web/api/endpoints/files_comments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ module FilesComments
# File to add a comment to.
# @option options [Object] :comment
# Text of the comment to add.
# @option options [channel] :channel
# Channel id (encoded) of which location to associate with the new comment.
# @see https://api.slack.com/methods/files.comments.add
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.comments/files.comments.add.json
def files_comments_add(options = {})
throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
throw ArgumentError.new('Required arguments :comment missing') if options[:comment].nil?
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
post('files.comments.add', options)
end

Expand Down
4 changes: 4 additions & 0 deletions lib/slack/web/api/endpoints/groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def groups_close(options = {})
#
# @option options [Object] :name
# Name of private channel to create.
# @option options [Object] :validate
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
# @see https://api.slack.com/methods/groups.create
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.create.json
def groups_create(options = {})
Expand Down Expand Up @@ -187,6 +189,8 @@ def groups_open(options = {})
# Private channel to rename.
# @option options [Object] :name
# New name for private channel.
# @option options [Object] :validate
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
# @see https://api.slack.com/methods/groups.rename
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.rename.json
def groups_rename(options = {})
Expand Down
6 changes: 3 additions & 3 deletions lib/slack/web/api/endpoints/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Search
# @option options [Object] :sort_dir
# Change sort direction to ascending (asc) or descending (desc).
# @option options [Object] :highlight
# Pass a value of 1 to enable query highlight markers (see below).
# Pass a value of true to enable query highlight markers (see below).
# @see https://api.slack.com/methods/search.all
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/search/search.all.json
def search_all(options = {})
Expand All @@ -33,7 +33,7 @@ def search_all(options = {})
# @option options [Object] :sort_dir
# Change sort direction to ascending (asc) or descending (desc).
# @option options [Object] :highlight
# Pass a value of 1 to enable query highlight markers (see below).
# Pass a value of true to enable query highlight markers (see below).
# @see https://api.slack.com/methods/search.files
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/search/search.files.json
def search_files(options = {})
Expand All @@ -51,7 +51,7 @@ def search_files(options = {})
# @option options [Object] :sort_dir
# Change sort direction to ascending (asc) or descending (desc).
# @option options [Object] :highlight
# Pass a value of 1 to enable query highlight markers (see below).
# Pass a value of true to enable query highlight markers (see below).
# @see https://api.slack.com/methods/search.messages
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/search/search.messages.json
def search_messages(options = {})
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/slack-api-ref
Submodule slack-api-ref updated 195 files