jekyll-tasks 0.4.1 → 0.6.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: e5b15dc2cc1c3ce8b29ddfc582cd55694686c4e72547815efc66ccaa7867d971
4
+ data.tar.gz: c7033a2b628b75e0a8ebac956ea8c80c197dcd476795afd1d19859be38850cd8
5
5
  SHA512:
6
- metadata.gz: 9f3812b8b6b18591480235b0d7aea334ba77d6f642b907c29cd93627c2e62d284a4e4673b460be19ddbbd5fa3e274d0995b4e6a2c13278869128c3b984de2ce4
7
- data.tar.gz: 14192f2d0d27ffadbab31a181f20a7b86d94a794d362bad5250e296d118137d687be2759927d4906dea0db8a242b9c714d1d8759f66a696a94942e81b7b42286
6
+ metadata.gz: 524fb042183042b686327dd7a8d819f5a68fa5b1b34c9a380ec579309e62957e535c154d96d98269aa13f499db997fa8e2619439b58c31779a38c2dac2822d3d
7
+ data.tar.gz: 3f57b4bfa2a63d03ebccd25e678e71359ff05130bb22aa74f96d2e8277a0f8d60a19ce4f8ecce4071f68c84d2a13a04e9da530044df5491953b7729745d7a07c
data/CODEOWNERS CHANGED
@@ -1,4 +1,4 @@
1
1
  * @cetinajero
2
2
 
3
3
  # Gemfile lockfile
4
- Gemfile.lock @cetinajero @mlopez-grupopv
4
+ Gemfile.lock @cetinajero
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ gemspec
5
5
 
6
6
  group :test do
7
7
  gem 'codecov', '~> 0.6', require: false
8
- gem 'minitest', '~> 5.15'
8
+ gem 'minitest', '~> 5.18'
9
9
  gem 'rake', '~> 13.0'
10
- gem 'rubocop', '~> 1.27'
10
+ gem 'rubocop', '~> 1.48'
11
11
  end
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.6.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -10,33 +10,35 @@ GEM
10
10
  codecov (0.6.0)
11
11
  simplecov (>= 0.15, < 0.22)
12
12
  docile (1.4.0)
13
- minitest (5.15.0)
13
+ json (2.6.3)
14
+ minitest (5.18.0)
14
15
  parallel (1.22.1)
15
- parser (3.1.1.0)
16
+ parser (3.2.2.0)
16
17
  ast (~> 2.4.1)
17
18
  rainbow (3.1.1)
18
19
  rake (13.0.6)
19
- regexp_parser (2.3.0)
20
+ regexp_parser (2.7.0)
20
21
  rexml (3.2.5)
21
- rubocop (1.27.0)
22
+ rubocop (1.48.1)
23
+ json (~> 2.3)
22
24
  parallel (~> 1.10)
23
- parser (>= 3.1.0.0)
25
+ parser (>= 3.2.0.0)
24
26
  rainbow (>= 2.2.2, < 4.0)
25
27
  regexp_parser (>= 1.8, < 3.0)
26
- rexml
27
- rubocop-ast (>= 1.16.0, < 2.0)
28
+ rexml (>= 3.2.5, < 4.0)
29
+ rubocop-ast (>= 1.26.0, < 2.0)
28
30
  ruby-progressbar (~> 1.7)
29
- unicode-display_width (>= 1.4.0, < 3.0)
30
- rubocop-ast (1.17.0)
31
- parser (>= 3.1.1.0)
32
- ruby-progressbar (1.11.0)
31
+ unicode-display_width (>= 2.4.0, < 3.0)
32
+ rubocop-ast (1.28.0)
33
+ parser (>= 3.2.1.0)
34
+ ruby-progressbar (1.13.0)
33
35
  simplecov (0.21.2)
34
36
  docile (~> 1.1)
35
37
  simplecov-html (~> 0.11)
36
38
  simplecov_json_formatter (~> 0.1)
37
39
  simplecov-html (0.12.3)
38
40
  simplecov_json_formatter (0.1.3)
39
- unicode-display_width (2.1.0)
41
+ unicode-display_width (2.4.2)
40
42
 
41
43
  PLATFORMS
42
44
  ruby
@@ -44,9 +46,9 @@ PLATFORMS
44
46
  DEPENDENCIES
45
47
  codecov (~> 0.6)
46
48
  jekyll-tasks!
47
- minitest (~> 5.15)
49
+ minitest (~> 5.18)
48
50
  rake (~> 13.0)
49
- rubocop (~> 1.27)
51
+ rubocop (~> 1.48)
50
52
 
51
53
  BUNDLED WITH
52
54
  2.1.4
@@ -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
@@ -23,21 +23,35 @@ module Jekyll
23
23
 
24
24
  def all_related_exist
25
25
  errors = []
26
- products = Products.filename_list
26
+ models = Products.model_list
27
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
31
- end
28
+ next unless models.include? key
29
+
30
+ errors += related_rules(key, related)
32
31
  end
33
32
  errors.empty? ? 'OK' : errors
34
33
  end
35
34
 
36
35
  private
37
36
 
37
+ def related_rules(key, related)
38
+ errors = []
39
+ products = Products.filename_list
40
+ errors << "'#{key}' has duplicate related products" if related.length != related.uniq.length
41
+ related.each do |product|
42
+ errors << "Related '#{product}' (declared @ '#{key}') doesn't exist" unless products.include? product
43
+ errors << "Inception detected @ '#{key}' related product" if inception_detected?(products, product, key)
44
+ end
45
+ errors
46
+ end
47
+
38
48
  def api_data
39
49
  YAML.load_file('./_data/api/yaml/related/products.yml')
40
50
  end
51
+
52
+ def inception_detected?(filename_list, filename, title)
53
+ filename_list.include?(filename) && Products.title(filename) == title
54
+ end
41
55
  end
42
56
  end
43
57
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Tasks
5
- VERSION = '0.4.1'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
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.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgar Tinajero
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-20 00:00:00.000000000 Z
11
+ date: 2023-04-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  requirements: []
69
- rubygems_version: 3.1.6
69
+ rubygems_version: 3.4.10
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: A set of rake tasks to help you on your Jekyll sites.