Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.