Skip to content

Instantly share code, notes, and snippets.

View chaserx's full-sized avatar
:octocat:
Mostly Meetings. Sometimes not.

Chase Southard chaserx

:octocat:
Mostly Meetings. Sometimes not.
View GitHub Profile
#!/usr/local/bin/ruby
require "rubygems"
require "fastercsv"
require "html/table"
include HTML
# new file
outfile = File.open("outfile.html", "w")
@chaserx
chaserx / capitalize_with_hyphens
Created May 1, 2009 19:00
This capitalize method doesn't bash hyphenated names
#!/usr/local/bin/ruby -wKU
class String
def capitalize_with_hyphens!
if self.include? "-"
pieces_array = self.split("-")
pieces_array.each { |e| e.capitalize! }
joined = pieces_array.join("-")
replace(joined)
else