Permalink
Browse files

Wrote skeleton for gem.

  • Loading branch information...
0 parents commit 64c461130c21798d8164aa80eb2c4d6c8c5bd67e @fphilipe fphilipe committed Apr 3, 2011
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in premailer-rails3.gemspec
+gemspec
@@ -0,0 +1,2 @@
+require 'bundler'
+Bundler::GemHelper.install_tasks
@@ -0,0 +1,5 @@
+require 'premailer'
+require 'premailer-rails3/premailer_rails'
+require 'premailer-rails3/hook'
+
+Mail.register_interceptor(PremailerRails::Hook)
@@ -0,0 +1,16 @@
+module PremailerRails
+ class Hook
+ def self.delivering_email(message)
+ premailer = Premailer.new(message)
+
+ message.html_part do
+ content_type message.content_type
+ body premailer.to_inline_css
+ end
+
+ message.text_part do
+ body premailer.to_plain_text
+ end
+ end
+ end
+end
@@ -0,0 +1,7 @@
+module PremailerRails
+ class Premailer < ::Premailer
+ def initialize(args)
+
+ end
+ end
+end
@@ -0,0 +1,3 @@
+module PremailerRails
+ VERSION = "0.0.1"
+end
@@ -0,0 +1,26 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "premailer-rails3/version"
+
+Gem::Specification.new do |s|
+ s.name = "premailer-rails3"
+ s.version = PremailerRails::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Philipe Fatio"]
+ s.email = ["philipe.fatio@gmail.com"]
+ s.homepage = "https://github.com/fphilipe/premailer-rails3"
+ s.summary = %q{Easily create HTML emails in Rails 3.}
+ s.description = %q{This gem brings you the power of the premailer gem to Rails 3
+ without any configuration needs. Create HTML emails, include a
+ CSS file as you do in a normal HTML document and premailer will
+ inline the included CSS.}
+
+ s.rubyforge_project = "premailer-rails3"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ s.add_dependency("premailer", ["~> 1.7"])
+end

0 comments on commit 64c4611

Please sign in to comment.