DAtum

Entrepreneurship, Software and the business of technology

Category Archives: python

Quick one liner to save a list of gems (with multiple versions) and install on another machine

This saves the list of gems gem list | python -c “import sys;import re; from itertools import chain; l=sys.stdin.readlines();x=[ [  line[:-1][:line.index(' ')] + ‘ –version=’ +k for k in line[line.index('(')+1:line.index(')')].split(‘,’)]   for line in l]; print ‘\n’.join(item for item in chain(*x))” The resultant output looks like actionmailer –version=2.3.5 actionmailer –version= 2.3.4 actionmailer –version= 2.1.1 actionmailer [...]

Follow

Get every new post delivered to your Inbox.