jekyll-tasks 0.3.0 → 0.4.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 +3 -3
- data/Gemfile.lock +20 -18
- 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/jekyll-tasks.gemspec +1 -0
- data/lib/jekyll/tasks/menus.rb +51 -15
- data/lib/jekyll/tasks/products.rb +4 -0
- data/lib/jekyll/tasks/related.rb +15 -3
- data/lib/jekyll/tasks/version.rb +1 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18c9298d13d35ccc67fff367c6e51a2aeb49cf0f7490057359b8b7efaeefabe0
|
4
|
+
data.tar.gz: f7832fa85f0b2635c48ca7ed588022aa8e06749d902af63a09f315c8b7d40f18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f3812b8b6b18591480235b0d7aea334ba77d6f642b907c29cd93627c2e62d284a4e4673b460be19ddbbd5fa3e274d0995b4e6a2c13278869128c3b984de2ce4
|
7
|
+
data.tar.gz: 14192f2d0d27ffadbab31a181f20a7b86d94a794d362bad5250e296d118137d687be2759927d4906dea0db8a242b9c714d1d8759f66a696a94942e81b7b42286
|
data/Gemfile
CHANGED
@@ -4,8 +4,8 @@ source 'https://rubygems.org'
|
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
group :test do
|
7
|
-
gem 'codecov', '~> 0.
|
8
|
-
gem 'minitest', '~> 5.
|
7
|
+
gem 'codecov', '~> 0.6', require: false
|
8
|
+
gem 'minitest', '~> 5.15'
|
9
9
|
gem 'rake', '~> 13.0'
|
10
|
-
gem 'rubocop', '~> 1.
|
10
|
+
gem 'rubocop', '~> 1.27'
|
11
11
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,50 +1,52 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jekyll-tasks (0.
|
4
|
+
jekyll-tasks (0.4.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
|
-
codecov (0.
|
10
|
+
codecov (0.6.0)
|
11
11
|
simplecov (>= 0.15, < 0.22)
|
12
|
-
docile (1.
|
13
|
-
minitest (5.
|
14
|
-
parallel (1.
|
15
|
-
parser (3.
|
12
|
+
docile (1.4.0)
|
13
|
+
minitest (5.15.0)
|
14
|
+
parallel (1.22.1)
|
15
|
+
parser (3.1.1.0)
|
16
16
|
ast (~> 2.4.1)
|
17
|
-
rainbow (3.
|
17
|
+
rainbow (3.1.1)
|
18
18
|
rake (13.0.6)
|
19
|
-
regexp_parser (2.
|
19
|
+
regexp_parser (2.3.0)
|
20
20
|
rexml (3.2.5)
|
21
|
-
rubocop (1.
|
21
|
+
rubocop (1.27.0)
|
22
22
|
parallel (~> 1.10)
|
23
|
-
parser (>= 3.
|
23
|
+
parser (>= 3.1.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.16.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.17.0)
|
31
|
+
parser (>= 3.1.1.0)
|
32
32
|
ruby-progressbar (1.11.0)
|
33
|
-
simplecov (0.
|
33
|
+
simplecov (0.21.2)
|
34
34
|
docile (~> 1.1)
|
35
35
|
simplecov-html (~> 0.11)
|
36
|
+
simplecov_json_formatter (~> 0.1)
|
36
37
|
simplecov-html (0.12.3)
|
37
|
-
|
38
|
+
simplecov_json_formatter (0.1.3)
|
39
|
+
unicode-display_width (2.1.0)
|
38
40
|
|
39
41
|
PLATFORMS
|
40
42
|
ruby
|
41
43
|
|
42
44
|
DEPENDENCIES
|
43
|
-
codecov (~> 0.
|
45
|
+
codecov (~> 0.6)
|
44
46
|
jekyll-tasks!
|
45
|
-
minitest (~> 5.
|
47
|
+
minitest (~> 5.15)
|
46
48
|
rake (~> 13.0)
|
47
|
-
rubocop (~> 1.
|
49
|
+
rubocop (~> 1.27)
|
48
50
|
|
49
51
|
BUNDLED WITH
|
50
52
|
2.1.4
|
data/_collection1/collection1.md
CHANGED
File without changes
|
File without changes
|
data/_collection2/collection2.md
CHANGED
data/jekyll-tasks.gemspec
CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.metadata['homepage_uri'] = spec.homepage
|
17
17
|
spec.metadata['source_code_uri'] = 'https://github.com/grupopv/jekyll-tasks/'
|
18
18
|
spec.metadata['changelog_uri'] = 'https://github.com/grupopv/jekyll-tasks/blob/master/CHANGELOG.md'
|
19
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
19
20
|
|
20
21
|
spec.bindir = 'exe'
|
21
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
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/related.rb
CHANGED
@@ -8,14 +8,26 @@ module Jekyll
|
|
8
8
|
|
9
9
|
MINIMUM_RELATED_PRODUCTS = 5
|
10
10
|
|
11
|
-
def all_products_with_related
|
11
|
+
def all_products_with_related(api = api_data)
|
12
12
|
errors = []
|
13
|
-
api = api_data
|
14
13
|
Products.model_list.each do |product|
|
15
14
|
if api[product]
|
16
15
|
count = api[product].count
|
17
16
|
errors << "Only has #{count} related products: #{product}" if count < MINIMUM_RELATED_PRODUCTS
|
18
|
-
else
|
17
|
+
else
|
18
|
+
errors << "Doesn't have related products: #{product}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
errors.empty? ? 'OK' : errors
|
22
|
+
end
|
23
|
+
|
24
|
+
def all_related_exist
|
25
|
+
errors = []
|
26
|
+
products = Products.filename_list
|
27
|
+
api_data.each do |key, related|
|
28
|
+
errors << "'#{key}' has duplicate related products" if related.length != related.uniq.length
|
29
|
+
related.each do |product|
|
30
|
+
errors << "Related '#{product}' (declared @ '#{key}') doesn't exist" unless products.include? product
|
19
31
|
end
|
20
32
|
end
|
21
33
|
errors.empty? ? 'OK' : errors
|
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.
|
4
|
+
version: 0.4.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:
|
11
|
+
date: 2022-04-20 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
|
@@ -47,6 +50,7 @@ metadata:
|
|
47
50
|
homepage_uri: https://github.com/grupopv/jekyll-tasks/
|
48
51
|
source_code_uri: https://github.com/grupopv/jekyll-tasks/
|
49
52
|
changelog_uri: https://github.com/grupopv/jekyll-tasks/blob/master/CHANGELOG.md
|
53
|
+
rubygems_mfa_required: 'true'
|
50
54
|
post_install_message:
|
51
55
|
rdoc_options: []
|
52
56
|
require_paths:
|