alula 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/alula/config.rb +1 -0
- data/lib/alula/core_ext.rb +0 -1
- data/lib/alula/site.rb +16 -9
- metadata +3 -4
- data/lib/alula/core_ext/manifest.rb +0 -30
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/lib/alula/config.rb
CHANGED
data/lib/alula/core_ext.rb
CHANGED
data/lib/alula/site.rb
CHANGED
@@ -335,11 +335,16 @@ module Alula
|
|
335
335
|
progress.create :assets, title: "Compiling assets", total: @environment.each_logical_path.count
|
336
336
|
progress.display
|
337
337
|
|
338
|
-
@
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
338
|
+
@environment.each_logical_path do |logical_path|
|
339
|
+
if asset = @environment.find_asset(logical_path)
|
340
|
+
target = File.join(@storage.path(:assets), asset.digest_path)
|
341
|
+
asset.write_to(target)
|
342
|
+
asset.write_to("#{target}.gz") if target =~ /\.(css|js)$/ and self.config.assets.gzip
|
343
|
+
end
|
344
|
+
|
345
|
+
progress.step :assets
|
346
|
+
end
|
347
|
+
|
343
348
|
progress.finish(:assets)
|
344
349
|
progress.hide
|
345
350
|
end
|
@@ -394,10 +399,12 @@ module Alula
|
|
394
399
|
say "==> Cleaning up"
|
395
400
|
|
396
401
|
asset_path = @storage.path(:assets)
|
397
|
-
assets = @environment.used
|
398
|
-
|
399
|
-
|
400
|
-
|
402
|
+
assets = @environment.used.collect do |asset_name|
|
403
|
+
if asset = @environment[asset_name]
|
404
|
+
filename = File.join(asset_path, asset.digest_path)
|
405
|
+
[filename, self.config.assets.gzip ? "#{filename}.gz" : ""]
|
406
|
+
end
|
407
|
+
end.flatten.reject { |u| u.nil? or !File.exists?(u) }
|
401
408
|
outputted = @storage.outputted.reject{|o|o[/^#{asset_path}/]}
|
402
409
|
|
403
410
|
keep = (assets + outputted).collect{|p| File.expand_path(p)}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alula
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -478,7 +478,6 @@ files:
|
|
478
478
|
- lib/alula/core_ext/environment.rb
|
479
479
|
- lib/alula/core_ext/filter.rb
|
480
480
|
- lib/alula/core_ext/filters/smilies.rb
|
481
|
-
- lib/alula/core_ext/manifest.rb
|
482
481
|
- lib/alula/core_ext/tag.rb
|
483
482
|
- lib/alula/core_ext/tags/attachment.rb
|
484
483
|
- lib/alula/core_ext/tags/blockquote.rb
|
@@ -644,7 +643,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
644
643
|
version: '0'
|
645
644
|
segments:
|
646
645
|
- 0
|
647
|
-
hash: -
|
646
|
+
hash: -1743979110796598187
|
648
647
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
649
648
|
none: false
|
650
649
|
requirements:
|
@@ -653,7 +652,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
653
652
|
version: '0'
|
654
653
|
segments:
|
655
654
|
- 0
|
656
|
-
hash: -
|
655
|
+
hash: -1743979110796598187
|
657
656
|
requirements: []
|
658
657
|
rubyforge_project:
|
659
658
|
rubygems_version: 1.8.23
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'sprockets/manifest'
|
2
|
-
|
3
|
-
module Alula
|
4
|
-
class Manifest < Sprockets::Manifest
|
5
|
-
attr_accessor :progress
|
6
|
-
|
7
|
-
def assets_with_tracking
|
8
|
-
@_assets ||= AssetTracker.new assets_without_tracking, @progress
|
9
|
-
end
|
10
|
-
alias_method :assets_without_tracking, :assets
|
11
|
-
alias_method :assets, :assets_with_tracking
|
12
|
-
|
13
|
-
private
|
14
|
-
class AssetTracker
|
15
|
-
def initialize(hash, progress_callback)
|
16
|
-
@hash = hash
|
17
|
-
@progress_cb = progress_callback
|
18
|
-
end
|
19
|
-
|
20
|
-
def [](key)
|
21
|
-
@hash[key]
|
22
|
-
end
|
23
|
-
|
24
|
-
def []=(key, value)
|
25
|
-
@hash[key] = value
|
26
|
-
@progress_cb.call if @progress_cb
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|