jekyll-tasks 0.4.1 → 0.5.0
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.lock +1 -1
- data/lib/jekyll/tasks/products.rb +11 -3
- data/lib/jekyll/tasks/related.rb +5 -0
- data/lib/jekyll/tasks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d643ccd489c87cd6b6aa97d374e835000921afd1d8d99f2782e98b81adcc2a4d
|
4
|
+
data.tar.gz: 7f9ca516e26433b725fd21b14792f03c8a8ed63014ce19abc695821737d1c48e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f5ded1af6fbfaa64101b7ca25b7026105f7405ffff62bb371c67806ecc305b35f3ec7add71ad33c9fbc2ebfaf91874fb4d9115b08c5a4938c48af1c16f7c383
|
7
|
+
data.tar.gz: c57c6080ab8d5faa02c23eddc2b315e0984ffdfb8f8ca46c24fa3cc7a4403cfd526f63dfe6ea5e1504c7b443d8ea09fba337bcc8fe49e9cef5208dd655e2f7e4
|
data/Gemfile.lock
CHANGED
@@ -6,12 +6,15 @@ module Jekyll
|
|
6
6
|
module Products
|
7
7
|
extend self
|
8
8
|
|
9
|
+
PRODUCTS_PATH = './_data/api/hana/products/'
|
10
|
+
EXTENSION = '.yml'
|
11
|
+
|
9
12
|
def filename_list
|
10
13
|
products = []
|
11
14
|
path_list.each do |product|
|
12
15
|
product = product
|
13
|
-
.gsub(
|
14
|
-
.gsub(
|
16
|
+
.gsub(PRODUCTS_PATH, '')
|
17
|
+
.gsub(EXTENSION, '')
|
15
18
|
products << product
|
16
19
|
end
|
17
20
|
products
|
@@ -30,10 +33,15 @@ module Jekyll
|
|
30
33
|
data['layout'].nil? && data['menu-father'].nil?
|
31
34
|
end
|
32
35
|
|
36
|
+
def title(product)
|
37
|
+
data = YAML.load_file("#{PRODUCTS_PATH}#{product}#{EXTENSION}")
|
38
|
+
data['title']
|
39
|
+
end
|
40
|
+
|
33
41
|
private
|
34
42
|
|
35
43
|
def path_list
|
36
|
-
Dir.glob(
|
44
|
+
Dir.glob("#{PRODUCTS_PATH}*#{EXTENSION}").to_a.sort
|
37
45
|
end
|
38
46
|
end
|
39
47
|
end
|
data/lib/jekyll/tasks/related.rb
CHANGED
@@ -28,6 +28,7 @@ module Jekyll
|
|
28
28
|
errors << "'#{key}' has duplicate related products" if related.length != related.uniq.length
|
29
29
|
related.each do |product|
|
30
30
|
errors << "Related '#{product}' (declared @ '#{key}') doesn't exist" unless products.include? product
|
31
|
+
errors << "Inception detected @ '#{key}' related product" if inception_detected?(products, product, key)
|
31
32
|
end
|
32
33
|
end
|
33
34
|
errors.empty? ? 'OK' : errors
|
@@ -38,6 +39,10 @@ module Jekyll
|
|
38
39
|
def api_data
|
39
40
|
YAML.load_file('./_data/api/yaml/related/products.yml')
|
40
41
|
end
|
42
|
+
|
43
|
+
def inception_detected?(filename_list, filename, title)
|
44
|
+
filename_list.include?(filename) && Products.title(filename) == title
|
45
|
+
end
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
data/lib/jekyll/tasks/version.rb
CHANGED