asset_fingerprinter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in asset_fingerprinter.gemspec
4
+ gemspec
5
+
6
+ group :development, :test do
7
+ gem 'rspec'
8
+ gem 'guard-rspec'
9
+ gem 'guard-bundler'
10
+ gem 'rb-fsevent'
11
+ gem 'growl'
12
+ end
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "asset_fingerprinter/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "asset_fingerprinter"
7
+ s.version = AssetFingerprinter::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Steel Fu, Brad Gessler"]
10
+ s.email = ["steel@polleverywhere.com, brad@polleverywhere.com"]
11
+ s.homepage = "http://www.polleverywhere.com/"
12
+ s.summary = %q{A Gem inspired by the Rails AssetFingerPrinter plugin}
13
+ s.description = %q{An effecient HTTP cache buster}
14
+
15
+ s.rubyforge_project = "asset_fingerprinter"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+ end
@@ -0,0 +1,14 @@
1
+ require 'digest/md5'
2
+
3
+ module AssetFingerprinter
4
+ class DigestFingerprint
5
+ # Digests a file and returns the cachebusted path
6
+ def initialize
7
+ @cache = Hash.new{ |hash,key| hash[key] = Digest::MD5.hexdigest(File.read(key)) }
8
+ end
9
+
10
+ def call(path)
11
+ @cache[path]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ module AssetFingerprinter
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asset_fingerprinter
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Steel Fu, Brad Gessler
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-05-10 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: An effecient HTTP cache buster
23
+ email:
24
+ - steel@polleverywhere.com, brad@polleverywhere.com
25
+ executables: []
26
+
27
+ extensions: []
28
+
29
+ extra_rdoc_files: []
30
+
31
+ files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - Rakefile
35
+ - asset_fingerprinter.gemspec
36
+ - lib/asset_fingerprinter.rb
37
+ - lib/asset_fingerprinter/version.rb
38
+ has_rdoc: true
39
+ homepage: http://www.polleverywhere.com/
40
+ licenses: []
41
+
42
+ post_install_message:
43
+ rdoc_options: []
44
+
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ hash: 3
53
+ segments:
54
+ - 0
55
+ version: "0"
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ requirements: []
66
+
67
+ rubyforge_project: asset_fingerprinter
68
+ rubygems_version: 1.6.2
69
+ signing_key:
70
+ specification_version: 3
71
+ summary: A Gem inspired by the Rails AssetFingerPrinter plugin
72
+ test_files: []
73
+