gwen 51e7cfb384 asdasdasdasdsadasdasdasd | hai 1 ano | |
---|---|---|
.gitignore | %!s(int64=5) %!d(string=hai) anos | |
LICENSE | %!s(int64=5) %!d(string=hai) anos | |
README.md | hai 1 ano | |
examples.rb | %!s(int64=5) %!d(string=hai) anos | |
rubysh.png | %!s(int64=3) %!d(string=hai) anos | |
rubysh.rb | %!s(int64=4) %!d(string=hai) anos |
Rubysh is a little DSL that scans your systems PATH and exposes everything there as a funtion. For example:
-pwd
-ls(" -a")
would be equivalent to
system("pwd")
system("ls -a")
If you use a + instead of a minus the commend is run as a sub process and the stdout is returned to ruby as a string.
output = +ls
p output #would be the contents of your current directory
You can also pipe commands together like in a bash script
-curl("-s","https://gwenpri.me").grep("\"<i>\"")
Lastly you can also pipe arbitrary strings into a commands stdin like so
"input".grep("-ro [nu]")
yes I know this is a crime. thank you for your patronage.