mikedamage-premailer-plus 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/LICENSE +42 -20
  2. data/README.textile +4 -2
  3. data/VERSION.yml +1 -1
  4. data/lib/premailer.rb +6 -1
  5. metadata +1 -1
data/LICENSE CHANGED
@@ -1,20 +1,42 @@
1
- Copyright (c) 2009 Mike Green
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Premailer License
2
+
3
+ Copyright (c) 2007 Alex Dunae
4
+
5
+ Premailer is copyrighted free software by Alex Dunae (http://dunae.ca/).
6
+ You can redistribute it and/or modify it under the conditions below:
7
+
8
+ 1. You may make and give away verbatim copies of the source form of the
9
+ software without restriction, provided that you duplicate all of the
10
+ original copyright notices and associated disclaimers.
11
+
12
+ 2. You may modify your copy of the software in any way, provided that
13
+ you do at least ONE of the following:
14
+
15
+ a) place your modifications in the Public Domain or otherwise
16
+ make them Freely Available, such as by posting said
17
+ modifications to the internet or an equivalent medium, or by
18
+ allowing the author to include your modifications in the software.
19
+
20
+ b) use the modified software only within your corporation or
21
+ organization.
22
+
23
+ c) rename any non-standard executables so the names do not conflict
24
+ with standard executables, which must also be provided.
25
+
26
+ d) make other distribution arrangements with the author.
27
+
28
+ 3. You may modify and include the part of the software into any other
29
+ software (possibly commercial) as long as clear acknowledgement and
30
+ a link back to the original software (http://code.dunae.ca/premailer.web/)
31
+ is provided.
32
+
33
+ 5. The scripts and library files supplied as input to or produced as
34
+ output from the software do not automatically fall under the
35
+ copyright of the software, but belong to whomever generated them,
36
+ and may be sold commercially, and may be aggregated with this
37
+ software.
38
+
39
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
40
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
41
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42
+ PURPOSE.
data/README.textile CHANGED
@@ -1,8 +1,10 @@
1
1
  h1. premailer-plus
2
2
 
3
- |*By:*||Mike Green ("mike.is.green@gmail.com":mailto:mike.is.green@gmail.com)|
3
+ |*Misc. improvements by:*||Mike Green ("mike.is.green@gmail.com":mailto:mike.is.green@gmail.com)|
4
4
  |*Original Premailer By:*||Alex Dunae ("http://www.dunae.ca":http://www.dunae.ca)|
5
5
 
6
+ Check out the Premailer web application at http://code.dunae.ca/premailer.web
7
+
6
8
  h2. Background
7
9
 
8
10
  Premailer Plus is my set of additions and corrections to Alex Dunae's excellent "Premailer":http://code.dunae.ca/premailer.web/ application. Premailer is "Preflight for HTML email", i.e. it takes your HTML code, and makes it compatible with most email clients. Email clients aren't like web browsers; their support for CSS is spotty and erratic, and they don't always render your code the way you'd expect. Premailer takes your CSS and moves it inline to each matched HTML element, and it displays warnings if you use code that's not well supported by email clients. "Campaign Monitor":http://www.campaignmonitor.com sponsors and uses Premailer to get your code ready for mass emails. It's a one of a kind, indispensible service, but I've always had a few gripes about the Premailer Rubygem, so I finally decided to fork the code and apply my fixes and improvements.
@@ -38,4 +40,4 @@ h2. Dependencies
38
40
 
39
41
  h2. Copyright
40
42
 
41
- Copyright (C) 2009 Mike Green. See LICENSE for details.
43
+ Since I only improved Premailer's handling of local files and gave it the ability to shorten URL's, the copyright to this code is still held by Alex Dunae. I am only modifying and redistributing his code in compliance with the terms of Premailer's license.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 1
4
+ :patch: 2
data/lib/premailer.rb CHANGED
@@ -12,6 +12,7 @@ require 'yaml'
12
12
  require 'open-uri'
13
13
  require 'hpricot'
14
14
  require 'css_parser'
15
+ require 'tempfile'
15
16
 
16
17
  require 'html_to_plain_text'
17
18
 
@@ -180,7 +181,11 @@ protected
180
181
  if @is_local_file
181
182
  Hpricot(File.open(uri, "r") {|f| f.read })
182
183
  else
183
- Hpricot(open(uri))
184
+ @temp_file = Tempfile.new("premailer_plus")
185
+ @temp_file.write(open(uri).read)
186
+ @temp_file.close
187
+ @is_local_file = true
188
+ Hpricot(@temp_file.open.read)
184
189
  end
185
190
  end
186
191
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mikedamage-premailer-plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Green