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 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
+ 1.0.2
data/lib/juicer.rb CHANGED
@@ -3,7 +3,7 @@ require "logger"
3
3
  module Juicer
4
4
 
5
5
  # :stopdoc:
6
- VERSION = '1.0.1'
6
+ VERSION = '1.0.2'
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)
@@ -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
@@ -9,3 +9,7 @@ h1 {
9
9
  h2 {
10
10
  background: url(2.gif) no-repeat;
11
11
  }
12
+
13
+ p {
14
+ background: url(2.gif) no-repeat;
15
+ }
data/test/test_helper.rb CHANGED
@@ -117,6 +117,10 @@ h1 {
117
117
  h2 {
118
118
  background: url(2.gif) no-repeat;
119
119
  }
120
+
121
+ p {
122
+ background: url(2.gif) no-repeat;
123
+ }
120
124
  CSS
121
125
 
122
126
  mkfile(css_dir, 'test.css', css)
@@ -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 3, urls.length
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.1
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-03 00:00:00 +01:00
12
+ date: 2010-03-19 00:00:00 +01:00
13
13
  default_executable: juicer
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency