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

Add helper for running thor tasks with remote.thor #325

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

mattbrictson
Copy link
Owner

@mattbrictson mattbrictson commented Aug 31, 2022

Thor is an alternative to rake for writing command-line scripts in Ruby. It is built into Rails and maintained under the Rails GitHub organization.

In a Rails project, you can place .thor files under lib/tasks/ (for example). Similar to Rake, you can run thor -T to see a list of commands, and thor COMMAND to run a command defined in one your .thor files.

Thor offers a more intuitive programming model compared to rake, and has a more full-featured set of CLI options parsing capabilities. Most importantly, while rake tasks are notoriously tricky to unit test and require boilerplate to do so, thor commands can be unit tested like plain ruby methods.

This PR adds a remote.thor helper to tomo (similar to remote.rake) so that developers who are using thor to write CLI commands have easy access to them when writing custom tomo tasks.

@mattbrictson mattbrictson added the ✨ Feature Adds a new feature label Aug 31, 2022
@mattbrictson mattbrictson marked this pull request as ready for review September 1, 2022 01:13
@mattbrictson mattbrictson changed the title Add helper for running thor tasks with remote.thor Add helper for running thor tasks with remote.thor Sep 1, 2022
@mattbrictson mattbrictson merged commit 99fee1d into main Sep 1, 2022
@mattbrictson mattbrictson deleted the features/thor-helper branch September 1, 2022 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant