Skip to content

Instantly share code, notes, and snippets.

@cwoodcox
Created May 22, 2013 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwoodcox/5629263 to your computer and use it in GitHub Desktop.
Save cwoodcox/5629263 to your computer and use it in GitHub Desktop.
Sometimes I do terrible things in Ruby. Terrible, horrible, wonderful things.
def create_stylesheet
stylesheet = StringIO.new
stylesheet << <<-EOS
@font-face {
font-family: 'badges';
src: url('#{font_eot.url}');
src: url('#{font_eot.url}') format('embedded-opentype'),
url('#{font_woff.url}') format('woff'),
url('#{font_ttf.url}') format('truetype'),
url('#{font_svg.url}') format('svg');
font-weight: normal;
font-style: normal;
}
EOS
class << stylesheet
attr_accessor :original_filename
end
stylesheet.original_filename = 'badge_font.css'
self.stylesheet = stylesheet
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment