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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18c9298d13d35ccc67fff367c6e51a2aeb49cf0f7490057359b8b7efaeefabe0
4
- data.tar.gz: f7832fa85f0b2635c48ca7ed588022aa8e06749d902af63a09f315c8b7d40f18
3
+ metadata.gz: d643ccd489c87cd6b6aa97d374e835000921afd1d8d99f2782e98b81adcc2a4d
4
+ data.tar.gz: 7f9ca516e26433b725fd21b14792f03c8a8ed63014ce19abc695821737d1c48e
5
5
  SHA512:
6
- metadata.gz: 9f3812b8b6b18591480235b0d7aea334ba77d6f642b907c29cd93627c2e62d284a4e4673b460be19ddbbd5fa3e274d0995b4e6a2c13278869128c3b984de2ce4
7
- data.tar.gz: 14192f2d0d27ffadbab31a181f20a7b86d94a794d362bad5250e296d118137d687be2759927d4906dea0db8a242b9c714d1d8759f66a696a94942e81b7b42286
6
+ metadata.gz: 3f5ded1af6fbfaa64101b7ca25b7026105f7405ffff62bb371c67806ecc305b35f3ec7add71ad33c9fbc2ebfaf91874fb4d9115b08c5a4938c48af1c16f7c383
7
+ data.tar.gz: c57c6080ab8d5faa02c23eddc2b315e0984ffdfb8f8ca46c24fa3cc7a4403cfd526f63dfe6ea5e1504c7b443d8ea09fba337bcc8fe49e9cef5208dd655e2f7e4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-tasks (0.4.1)
4
+ jekyll-tasks (0.5.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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('./_data/api/hana/products/', '')
14
- .gsub('.yml', '')
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('./_data/api/hana/products/*.yml').to_a.sort
44
+ Dir.glob("#{PRODUCTS_PATH}*#{EXTENSION}").to_a.sort
37
45
  end
38
46
  end
39
47
  end
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Tasks
5
- VERSION = '0.4.1'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgar Tinajero