Skip to content

Instantly share code, notes, and snippets.

@bobthecow
Created May 9, 2010 06:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobthecow/394984 to your computer and use it in GitHub Desktop.
Save bobthecow/394984 to your computer and use it in GitHub Desktop.
Premailer gem plugin for Coda
#!/usr/bin/ruby
require 'rubygems'
require 'premailer'
require 'tempfile'
$stdout.flush
tmp_html = Tempfile.new('premailer')
while line = gets
tmp_html << line
end
tmp_html.flush
premailer = Premailer.new(tmp_html.path, :warn_level => Premailer::Warnings::SAFE)
puts premailer.to_inline_css
#!/usr/bin/ruby
require 'rubygems'
require 'premailer'
require 'tempfile'
$stdout.flush
tmp_html = Tempfile.new('premailer')
while line = gets
tmp_html << line
end
tmp_html.flush
premailer = Premailer.new(tmp_html.path, :warn_level => Premailer::Warnings::SAFE)
puts premailer.to_inline_css
begin
require 'Growl'
premailer.warnings.each do |w|
Growl.notify_warning "#{w[:message]} (#{w[:level]}) may not render properly in #{w[:clients]}"
end
rescue
# no Growl, apparently. Fail silently.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment