Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# Re-write for run by @_ZPH
# OO Ruby
gem ='Gemfile').readlines.reject { |l| l =~ /lame/ }.join
File.write('Gemfile', gem)
# obtuse bash
grep -v "lame" Gemfile > !! && mv !!3{.new,}
# ruby one liner
ruby -i -ne 'print unless /lame/' Gemfile

iwakura commented Jan 25, 2013

Other variant:
sed -i'.bak' '/factory_girl_rails/d' Gemfile && rm "Gemfile.bak"

File.write('Gemfile','Gemfile').gsub(/.*['"]lame['"].*\n/, ''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment