nanoc-cachebuster 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +5 -0
- data/README.md +2 -0
- data/lib/nanoc-cachebuster.rb +1 -0
- data/lib/nanoc/cachebuster.rb +6 -4
- data/lib/nanoc/cachebuster/strategy.rb +1 -2
- data/lib/nanoc/cachebuster/version.rb +1 -1
- data/spec/nanoc/filters/cache_buster_spec.rb +1 -4
- metadata +12 -13
- data/lib/nanoc/filters.rb +0 -4
- data/lib/nanoc/helpers.rb +0 -3
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
require 'nanoc/cachebuster'
|
data/lib/nanoc/cachebuster.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'nanoc'
|
2
2
|
require 'digest'
|
3
3
|
|
4
|
+
require 'nanoc/cachebuster/version'
|
5
|
+
|
4
6
|
module Nanoc
|
5
7
|
module Cachebuster
|
6
|
-
autoload :VERSION, 'cachebuster/version'
|
7
8
|
|
8
9
|
# List of file extensions that the routing system should regard
|
9
10
|
# as needing a fingerprint. These are input file extensions, so
|
@@ -38,7 +39,8 @@ module Nanoc
|
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
41
|
-
require File.expand_path('../filters', __FILE__)
|
42
|
-
require File.expand_path('../helpers', __FILE__)
|
43
|
-
require File.expand_path('../cachebuster/strategy', __FILE__)
|
44
42
|
end
|
43
|
+
|
44
|
+
require 'nanoc/cachebuster/strategy'
|
45
|
+
require 'nanoc/filters/cache_buster'
|
46
|
+
require 'nanoc/helpers/cache_busting'
|
@@ -110,7 +110,7 @@ module Nanoc
|
|
110
110
|
if current_item[:content_filename]
|
111
111
|
File.expand_path(File.join(File.dirname(current_item[:content_filename]), path)).sub(/^#{Dir.pwd}/, '').sub(/^\/content/, '')
|
112
112
|
else
|
113
|
-
File.
|
113
|
+
File.join(File.dirname(current_item.path), path)
|
114
114
|
end
|
115
115
|
end
|
116
116
|
end
|
@@ -157,4 +157,3 @@ module Nanoc
|
|
157
157
|
end
|
158
158
|
end
|
159
159
|
end
|
160
|
-
|
@@ -147,10 +147,7 @@ describe Nanoc::Filters::CacheBuster do
|
|
147
147
|
|
148
148
|
it_should_not_filter %Q{background: url(foo.png);}
|
149
149
|
end
|
150
|
-
|
151
|
-
# Needs documentation on what this test is actually testing, and thinking on convention.
|
152
|
-
# This is currently responding to the else on line 113 of cachebuster#strategy.rb which is not adding the cb hash to the end of the file name.
|
153
|
-
# Need to discover under what condition does an item has no :content_filename and consider what is best convention to handle this case.
|
150
|
+
|
154
151
|
describe 'when the current item has no content path' do
|
155
152
|
let(:target) { MockItem.image_file '/foo.png', '/../images/foo-cb123456789.png' }
|
156
153
|
let(:item) { MockItem.generated_css_file }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc-cachebuster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nanoc
|
16
|
-
requirement: &
|
16
|
+
requirement: &70312252439040 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.3.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70312252439040
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70312252438620 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70312252438620
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70312252438160 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70312252438160
|
47
47
|
description: ! 'Your website should use far-future expires headers on static assets,
|
48
48
|
to make
|
49
49
|
|
@@ -81,12 +81,11 @@ files:
|
|
81
81
|
- LICENSE
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
|
+
- lib/nanoc-cachebuster.rb
|
84
85
|
- lib/nanoc/cachebuster.rb
|
85
86
|
- lib/nanoc/cachebuster/strategy.rb
|
86
87
|
- lib/nanoc/cachebuster/version.rb
|
87
|
-
- lib/nanoc/filters.rb
|
88
88
|
- lib/nanoc/filters/cache_buster.rb
|
89
|
-
- lib/nanoc/helpers.rb
|
90
89
|
- lib/nanoc/helpers/cache_busting.rb
|
91
90
|
- nanoc-cachebuster.gemspec
|
92
91
|
- spec/nanoc/filters/cache_buster_spec.rb
|
@@ -106,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
105
|
version: '0'
|
107
106
|
segments:
|
108
107
|
- 0
|
109
|
-
hash: -
|
108
|
+
hash: -1449409011190348151
|
110
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
110
|
none: false
|
112
111
|
requirements:
|
@@ -115,10 +114,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
114
|
version: '0'
|
116
115
|
segments:
|
117
116
|
- 0
|
118
|
-
hash: -
|
117
|
+
hash: -1449409011190348151
|
119
118
|
requirements: []
|
120
119
|
rubyforge_project: nanoc-cachebuster
|
121
|
-
rubygems_version: 1.8.
|
120
|
+
rubygems_version: 1.8.17
|
122
121
|
signing_key:
|
123
122
|
specification_version: 3
|
124
123
|
summary: Adds filters and helpers for cache busting to Nanoc
|
data/lib/nanoc/filters.rb
DELETED
data/lib/nanoc/helpers.rb
DELETED