juicer 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +7 -4
- data/VERSION +1 -1
- data/lib/juicer.rb +1 -1
- data/lib/juicer/cache_buster.rb +3 -3
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
juicer (1.
|
4
|
+
juicer (1.1.1)
|
5
5
|
cmdparse
|
6
6
|
nokogiri (>= 1.5.0)
|
7
|
-
rubyzip
|
7
|
+
rubyzip (= 0.9.9)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
@@ -23,11 +23,14 @@ GEM
|
|
23
23
|
rdoc
|
24
24
|
json (1.7.5)
|
25
25
|
metaclass (0.0.1)
|
26
|
+
mini_portile (0.5.2)
|
26
27
|
mocha (0.12.7)
|
27
28
|
metaclass (~> 0.0.1)
|
28
29
|
multi_json (1.3.6)
|
29
|
-
nokogiri (1.
|
30
|
-
|
30
|
+
nokogiri (1.6.0)
|
31
|
+
mini_portile (~> 0.5.0)
|
32
|
+
nokogiri (1.6.0-x86-mingw32)
|
33
|
+
mini_portile (~> 0.5.0)
|
31
34
|
rake (0.9.2.2)
|
32
35
|
rdoc (3.12)
|
33
36
|
json (~> 1.4)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/lib/juicer.rb
CHANGED
data/lib/juicer/cache_buster.rb
CHANGED
@@ -84,7 +84,7 @@ module Juicer
|
|
84
84
|
type = [:soft, :hard, :rails, :md5].include?(type) ? type : :soft
|
85
85
|
parameter = nil if type == :rails
|
86
86
|
file = self.clean(file, parameter)
|
87
|
-
filename = file.split(
|
87
|
+
filename = file.split(/[\?\#]/).first
|
88
88
|
raise ArgumentError.new("#{file} could not be found") unless File.exists?(filename)
|
89
89
|
mtime = File.mtime(filename).to_i
|
90
90
|
|
@@ -95,10 +95,10 @@ module Juicer
|
|
95
95
|
return "#{file}#{file.index('?') ? '' : "?#{mtime}"}"
|
96
96
|
elsif type == :md5
|
97
97
|
md5 = Digest::MD5.hexdigest(File.read(filename))
|
98
|
-
return file.sub(/(\.[^\.]
|
98
|
+
return file.sub(/(\.[^\.]+([\?\#].*)?$)/, "-#{parameter}#{md5}" + '\1')
|
99
99
|
end
|
100
100
|
|
101
|
-
file.sub(/(\.[^\.]
|
101
|
+
file.sub(/(\.[^\.]+([\?\#].*)?$)/, "-#{parameter}#{mtime}" + '\1')
|
102
102
|
end
|
103
103
|
|
104
104
|
#
|