regru-premailer 1.7.4 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/lib/premailer/premailer.rb +7 -5
- data/premailer.gemspec +1 -1
- metadata +2 -2
data/lib/premailer/premailer.rb
CHANGED
|
@@ -34,7 +34,7 @@ class Premailer
|
|
|
34
34
|
include CssParser
|
|
35
35
|
|
|
36
36
|
# Premailer version.
|
|
37
|
-
VERSION = '1.7.
|
|
37
|
+
VERSION = '1.7.6'
|
|
38
38
|
|
|
39
39
|
CLIENT_SUPPORT_FILE = File.dirname(__FILE__) + '/../../misc/client_support.yaml'
|
|
40
40
|
|
|
@@ -261,6 +261,7 @@ class Premailer
|
|
|
261
261
|
protected
|
|
262
262
|
def load_css_from_local_file!(path)
|
|
263
263
|
css_block = ''
|
|
264
|
+
path.gsub!(/\Afile:\/\//, '')
|
|
264
265
|
begin
|
|
265
266
|
File.open(path, "r") do |file|
|
|
266
267
|
while line = file.gets
|
|
@@ -461,13 +462,13 @@ public
|
|
|
461
462
|
def self.resolve_link(path, base_path) # :nodoc:
|
|
462
463
|
path.strip!
|
|
463
464
|
resolved = nil
|
|
464
|
-
if path =~
|
|
465
|
+
if path =~ /\A(?:(https?|ftp|file):)\/\//i
|
|
465
466
|
resolved = path
|
|
466
467
|
Premailer.canonicalize(resolved)
|
|
467
468
|
elsif base_path.kind_of?(URI)
|
|
468
469
|
resolved = base_path.merge(path)
|
|
469
470
|
Premailer.canonicalize(resolved)
|
|
470
|
-
elsif base_path.kind_of?(String) and base_path =~ /\A(
|
|
471
|
+
elsif base_path.kind_of?(String) and base_path =~ /\A(?:(?:https?|ftp|file):)\/\//i
|
|
471
472
|
resolved = URI.parse(base_path)
|
|
472
473
|
resolved = resolved.merge(path)
|
|
473
474
|
Premailer.canonicalize(resolved)
|
|
@@ -480,8 +481,9 @@ public
|
|
|
480
481
|
#
|
|
481
482
|
# IO objects return true, as do strings that look like URLs.
|
|
482
483
|
def self.local_data?(data)
|
|
483
|
-
return true
|
|
484
|
-
return
|
|
484
|
+
return true if data.is_a?(IO) || data.is_a?(StringIO)
|
|
485
|
+
return true if data =~ /\Afile\:\/\//i
|
|
486
|
+
return false if data =~ /\A(?:(https?|ftp):)\/\//i
|
|
485
487
|
true
|
|
486
488
|
end
|
|
487
489
|
|
data/premailer.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: regru-premailer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.6
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-04-
|
|
12
|
+
date: 2013-04-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: css_parser
|