Skip to content

Instantly share code, notes, and snippets.

@edthix
Created June 26, 2010 18:18
Show Gist options
  • Save edthix/454244 to your computer and use it in GitHub Desktop.
Save edthix/454244 to your computer and use it in GitHub Desktop.
# Warning - 2AM Work!
# I'm too lazy for better approach (and too sleepy)
@newgems = []
strips = [".", ",", "(", ")"]
(0..9).to_a.each{ |x| strips << x.to_s }
File.open "gems", "r" do |f|
f.each do |line|
strips.each{|x|
line.gsub! x, ""
@newgems << line
}
end
end
@newgems.uniq!
File.open("newgems", "w+"){ |f|
@newgems.each{ |line| f.write line.to_s }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment