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 = File.open('Gemfile').readlines.reject { |l| l =~ /lame/ }.join
File.write('Gemfile', gem)
# obtuse bash
grep -v "lame" Gemfile > !!3.new && mv !!3{.new,}
# ruby one liner
ruby -i -ne 'print unless /lame/' Gemfile
@iwakura

This comment has been minimized.

Show comment Hide comment
@iwakura

iwakura Jan 25, 2013

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

iwakura commented Jan 25, 2013

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

@rosenfeld

This comment has been minimized.

Show comment Hide comment
@rosenfeld

rosenfeld Jan 31, 2013

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