asset_fingerprinter 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,9 +7,13 @@ module AssetFingerprinter
7
7
  # Digests a file and returns the cachebusted path
8
8
 
9
9
  def initialize
10
- @cache = Hash.new{ |hash,key|
11
- hash[key] = ::Digest::MD5.hexdigest(File.read(root ? File.join(root, key) : key))
12
- }
10
+ @cache = Hash.new do |hash,key|
11
+ begin
12
+ hash[key] = ::Digest::MD5.hexdigest(File.read(root ? File.join(root, key) : key))
13
+ rescue Errno::ENOENT
14
+ # Don't set a key, maybe next time around something will happen?
15
+ end
16
+ end
13
17
  end
14
18
 
15
19
  def call(path)
@@ -1,3 +1,3 @@
1
1
  module AssetFingerprinter
2
- VERSION = "0.0.3"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -61,6 +61,10 @@ describe Fingerprinter::Digest do
61
61
  it "should fingerprint paths with query string params" do
62
62
  Fingerprinter::Digest.new.call("#{@file}?color=red&size=large").should eql(@digest)
63
63
  end
64
+
65
+ it "should not throw exception if file is missing" do
66
+ Fingerprinter::Digest.new.call('i dont exist').should be_nil
67
+ end
64
68
  end
65
69
 
66
70
  describe PathRewriter do
metadata CHANGED
@@ -1,34 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: asset_fingerprinter
3
- version: !ruby/object:Gem::Version
4
- hash: 25
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 3
10
- version: 0.0.3
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Steel Fu, Brad Gessler
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-05-12 00:00:00 -07:00
19
- default_executable:
12
+ date: 2011-08-24 00:00:00.000000000Z
20
13
  dependencies: []
21
-
22
14
  description: The most efficient HTTP cache buster plugin evar.
23
- email:
15
+ email:
24
16
  - steel@polleverywhere.com, brad@polleverywhere.com
25
17
  executables: []
26
-
27
18
  extensions: []
28
-
29
19
  extra_rdoc_files: []
30
-
31
- files:
20
+ files:
32
21
  - .gitignore
33
22
  - Gemfile
34
23
  - Guardfile
@@ -44,41 +33,31 @@ files:
44
33
  - spec/asset_fingerprinter_spec.rb
45
34
  - spec/rails/public/something.file
46
35
  - spec/spec_helper.rb
47
- has_rdoc: true
48
36
  homepage: http://www.polleverywhere.com/
49
37
  licenses: []
50
-
51
38
  post_install_message:
52
39
  rdoc_options: []
53
-
54
- require_paths:
40
+ require_paths:
55
41
  - lib
56
- required_ruby_version: !ruby/object:Gem::Requirement
42
+ required_ruby_version: !ruby/object:Gem::Requirement
57
43
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 3
62
- segments:
63
- - 0
64
- version: "0"
65
- required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
49
  none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
72
- - 0
73
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
74
54
  requirements: []
75
-
76
55
  rubyforge_project: asset_fingerprinter
77
- rubygems_version: 1.4.2
56
+ rubygems_version: 1.8.6
78
57
  signing_key:
79
58
  specification_version: 3
80
59
  summary: A Gem inspired by the Rails AssetFingerPrinter plugin.
81
- test_files:
60
+ test_files:
82
61
  - spec/asset_fingerprinter_spec.rb
83
62
  - spec/rails/public/something.file
84
63
  - spec/spec_helper.rb