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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 3.2.1 (Next)
### 3.3.0 (Next)

* [#602](https://github.com/slack-ruby/slack-ruby-client/pull/602): Make gli an optional dependency; only the `slack` command-line client needs it - [@corsonknowles](https://github.com/corsonknowles).
* [#591](https://github.com/slack-ruby/slack-ruby-client/pull/591): Generate AI CHANGELOG entries and PR summaries for automated API update PRs, lock simplecov below 1.1.0 to avoid breaking Coveralls - [@dblock](https://github.com/dblock).
* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add entity.acknowledgeCommentAction and entity.presentComments methods - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add admin.apps.mcpServers, admin.apps.mcpServers.permissions, and admin.apps.permissions endpoints - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ group :test do
gem 'danger-toc', require: false
gem 'erubis'
gem 'faraday-typhoeus'
gem 'gli'
gem 'json-schema'
gem 'mutex_m'
gem 'racc'
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,13 @@ Slack::Messages::Formatting.escape('Hello & <world>')

### Command-Line Client

The slack command-line client returns JSON data from the Slack API.
The slack command-line client returns JSON data from the Slack API. It uses [GLI](https://github.com/davetron5000/gli), which is not a dependency of slack-ruby-client, so install it alongside the client.

```
gem install gli
```

Or add `gem 'gli'` to your Gemfile.

#### Authenticate with Slack

Expand Down
4 changes: 4 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Upgrading Slack-Ruby-Client
===========================

### Upgrading to >= 3.3.0

[#602](https://github.com/slack-ruby/slack-ruby-client/pull/602) removes [gli](https://github.com/davetron5000/gli) from slack-ruby-client's runtime dependencies. Only the `slack` command-line client uses it. If you use the command-line client, add `gem 'gli'` to your Gemfile or run `gem install gli`. Without it, `slack` exits with a message saying so. The library itself is unaffected.

### Upgrading to >= 3.2.0

[#583](https://github.com/slack-ruby/slack-ruby-client/pull/583) modifies the error types raised when a nonexistent #channel-name or @user-handle is looked up. These will now raise `ChannelNotFound` and `UserNotFound` respectively, whereas they previously raised a `SlackError`. If your code relies on these types without accounting for inheritance, it will need to be migrated. Notably, `rescue SlackError` will continue to work as normal, since both error classes inherit from it.
Expand Down
6 changes: 5 additions & 1 deletion bin/slack
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env ruby
require 'gli'
begin
require 'gli'
rescue LoadError
abort "The slack command-line client requires the gli gem. Add `gem 'gli'` to your Gemfile, or run `gem install gli`."
end
require 'slack_ruby_client'

module Slack
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module Slack
VERSION = '3.2.1'
VERSION = '3.3.0'
end
1 change: 0 additions & 1 deletion slack-ruby-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Gem::Specification.new do |s|
s.add_dependency 'faraday', '>= 2.0.1'
s.add_dependency 'faraday-mashify'
s.add_dependency 'faraday-multipart'
s.add_dependency 'gli'
s.add_dependency 'hashie'
s.add_dependency 'logger'
s.metadata['rubygems_mfa_required'] = 'true'
Expand Down
12 changes: 12 additions & 0 deletions spec/slack/slack_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true
require 'spec_helper'
require 'open3'

describe Slack do
let(:slack) { File.expand_path(File.join(__FILE__, '../../../bin/slack')) }
Expand All @@ -19,6 +20,17 @@
end
end

context 'without gli installed' do
# --disable-gems (and no inherited bundler setup) leaves gli unloadable on every Ruby.
let(:env) { { 'RUBYOPT' => nil, 'RUBYLIB' => nil, 'BUNDLE_GEMFILE' => nil, 'BUNDLE_BIN_PATH' => nil } }

it 'exits with instructions to install it' do
output, status = Open3.capture2e(env, RbConfig.ruby, '--disable-gems', slack, 'help')
expect(status.exitstatus).to eq 1
expect(output).to include "The slack command-line client requires the gli gem. Add `gem 'gli'` to your Gemfile"
end
end

context 'globals' do
let(:command) do
"\"#{slack}\" --vcr-cassette-name=web/auth_test_success " \
Expand Down
Loading