juicer 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -1
- data/VERSION +1 -1
- data/lib/juicer.rb +1 -1
- data/lib/juicer/css_cache_buster.rb +1 -0
- data/test/data/css/test.css +4 -0
- data/test/test_helper.rb +4 -0
- data/test/unit/juicer/css_cache_buster_test.rb +10 -2
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
== 1.0.2 / 2010-03-19
|
2
|
+
* Don't add multiple cache busters
|
3
|
+
|
1
4
|
== 1.0.1 / 2010-03-03
|
2
5
|
* Don't crash when trying to cache bust non-existent files, simply
|
3
6
|
skip them
|
4
|
-
* Don't attempt to cache bust data urls
|
7
|
+
* Don't attempt to cache bust data urls (contributed by
|
8
|
+
http://github.com/psyho/juicer)
|
5
9
|
|
6
10
|
== 1.0.0 / 2010-02-24
|
7
11
|
* Make sure @import rules with url is removed when files are merged
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/lib/juicer.rb
CHANGED
@@ -44,6 +44,7 @@ module Juicer
|
|
44
44
|
begin
|
45
45
|
next if used.include?(asset.path)
|
46
46
|
@contents.gsub!(asset.path, asset.path(:cache_buster_type => @type))
|
47
|
+
used.push(asset.path)
|
47
48
|
rescue Errno::ENOENT
|
48
49
|
puts "Unable to locate file #{asset.path}, skipping cache buster"
|
49
50
|
rescue ArgumentError => e
|
data/test/data/css/test.css
CHANGED
data/test/test_helper.rb
CHANGED
@@ -14,8 +14,8 @@ class TestCssCacheBuster < Test::Unit::TestCase
|
|
14
14
|
context "finding urls" do
|
15
15
|
should "find all urls" do
|
16
16
|
urls = @buster.urls(path("css/test.css"))
|
17
|
-
assert_equal
|
18
|
-
assert_equal "../a1.css../images/1.png2.gif", urls.collect { |a| a.path }.sort.join.gsub(path("/"), "")
|
17
|
+
assert_equal 4, urls.length
|
18
|
+
assert_equal "../a1.css../images/1.png2.gif2.gif", urls.collect { |a| a.path }.sort.join.gsub(path("/"), "")
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -29,6 +29,14 @@ class TestCssCacheBuster < Test::Unit::TestCase
|
|
29
29
|
assert_match(/[^\?]*\?jcb=\d+/, path.first)
|
30
30
|
end
|
31
31
|
end
|
32
|
+
|
33
|
+
should "not add multiple cache busters" do
|
34
|
+
file = path("css/test.css")
|
35
|
+
buster = Juicer::CssCacheBuster.new
|
36
|
+
buster.save file
|
37
|
+
|
38
|
+
assert_no_match /2\.gif\?jcb=\d+\?jcb=/, File.read(file)
|
39
|
+
end
|
32
40
|
end
|
33
41
|
|
34
42
|
context "absolute paths" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: juicer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Johansen
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-03-
|
12
|
+
date: 2010-03-19 00:00:00 +01:00
|
13
13
|
default_executable: juicer
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|