Thor
Rake
Thor | Rake | |
---|---|---|
10 | 17 | |
5,087 | 2,310 | |
0.2% | 0.7% | |
6.9 | 8.2 | |
about 2 months ago | 8 days ago | |
Ruby | Ruby | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Thor
-
CLI tools at Aha!
Ruby has always been a great general-purpose scripting language and is often used to create command-line utilities. Many of these use the excellent Thor gem to parse command-line options, but there's no escaping one fact: command-line utilities just aren't interesting. Never have been, never will be.
-
How to Build Your Own Rails Generator
All public methods in the generator will be called one after the other. Private methods will not be called but are available in your public methods like regular Ruby classes.
-
Any opinionated tool / framework for creating binary CLI tools?
ruby: http://whatisthor.com
-
Seeking recommendations or suggestions for learning Ruby to maintain the home directory?
I will add that if you want to develop a CLI tool that gives you various commands that you can run, I would have a look at something like thor to keep it organised and documented. But this is completely unnecessary as a first step - you can simply create a Ruby file that does a thing you want and invoke it directly.
- A more ruby-ish command line parsing - design idea
-
Bootstrapping with Ruby on Rails Generators and Templates
Not to be confused with generator functions (which you might be familiar with from Python or Javascript), Rails generators are custom Thor commands that focus on, well, generating things.
- Don't make me think, or why I switched to Rails from JavaScript SPAs
-
Building a Dot Matrix Animator
I wanted to provide a command-line interface for the user that was easy to use, and I also wanted to provide the flexibility with the options used to render the animation. After looking around online I found that Thor was a good tool to utilize. It allowed me to easily create a number of options that make this program much more versatile. An example below shows how a user can select which folder the source images are in, as well as what the background and foreground colors should be:
-
Move over Rake, Thor is the new King
I've used Thor a lot, but it's kind of terrible. It uses a custom non-POSIX-compliant option parser (ex: method_option :list, type: :array -> --list one two three, where as the POSIX way is --list one,two,three or --item one -- item two --item three) and will not error on unknown options or exit with -1 when not enough args are given. If you want a better CLI library, checkout dry-rb, command_kit, or cmdparse.
-
Ruby for replacing Unix shell scripts? (eg. a better Perl)
And Thor might be worth looking at if you have complex scripts: https://github.com/erikhuda/thor
Rake
-
What’s with DevOps engineers using `make` of all things?
Some competitors - Rake (ruby) - Bake - Earthly - SCons - doit
-
An Introduction to Metaprogramming in Ruby
where every argument except the name can either be missing, single (value) or multiple (array). Sure, it has the "advantage" that it's syntactically valid Ruby code, but it then requires some 70 lines of awful code to actually parse that data into a usable construct ([1] up to L145).
[1] https://github.com/ruby/rake/blob/7b50e9dc37abc57fd365c16cb1...
-
Taskfile: A Modern Alternative to Makefile
Rake[0] is still the best ‘make-like’ build tool I’ve used for general purpose stuff. The syntax is nice and it’s just Ruby which is a delight. I briefly used Mage (similar, but Go) and it was fine too.
[0]: https://github.com/ruby/rake
-
Knit: Making a Better Make
Yup! Two well-established alternatives are "rake", in the Ruby community, and "just" in the Rust community.
Rake is fully programmable in Ruby. Just is a bit less flexible, but it doesn't require learning Ruby, and it's quite pleasant to use.
https://ruby.github.io/rake/
-
Anyone have any good Ruby repos that showcase best practices?
Rake is a great way to homogenize and declare common behaviors of your script (called "tasks"); a guide.
-
Write your own Domain Specific Language in Ruby
In Ruby there's a gem named Rake. This gem provides a DSL to create tasks to be run from the command line. A small example looks like this:
-
Ruby
I think you're referring to Rake. https://ruby.github.io/rake/
- Fastlane: iOS 和 Android 的自动化构建工具
-
What about a CMake transpiler?
We use [Rake](https://github.com/ruby/rake) instead - it's awesome.
-
How to Access Rails ActiveRecord Models Inside a Rake Task
If you've been working with Ruby on Rails for a while, you've come across Rake. Written by the late Jim Weirich, Rake is to Ruby what Make is to C. It's very easy to create custom Rake tasks to simplify your development workflows. Rails even provides a generator (rails g task) to create them for you.
What are some alternatives?
TTY - Toolkit for developing sleek command line apps.
Bazel - a fast, scalable, multi-language and extensible build system
GLI - Make awesome command-line applications the easy way
Commander - The complete solution for Ruby command-line executables
Cocaine
dry-cli - General purpose Command Line Interface (CLI) framework for Ruby
Trollop - Optimist is a commandline option parser for Ruby that just gets out of your way.
Slop - Simple Lightweight Option Parsing - ✨ new contributors welcome ✨