public
Last active — forked from anthonymoralez/gist:4627717

  • Download Gist
alt_solutions.rb
Ruby
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/, ''))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.