Make gli an optional dependency - #602
Open
corsonknowles wants to merge 2 commits into
Open
corsonknowles wants to merge 2 commits into
corsonknowles wants to merge 2 commits into
Conversation
Only the slack command-line client uses gli, so library users installed it (and its hard ostruct dependency, via GLI::Options < OpenStruct) for nothing. bin/slack now requires gli itself and exits with install instructions when it is missing. gli moves to the test group for the CLI specs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Danger ReportErrors
Markdowns* [#XXX](https://github.com/slack-ruby/slack-ruby-client/pull/XXX): Make gli an optional dependency; only the `slack` command-line client needs it - [@corsonknowles](https://github.com/corsonknowles).
does not include a pull request link |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #601, implementing option (1) as agreed there.
gliwas a runtime dependency, but only theslackcommand-line client (bin/slack) uses it.require 'slack-ruby-client'never loads it. Library-only users therefore installed gli for nothing, and with it a hard dependency onostruct(GLI::Options < OpenStruct), which Ruby 4.0 no longer ships as a default gem.slack-ruby-client.gemspec: dropsgli. The runtime dependencies are now faraday, faraday-mashify, faraday-multipart, hashie and logger.bin/slack: requiresgliitself. When gli is missing it exits with status 1: "The slack command-line client requires the gli gem. Addgem 'gli'to your Gemfile, or rungem install gli."Gemfile: addsglito the:testgroup, becausespec/slack/slack_spec.rbrunsbin/slack.3.2.1 (Next); renumber if you'd rather call this a minor release.Tests: a new spec runs
bin/slackwithrequire 'gli'stubbed to raiseLoadError, usingspec/fixtures/without_gli.rbviaruby -r. It asserts the exit status and the message. The fixture lives outsidespec/support, sospec_helperdoesn't load it into the main process.bundle exec rspecgives 615 examples, 0 failures, and RuboCop reports 75 files with no offenses (Ruby 3.4.11). Afterrequire 'slack-ruby-client', neither gli nor ostruct is loaded.🤖 Generated with Claude Code