jekyll-assets 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 0.3.7 (2013-04-29)
2
+
3
+ * Refactor AssetFile to avoid stale assets caching. See #23.
4
+
5
+
1
6
  ### 0.3.6 (2013-04-28)
2
7
 
3
8
  * Ruby 2.0.0 support. See #16.
@@ -1,50 +1,49 @@
1
- # stdlib
2
- require "forwardable"
3
-
4
-
5
1
  module Jekyll
6
2
  module AssetsPlugin
7
3
  class AssetFile
8
4
 
9
- extend Forwardable
10
-
11
-
12
5
  @@mtimes = Hash.new
13
6
 
14
7
 
15
- attr_reader :asset
16
-
17
-
18
- def_delegator :@site, :assets_config, :config
19
- def_delegator :@asset, :content_type
8
+ attr_reader :logical_path
20
9
 
21
10
 
22
11
  def initialize site, asset
23
- @site, @asset = site, asset
12
+ @site, @logical_path = site, asset.logical_path
24
13
  end
25
14
 
26
15
 
27
16
  def destination dest
28
- File.join dest, config.dirname, filename
17
+ File.join dest, @site.assets_config.dirname, filename
29
18
  end
30
19
 
31
20
 
32
21
  def filename
33
- case config.cachebust
22
+ case cachebust = @site.assets_config.cachebust
34
23
  when :none, :soft then asset.logical_path
35
24
  when :hard then asset.digest_path
36
- else raise "Unknown cachebust strategy: #{config.cachebust.inspect}"
25
+ else raise "Unknown cachebust strategy: #{cachebust.inspect}"
37
26
  end
38
27
  end
39
28
 
40
29
 
30
+ def asset
31
+ @site.assets[logical_path]
32
+ end
33
+
34
+
35
+ def content_type
36
+ asset.content_type
37
+ end
38
+
39
+
41
40
  def path
42
- @asset.pathname.to_s
41
+ asset.pathname.to_s
43
42
  end
44
43
 
45
44
 
46
45
  def mtime
47
- @asset.mtime.to_i
46
+ asset.mtime.to_i
48
47
  end
49
48
 
50
49
 
@@ -59,29 +58,26 @@ module Jekyll
59
58
  return false if File.exist?(dest_path) and !modified?
60
59
  @@mtimes[path] = mtime
61
60
 
62
- @asset.write_to dest_path
63
- @asset.write_to "#{dest_path}.gz" if gzip?
61
+ asset.write_to dest_path
62
+ asset.write_to "#{dest_path}.gz" if gzip?
64
63
 
65
64
  true
66
65
  end
67
66
 
68
67
 
69
68
  def == other
70
- case other
71
- when AssetFile then @asset == other.asset
72
- when Sprockets::Asset then @asset == other
73
- else false
74
- end
69
+ return false unless other.respond_to? :logical_path
70
+ other.logical_path == logical_path
75
71
  end
76
72
 
77
73
 
78
74
  def gzip?
79
- config.gzip && config.gzip.include?(content_type)
75
+ @site.assets_config.gzip.include? content_type
80
76
  end
81
77
 
82
78
 
83
79
  def to_s
84
- "#<Jekyll::AssetsPlugin::AssetFile:#{asset.logical_path}>"
80
+ "#<Jekyll::AssetsPlugin::AssetFile:#{logical_path}>"
85
81
  end
86
82
 
87
83
  end
@@ -47,7 +47,7 @@ module Jekyll
47
47
 
48
48
  def gzip
49
49
  return @data.gzip if @data.gzip.is_a? Array
50
- @data.gzip ? DEFAULTS[:gzip] : false
50
+ @data.gzip ? DEFAULTS[:gzip] : []
51
51
  end
52
52
 
53
53
 
@@ -3,7 +3,6 @@ require "sprockets"
3
3
 
4
4
 
5
5
  # internal
6
- require "jekyll/assets_plugin/asset_file"
7
6
  require "jekyll/assets_plugin/liquid_processor"
8
7
 
9
8
 
@@ -5,6 +5,7 @@ require "jekyll"
5
5
  # internal
6
6
  require "jekyll/assets_plugin/configuration"
7
7
  require "jekyll/assets_plugin/environment"
8
+ require "jekyll/assets_plugin/asset_file"
8
9
 
9
10
 
10
11
  module Jekyll
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module AssetsPlugin
3
- VERSION = "0.3.6"
3
+ VERSION = "0.3.7"
4
4
  end
5
5
  end
