Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeffwilliams/rbsh
Ruby Shell
https://github.com/jeffwilliams/rbsh
Last synced: 11 days ago
JSON representation
Ruby Shell
- Host: GitHub
- URL: https://github.com/jeffwilliams/rbsh
- Owner: jeffwilliams
- License: mit
- Created: 2013-12-23T03:34:15.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-07T21:39:11.000Z (almost 11 years ago)
- Last Synced: 2023-03-12T06:39:23.925Z (over 1 year ago)
- Language: Ruby
- Size: 254 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Rbsh - Simple Ruby Shell
========================A simple Linux shell written in Ruby.
Features
--------* Job Control
* Readline and completion
* Directory history. Navigate using ALT-LEFT, ALT-RIGHT, and ALT-UP.
* Ruby expression substitutionHow To use Ruby Substitution
----------------------------As part of a command line, you can substitute the result of evaluating ruby code. Just place the code inside bangs:
$ echo The time is !Time.new!
The time is 2014-01-03 16:10:42 -0500As a convenience, if you want the entire line to be interpreted as ruby begin the line with a bang, and don't terminate the bang:
$ !puts "Addition is fun: #{4+5}"
Addition is fun: 9
nilYou can also pipe into ruby code. The ruby code's $stdin is hooked up to the previous command:
$ ls | !$stdin.each_line{ |l| puts "Good ol' " + l.chomp + "'s" }!
ls | !$stdin.each_line{ |l| puts l.chomp + "'s" }!
Good ol' bin's
Good ol' lib's
Good ol' LICENSE's
Good ol' old's
Good ol' Rakefile's
Good ol' rbsh-0.0.1.gem's
Good ol' rbsh.gemspec's
Good ol' README.md's
Good ol' test's
Good ol' TODO's$ ls | !$stdin.each_line{ |l| puts l if File.directory?(l.chomp) }! | wc
4 4 17