Create and execute a temp file by one command.
$ gem install tryrb
Maybe you often try ruby scripts like this:
$ cd ~/tmp
$ vim foooooooo.rb
$ ruby foooooooo.rb
You have to change working directory, figure out a name, finally try to find the right file to run.It's bothering! 💢
But this gem provide an easy way to do this. 💛
$ tryrb c/create
# Editing ruby code
$ tryrb e/exec
A file named, for exmaple, 201401010909.rb
will be created and executed.
More options:
Specify a name
$ tryrb c/create foo
A file named, for exmaple, 201401010909_foo.rb
will be created.
Last one file in your temp dir
$ tryrb e/exec
The last one file containing foo
$ tryrb e/exec foo
Nth from the bottom file
$ tryrb e/exec -l n
Nth from the bottom file containing name foo
$ tryrb e/exec -l n foo
(It's same with exec
usage)
$ tryrb o/open
tryrb config
A configure file ~/.tryrbrc
will be created.
c
is alias of create
, e
is alias of exec
and o
is alias of open
.
$ tryrb help COMMAND
Welcome contributing by forking, sending pull requests or opening issues.
Copyright (c) 2014 Tony Han. See LICENSE for details.