@@ -102,7 +102,7 @@ module Jekyll::AssetsPlugin
102
102
  context "when gzip is disabled" do
103
103
  let(:config){ Configuration.new(:gzip => false) }
104
104
  subject { config.gzip }
105
- it { should be false }
105
+ it { should == [] }
106
106
  end
107
107
  end
108
108
  end
metadata CHANGED
@@ -1,32 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Aleksey V Zapparov
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-04-28 00:00:00.000000000 Z
12
+ date: 2013-04-29 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: jekyll
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: sprockets
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,105 +46,118 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rake
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - '>='
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - '>='
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: rspec
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: guard-rspec
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - '>='
83
+ - - ! '>='
74
84
  - !ruby/object:Gem::Version
75
85
  version: '0'
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - '>='
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
93
  version: '0'
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: rb-inotify
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - '>='
99
+ - - ! '>='
88
100
  - !ruby/object:Gem::Version
89
101
  version: '0'
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
- - - '>='
107
+ - - ! '>='
95
108
  - !ruby/object:Gem::Version
96
109
  version: '0'
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: compass
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
- - - '>='
115
+ - - ! '>='
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
- - - '>='
123
+ - - ! '>='
109
124
  - !ruby/object:Gem::Version
110
125
  version: '0'
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: bourbon
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
- - - '>='
131
+ - - ! '>='
116
132
  - !ruby/object:Gem::Version
117
133
  version: '0'
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
- - - '>='
139
+ - - ! '>='
123
140
  - !ruby/object:Gem::Version
124
141
  version: '0'
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: neat
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
- - - '>='
147
+ - - ! '>='
130
148
  - !ruby/object:Gem::Version
131
149
  version: '0'
132
150
  type: :development
133
151
  prerelease: false
134
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
135
154
  requirements:
136
- - - '>='
155
+ - - ! '>='
137
156
  - !ruby/object:Gem::Version
138
157
  version: '0'
139
- description: |2
140
- Jekyll plugin, that allows you to write javascript/css assets in
141
- other languages such as CoffeeScript, Sass, Less and ERB, concatenate
142
- them, respecting dependencies, minify and many more.
158
+ description: ! " Jekyll plugin, that allows you to write javascript/css assets in\n
159
+ \ other languages such as CoffeeScript, Sass, Less and ERB, concatenate\n them,
160
+ respecting dependencies, minify and many more.\n"
143
161
  email:
144
162
  - ixti@member.fsf.org
145
163
  executables: []
@@ -201,27 +219,34 @@ files:
201
219
  homepage: http://ixti.github.com/jekyll-assets
202
220
  licenses:
203
221
  - MIT
204
- metadata: {}
205
222
  post_install_message:
206
223
  rdoc_options: []
207
224
  require_paths:
208
225
  - lib
209
226
  required_ruby_version: !ruby/object:Gem::Requirement
227
+ none: false
210
228
  requirements:
211
- - - '>='
229
+ - - ! '>='
212
230
  - !ruby/object:Gem::Version
213
231
  version: '0'
232
+ segments:
233
+ - 0
234
+ hash: -2575730464667574048
214
235
  required_rubygems_version: !ruby/object:Gem::Requirement
236
+ none: false
215
237
  requirements:
216
- - - '>='
238
+ - - ! '>='
217
239
  - !ruby/object:Gem::Version
218
240
  version: '0'
241
+ segments:
242
+ - 0
243
+ hash: -2575730464667574048
219
244
  requirements: []
220
245
  rubyforge_project:
221
- rubygems_version: 2.0.0
246
+ rubygems_version: 1.8.23
222
247
  signing_key:
223
- specification_version: 4
224
- summary: jekyll-assets-0.3.6
248
+ specification_version: 3
249
+ summary: jekyll-assets-0.3.7
225
250
  test_files:
226
251
  - spec/fixtures/.gitignore
227
252
  - spec/fixtures/_assets/app.css.erb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 832045a15d6f254fb11848378bf00c5b94894515
4
- data.tar.gz: 2985a2194b2393f21199d8faf70a22d33e6f133a
5
- SHA512:
6
- metadata.gz: 217c2da729697c4e7cc95aa0e7c424ae234423ce8b94ac0ee27e8d1a47069316bd1342f189d0c2a54fa52ac8ac3eab1bbdac59d4c2610e9349f9a7c7af0cebce
7
- data.tar.gz: 118175635e6306e85929ff95549a927b695600416417f549310d6333e3ab1d0adb4778623165aa1bb6846a3350bea4902f205d5b147678e1ee42cff899811d06