Skip to content

Conversation

@DannyBen
Copy link
Owner

@DannyBen DannyBen commented Sep 27, 2021

⚠️ This is a breaking change

This PR introduces a few breaking changes.

Quick fix

In order to still have the deprecated commands included, add this to the top of your Runfile.

require 'runfile/compatibility'

and you are done. Note that this file will be removed in future versions, so for a more permanent fix, read on.

The Colsole gem is no longer bundled with Runfile

If you are using any of the Colsole commands (such as say, resay, word_wrap, terminal_width) in your current Runfiles, you should require and include Colsole in your Runfile:

require 'colsole'
include Colsole

All command execution helpers were removed

If you were using any of the run, run_bg or similar in your Runfile, these commands are removed.
If you wish to still use them, feel free to copy them from here.

Why is this a good thing?

Both of these modules introduced some global functions, some with common names (such as colors in Colsole, or run in the Exec module). These functions contaminated downstream code. While for the most part, it was unnoticeable, it reduces the productivity and simplicity of Runfile.

Additional developer notes

  • All say calls inside the runfile library were replaced with a plain ol' puts
  • All colorful output generated by runfile itself, is now uncolored
  • The word_wrap method from Colsole is still needed by runfile, so it was added as a string refinement.
  • The terminal_width (and a couple of other) methods from Colsole are still needed by runfile, so they were added to a new static helper class: Terminal

@DannyBen DannyBen merged commit cba007c into master Sep 27, 2021
@DannyBen DannyBen deleted the remove/colsole-exec branch September 27, 2021 14:02
@DannyBen DannyBen mentioned this pull request Sep 29, 2021
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.

2 participants