This repository has been archived by the owner on Mar 3, 2022. It is now read-only.
Fix uncaught LoadError requiring pygments.rb #282
Merged
+2
−2
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.
If
ghi
was installed via Homebrew before pygments.rb was added as adependency, the check for pygments being installed never gets run. It
looks like there was intention to rescue that
require
statement butbecause
LoadError
doesn't inherit fromStandardError
, the exceptionwas uncaught and
ghi
would silently exit. This only seems to happencurrently on issues that include fenced code blocks, but I provided
reproducible evidence in #281. Merging this will fix #281, but I have
two concerns about the fact that pygments.rb was included as a
dependency in the first place:
manually. Attempting to
brew install ghi
without first having rungem install pygments.rb
just outputs an error and doesn't finish.manager like rvm, rbenv, or chruby. You can
gem install pygments.rb
on one version of Ruby (or
sudo gem install pygments.rb
on thesystem version of Ruby, which is a whole other problem) but as soon
as you try to use
ghi
after switching Rubies, you have to rememberto install
pygments.rb
. This isn't great.I see two solutions here. We can either no longer offer a Homebrew
formula, instead urging users to just install via
gem install ghi
orwe can remove pygments.rb as a dependency. Personally I think
ghi
should try to remain free of dependencies for this reason, but I leave
it in your hands.