Closed gregory closed 8 years ago
Selecta isn't designed to be used as a library from within other Ruby code. It requires full control of the TTY (and forcefully configures it via stty
), so it wouldn't play nicely as a library. It's not installable as a gem for that reason.
However, to use Selecta from a Ruby program, you can always shell out to it via system()
, Open3
, or some other mechanism. For example, here's me doing it in irb:
$ irb
irb(main):001:0> system("find ~/proj/selecta | selecta")
8290 >
/Users/grb/proj/selecta
...
Hey @garybernhardt ,
Thx for writing selecta, it's awesome! :)
I was just wondering what would be the best way to use it in combination with $stdin ?
basically, i get a list of array: ['foo', 'bar'] that i'd like to print and use selecta to let the user select the element to assign to a variable through $stdin.