I’m doing a little script that installs all the gems, and I did that, but I have a question regarding this;
a file containing list of gems looks like this:
adapter (0.5.2)
do_sqlite3 (0.10.8 x86-mingw32)
and many others. If I readline from script I could do foo.gsub /[^a-zA-Z]/,” to remove numbers. But then it removes numbers from gem name and I have letters inside parentheses left. So I would like a regex that removes everything except gem name. Any help or link will do.
Tnx
So, my first question would be about your goal for installing a list of gems. There might already be a tool out there that solves your underlying problem. (bundler?)
A regex that might work, though, would be to remove the portions of the string enclosed by parenthesis:
/\([^\)]*\)/