juicer 1.0.6 → 1.0.7

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/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.0.7 / 2010-08-23
2
+ * Fix bug where embedded images where re-mapped as though they where
3
+ URLs (Elliot Wood)
4
+
1
5
  == 1.0.6 / 2010-06-29
2
6
  * Fix bug where image embedding could not see the document root,
3
7
  resulting in missing images (Jakub Pawlowicz)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.6
1
+ 1.0.7
data/lib/juicer.rb CHANGED
@@ -3,7 +3,7 @@ require "logger"
3
3
  module Juicer
4
4
 
5
5
  # :stopdoc:
6
- VERSION = '1.0.6'
6
+ VERSION = '1.0.7'
7
7
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
8
8
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
9
9
  LOGGER = Logger.new(STDOUT)
@@ -69,6 +69,7 @@ module Juicer
69
69
  # Resolves a path relative to a directory
70
70
  #
71
71
  def resolve_path(url, dir)
72
+ return url if url =~ /^data:/
72
73
  path = url
73
74
 
74
75
  # Absolute URLs
@@ -216,6 +216,22 @@ EOF
216
216
  assert_equal "../images/1.png", merger.resolve_path("/images/1.png", nil)
217
217
  end
218
218
  end
219
+
220
+ should "leave data URLs untouched" do
221
+ merger = Juicer::Merger::StylesheetMerger.new([],
222
+ :document_root => "test/data",
223
+ :hosts => ["http://assets1/"])
224
+ merger << File.expand_path("path_test2.css")
225
+
226
+ Juicer::Merger::StylesheetMerger.publicize_methods do
227
+ merger.instance_eval do
228
+ @root = Pathname.new(File.expand_path("test/data/css"))
229
+ end
230
+
231
+ expected = "data:image/png;base64,ERJW"
232
+ assert_equal expected, merger.resolve_path("data:image/png;base64,ERJW", "test/data/css")
233
+ end
234
+ end
219
235
 
220
236
  should "cycle hosts for relative urls" do
221
237
  merger = Juicer::Merger::StylesheetMerger.new([],
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 6
9
- version: 1.0.6
8
+ - 7
9
+ version: 1.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Christian Johansen
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-29 00:00:00 +02:00
17
+ date: 2010-08-23 00:00:00 +02:00
18
18
  default_executable: juicer
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency