Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exit code for version and help runners #272

Merged
merged 2 commits into from
Mar 6, 2021

Conversation

adam12
Copy link
Contributor

@adam12 adam12 commented Mar 6, 2021

Cast the runner's return value to Integer so we're going to be calling exit with an Integer. The original implementation had a ternary with explicit constants for the two exit codes. I could probably do something similar if the simple cast is insufficient.

Fixes this:

$ standardrb --help
... bunch of help output
TypeError: no implicit conversion from nil to integer
  /workspace/exe/standardrb:7:in `exit'
  /workspace/exe/standardrb:7:in `<top (required)>'
  /usr/local/bundle/bin/standardrb:23:in `load'
  /usr/local/bundle/bin/standardrb:23:in `<top (required)>'
$ standardrb --version
1.0.2
TypeError: no implicit conversion from nil to integer
  /workspace/exe/standardrb:7:in `exit'
  /workspace/exe/standardrb:7:in `<top (required)>'
  /usr/local/bundle/bin/standardrb:23:in `load'
  /usr/local/bundle/bin/standardrb:23:in `<top (required)>'

@searls
Copy link
Contributor

searls commented Mar 6, 2021

Whoops! That's what I get for blindly trusting @nicksieger!

(jk, Nick's great and I should have thought to try these commands)

@searls searls merged commit f02b210 into standardrb:master Mar 6, 2021
@searls
Copy link
Contributor

searls commented Mar 6, 2021

Landed in 1.0.3!

@nicksieger
Copy link
Contributor

Hey, the tests passed! Sorry about the breakage!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants