voog-kit 0.5.8 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/voog/dtk/filemanager.rb +5 -14
- data/lib/voog/dtk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 618acbfe55808ed71c5f71a5b8482b41c51bfc178a87689bd0d5736b5482594f
|
4
|
+
data.tar.gz: ee3d0879f105a0b8e3602979fb8566ebf48df97e43d329740c0a77d2beb8046a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcb51f26bb93bef797da6da4c105a39426281bfe415fa7c629b7b48e76d99d4f6549bf580642bb41df65181d25a33b208a9d29f4829409da250b511a4805d014
|
7
|
+
data.tar.gz: 49c675bbb059d73c6e9d9f08a5b7ecd49b07f887f99d24dcb0850da014da21cdf0852a48d78a8e83bf54d50ee7163b6f1078b3a03423bcc6f51dcf4d0959053b
|
data/lib/voog/dtk/filemanager.rb
CHANGED
@@ -34,8 +34,10 @@ module Voog::Dtk
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def write_manifest(manifest)
|
37
|
-
|
38
|
-
manifest[
|
37
|
+
%w(assets layouts).each do |k|
|
38
|
+
if manifest[k].is_a?(Array)
|
39
|
+
manifest[k].sort! { |a, b| a['file'] <=> b['file'] || 0 }
|
40
|
+
end
|
39
41
|
end
|
40
42
|
File.open('manifest.json', 'w+', encoding: 'UTF-8') do |file|
|
41
43
|
file << JSON.pretty_generate(manifest)
|
@@ -337,7 +339,7 @@ module Voog::Dtk
|
|
337
339
|
'preview_medium' => "",
|
338
340
|
'preview_small' => "",
|
339
341
|
'author' => "",
|
340
|
-
'layouts' =>
|
342
|
+
'layouts' => (layouts + components),
|
341
343
|
'assets' => assets
|
342
344
|
}
|
343
345
|
if @old_manifest
|
@@ -356,15 +358,6 @@ module Voog::Dtk
|
|
356
358
|
generate_manifest get_layouts, get_layout_assets
|
357
359
|
end
|
358
360
|
|
359
|
-
def sort_layouts_by_content_type(layouts)
|
360
|
-
# make sure that 'blog' is before 'blog_article' and 'elements' is before 'element'
|
361
|
-
preferred_order = %w(page blog blog_article elements element error_401 error_404 photoset component)
|
362
|
-
|
363
|
-
layouts.sort do |a, b|
|
364
|
-
preferred_order.index(a.fetch('content_type')) <=> preferred_order.index(b.fetch('content_type'))
|
365
|
-
end
|
366
|
-
end
|
367
|
-
|
368
361
|
def generate_manifest(layouts = nil, layout_assets = nil)
|
369
362
|
layouts ||= get_layouts
|
370
363
|
layout_assets ||= get_layout_assets
|
@@ -403,8 +396,6 @@ module Voog::Dtk
|
|
403
396
|
}
|
404
397
|
end
|
405
398
|
|
406
|
-
manifest[:layouts] = sort_layouts_by_content_type(manifest[:layouts])
|
407
|
-
|
408
399
|
manifest[:assets] = layout_assets.inject(Array.new) do |memo, a|
|
409
400
|
|
410
401
|
# kind is same as asset_type for kinds that are represented in the asset_folders hash, defaults to 'asset'
|
data/lib/voog/dtk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voog-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikk Pristavka
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-12-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|