web_resource_bundler 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/web_resource_bundler/filters/bundle_filter.rb +0 -1
- data/lib/web_resource_bundler/filters/image_encode_filter/image_data.rb +1 -2
- data/lib/web_resource_bundler.rb +1 -0
- data/spec/web_resource_bundler/filters/image_encode_filter/image_data_spec.rb +8 -0
- data/web_resource_bundler.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.20
|
@@ -22,8 +22,7 @@ module WebResourceBundler
|
|
22
22
|
if @exist
|
23
23
|
@size = File.size(@path)
|
24
24
|
name, @extension = File.basename(@path).split('.')
|
25
|
-
|
26
|
-
@id = name + rand(MAX_RAND_FOR_ID).to_s
|
25
|
+
@id = Digest::MD5.hexdigest(url)
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
data/lib/web_resource_bundler.rb
CHANGED
@@ -37,6 +37,14 @@ module WebResourceBundler::Filters::ImageEncodeFilter
|
|
37
37
|
@data.id.should_not equal(new_data.id)
|
38
38
|
end
|
39
39
|
|
40
|
+
it "should generate the same id for the same image" do
|
41
|
+
data1 = ImageData.new(image_path("good.jpg"), settings[:resource_dir])
|
42
|
+
data2 = ImageData.new(image_path("good.jpg"), settings[:resource_dir])
|
43
|
+
data1.id.should_not be_nil
|
44
|
+
data1.id.should == Digest::MD5.hexdigest(data1.url)
|
45
|
+
data1.id.should == data2.id
|
46
|
+
end
|
47
|
+
|
40
48
|
describe "#construct_mthml_image_data" do
|
41
49
|
it "should return proper data" do
|
42
50
|
result = '--' + CssGenerator::SEPARATOR + "\n" +
|