jekyll-tasks 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +7 -7
- data/_collection1/collection1.md +2 -0
- data/_collection1/subfolder-without-father/menu-without-father.md +5 -0
- data/_collection1/subfolder-without-name/menu-without-name.md +5 -0
- data/_collection1/{subfolder → subfolder1}/product-lost.md +0 -0
- data/_collection1/subfolder1/product-without-father.md +3 -0
- data/_collection1/{subfolder → subfolder1}/subfolder1.md +0 -0
- data/_collection2/collection2.md +2 -0
- data/lib/jekyll/tasks/menus.rb +51 -15
- data/lib/jekyll/tasks/products.rb +4 -0
- data/lib/jekyll/tasks/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0daec4cd29ddca6e7c68b64b0ade2f1ff018e52f2e374f5d5c6660fe7b36acb9
|
4
|
+
data.tar.gz: ccad93b3f4c10d3473701d88e335e6832c758b1cbd022f7a6156926b03a0e235
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7716006decd4fdd3ba6e871928fc88a9f3e488fcefb158e6209dd4bc22d469c46ff0328c448997ce92bd7e5794ecf38039045388ad0e7e9cfbacb0b318fa34f
|
7
|
+
data.tar.gz: 505a6f93bea6ae83acdd534790f495be7a27f88d2d9775ed84048400c74919bc26f6c9376a9e7eb92b964d2c1a903d494d2b107afd0a774c63029d3476303a2c
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jekyll-tasks (0.3.
|
4
|
+
jekyll-tasks (0.3.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -12,23 +12,23 @@ GEM
|
|
12
12
|
docile (1.3.5)
|
13
13
|
minitest (5.14.4)
|
14
14
|
parallel (1.20.1)
|
15
|
-
parser (3.0.
|
15
|
+
parser (3.0.2.0)
|
16
16
|
ast (~> 2.4.1)
|
17
17
|
rainbow (3.0.0)
|
18
18
|
rake (13.0.6)
|
19
19
|
regexp_parser (2.1.1)
|
20
20
|
rexml (3.2.5)
|
21
|
-
rubocop (1.
|
21
|
+
rubocop (1.18.3)
|
22
22
|
parallel (~> 1.10)
|
23
23
|
parser (>= 3.0.0.0)
|
24
24
|
rainbow (>= 2.2.2, < 4.0)
|
25
25
|
regexp_parser (>= 1.8, < 3.0)
|
26
26
|
rexml
|
27
|
-
rubocop-ast (>= 1.
|
27
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
28
28
|
ruby-progressbar (~> 1.7)
|
29
29
|
unicode-display_width (>= 1.4.0, < 3.0)
|
30
|
-
rubocop-ast (1.
|
31
|
-
parser (>=
|
30
|
+
rubocop-ast (1.8.0)
|
31
|
+
parser (>= 3.0.1.1)
|
32
32
|
ruby-progressbar (1.11.0)
|
33
33
|
simplecov (0.18.5)
|
34
34
|
docile (~> 1.1)
|
@@ -44,7 +44,7 @@ DEPENDENCIES
|
|
44
44
|
jekyll-tasks!
|
45
45
|
minitest (~> 5.14)
|
46
46
|
rake (~> 13.0)
|
47
|
-
rubocop (~> 1.
|
47
|
+
rubocop (~> 1.18)
|
48
48
|
|
49
49
|
BUNDLED WITH
|
50
50
|
2.1.4
|
data/_collection1/collection1.md
CHANGED
File without changes
|
File without changes
|
data/_collection2/collection2.md
CHANGED
data/lib/jekyll/tasks/menus.rb
CHANGED
@@ -6,14 +6,15 @@ module Jekyll
|
|
6
6
|
module Menus
|
7
7
|
extend self
|
8
8
|
|
9
|
-
def
|
10
|
-
conflicts =
|
11
|
-
|
12
|
-
conflicts.
|
9
|
+
def search_conflicts
|
10
|
+
conflicts = []
|
11
|
+
conflicts << (search_conflicts_with_properties | search_conflicts_without_properties)
|
12
|
+
conflicts.flatten!
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def search_conflicts_with_properties
|
16
16
|
conflicts = []
|
17
|
+
|
17
18
|
per_collection(%w[name father]).each do |el|
|
18
19
|
properties = el['properties']
|
19
20
|
|
@@ -23,8 +24,20 @@ module Jekyll
|
|
23
24
|
index = search_hash(properties, 'father')
|
24
25
|
father = index.nil? ? '' : properties[index]['father']
|
25
26
|
|
26
|
-
analyze_conflicts
|
27
|
+
conflicts << analyze_conflicts(el['collection'], name, father) if name != father
|
27
28
|
end
|
29
|
+
|
30
|
+
conflicts
|
31
|
+
end
|
32
|
+
|
33
|
+
def search_conflicts_without_properties
|
34
|
+
conflicts = []
|
35
|
+
|
36
|
+
Collections.get.each do |collection|
|
37
|
+
data = search_without_properties(collection) unless collection == 'pages'
|
38
|
+
conflicts << data unless data.nil?
|
39
|
+
end
|
40
|
+
|
28
41
|
conflicts
|
29
42
|
end
|
30
43
|
|
@@ -38,8 +51,19 @@ module Jekyll
|
|
38
51
|
result
|
39
52
|
end
|
40
53
|
|
41
|
-
def
|
42
|
-
|
54
|
+
def search_without_properties(collection)
|
55
|
+
conflicts = []
|
56
|
+
|
57
|
+
files = markdown_files collection
|
58
|
+
files.each do |file|
|
59
|
+
data = YAML.load_file(file)
|
60
|
+
conflicts << analyze_conflicts_without_properties(data)
|
61
|
+
end
|
62
|
+
|
63
|
+
conflicts
|
64
|
+
end
|
65
|
+
|
66
|
+
def search_properties(collection, properties, result = [])
|
43
67
|
files = markdown_files collection
|
44
68
|
files.each do |file|
|
45
69
|
data = YAML.load_file(file)
|
@@ -52,7 +76,22 @@ module Jekyll
|
|
52
76
|
|
53
77
|
private
|
54
78
|
|
55
|
-
def
|
79
|
+
def analyze_conflicts_without_properties(data, conflicts = [])
|
80
|
+
conflicts << "Product without father: '#{data['title']}'" if Products.product_without_father data
|
81
|
+
conflicts << "Menu without name: '#{data['title']}'" if menu_without_name data
|
82
|
+
conflicts << "Menu without father: '#{data['title']}'" if menu_without_father data
|
83
|
+
conflicts
|
84
|
+
end
|
85
|
+
|
86
|
+
def menu_without_name(data)
|
87
|
+
data['layout'] == 'grid' && data['menu-name'].nil?
|
88
|
+
end
|
89
|
+
|
90
|
+
def menu_without_father(data)
|
91
|
+
data['layout'] == 'grid' && data['menu-father'].nil? && data['permalink'].nil?
|
92
|
+
end
|
93
|
+
|
94
|
+
def analyze_conflicts(collection, name, father, conflicts = [])
|
56
95
|
array = name - father
|
57
96
|
conflicts << "There are some unused menus at #{collection} collection: #{array}" unless array.empty?
|
58
97
|
|
@@ -67,12 +106,9 @@ module Jekyll
|
|
67
106
|
def search_property(result, data, property)
|
68
107
|
value = data["menu-#{property}"]
|
69
108
|
index = search_hash(result, property)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
hash = { property => value.nil? ? [] : [value] }
|
74
|
-
result << hash
|
75
|
-
end
|
109
|
+
|
110
|
+
(result[index][property] << value unless value.nil?) if index
|
111
|
+
(result << { property => value.nil? ? [] : [value] }) unless index
|
76
112
|
end
|
77
113
|
|
78
114
|
def order_properties(result, properties)
|
data/lib/jekyll/tasks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edgar Tinajero
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -28,8 +28,11 @@ files:
|
|
28
28
|
- README.md
|
29
29
|
- Rakefile
|
30
30
|
- _collection1/collection1.md
|
31
|
-
- _collection1/subfolder/
|
32
|
-
- _collection1/subfolder/
|
31
|
+
- _collection1/subfolder-without-father/menu-without-father.md
|
32
|
+
- _collection1/subfolder-without-name/menu-without-name.md
|
33
|
+
- _collection1/subfolder1/product-lost.md
|
34
|
+
- _collection1/subfolder1/product-without-father.md
|
35
|
+
- _collection1/subfolder1/subfolder1.md
|
33
36
|
- _collection2/collection2.md
|
34
37
|
- _collection2/subfolder/subfolder2.md
|
35
38
|
- jekyll-tasks.gemspec
|