Last active — forked from anthonymoralez/gist:4627717

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View alt_solutions.rb
1 2 3 4 5 6 7 8 9 10
# 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

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

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
Something went wrong with that request. Please try again.