-
-
Save zph/4631392 to your computer and use it in GitHub Desktop.
Alternate solutions for Giles bash in http://gilesbowkett.blogspot.com/2013/01/we-can-solve-multiple-default-stacks.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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
Other variant:
sed -i'.bak' '/factory_girl_rails/d' Gemfile && rm "Gemfile.bak"