A command-line tool that brings Ruby's expressiveness to shell scripting for data transformations.
Ru is a Ruby-based command-line tool that enables developers to perform shell data transformations using Ruby syntax. It solves the problem of writing complex and hard-to-read awk, sed, or bash commands by allowing users to leverage Ruby's expressive methods directly in the terminal.
Ruby developers and sysadmins who frequently perform text processing or data transformations in the shell and prefer Ruby's syntax over traditional Unix tools.
Developers choose Ru because it dramatically reduces the cognitive overhead of shell scripting by replacing arcane command-line syntax with familiar Ruby methods, making transformations more readable and maintainable.
Ruby in your shell!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows direct use of any Ruby Core and Active Support method in shell commands, enabling powerful transformations like String#center or .sum without learning awk syntax, as shown in the examples.
Simplifies passing arguments to methods within map operations, making commands more concise and readable, such as 'map(:center, 80)' versus complex awk printf statements.
Converts file listings to Ru::File objects with methods like size and updated_at, facilitating easy manipulation of file properties in pipelines without separate shell commands.
Supports saving frequently used transformations as named commands with 'ru save', enhancing productivity for repetitive tasks, as detailed in the Saved Commands section.
Requires Ruby and the ru gem to be installed, adding setup complexity and making it unsuitable for environments where Ruby is not available or desired.
Runs Ruby code for transformations, which can be slower than optimized native tools like awk or sed for large-scale or real-time data processing, as hinted by the comparison examples.
Has a smaller community and fewer extensions compared to established shell tools, which may limit advanced use cases and troubleshooting resources.