Created
May 9, 2010 06:36
-
-
Save bobthecow/394984 to your computer and use it in GitHub Desktop.
Premailer gem plugin for Coda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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