jekyll-tasks 0.3.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: 0daec4cd29ddca6e7c68b64b0ade2f1ff018e52f2e374f5d5c6660fe7b36acb9
4
- data.tar.gz: ccad93b3f4c10d3473701d88e335e6832c758b1cbd022f7a6156926b03a0e235
3
+ metadata.gz: d643ccd489c87cd6b6aa97d374e835000921afd1d8d99f2782e98b81adcc2a4d
4
+ data.tar.gz: 7f9ca516e26433b725fd21b14792f03c8a8ed63014ce19abc695821737d1c48e
5
5
  SHA512:
6
- metadata.gz: d7716006decd4fdd3ba6e871928fc88a9f3e488fcefb158e6209dd4bc22d469c46ff0328c448997ce92bd7e5794ecf38039045388ad0e7e9cfbacb0b318fa34f
7
- data.tar.gz: 505a6f93bea6ae83acdd534790f495be7a27f88d2d9775ed84048400c74919bc26f6c9376a9e7eb92b964d2c1a903d494d2b107afd0a774c63029d3476303a2c
6
+ metadata.gz: 3f5ded1af6fbfaa64101b7ca25b7026105f7405ffff62bb371c67806ecc305b35f3ec7add71ad33c9fbc2ebfaf91874fb4d9115b08c5a4938c48af1c16f7c383
7
+ data.tar.gz: c57c6080ab8d5faa02c23eddc2b315e0984ffdfb8f8ca46c24fa3cc7a4403cfd526f63dfe6ea5e1504c7b443d8ea09fba337bcc8fe49e9cef5208dd655e2f7e4
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.5', require: false
8
- gem 'minitest', '~> 5.14'
7
+ gem 'codecov', '~> 0.6', require: false
8
+ gem 'minitest', '~> 5.15'
9
9
  gem 'rake', '~> 13.0'
10
- gem 'rubocop', '~> 1.18'
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.3.1)
4
+ jekyll-tasks (0.5.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
- codecov (0.5.2)
10
+ codecov (0.6.0)
11
11
  simplecov (>= 0.15, < 0.22)
12
- docile (1.3.5)
13
- minitest (5.14.4)
14
- parallel (1.20.1)
15
- parser (3.0.2.0)
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.0.0)
17
+ rainbow (3.1.1)
18
18
  rake (13.0.6)
19
- regexp_parser (2.1.1)
19
+ regexp_parser (2.3.0)
20
20
  rexml (3.2.5)
21
- rubocop (1.18.3)
21
+ rubocop (1.27.0)
22
22
  parallel (~> 1.10)
23
- parser (>= 3.0.0.0)
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.7.0, < 2.0)
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.8.0)
31
- parser (>= 3.0.1.1)
30
+ rubocop-ast (1.17.0)
31
+ parser (>= 3.1.1.0)
32
32
  ruby-progressbar (1.11.0)
33
- simplecov (0.18.5)
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
- unicode-display_width (2.0.0)
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.5)
45
+ codecov (~> 0.6)
44
46
  jekyll-tasks!
45
- minitest (~> 5.14)
47
+ minitest (~> 5.15)
46
48
  rake (~> 13.0)
47
- rubocop (~> 1.18)
49
+ rubocop (~> 1.27)
48
50
 
49
51
  BUNDLED WITH
50
52
  2.1.4
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) }
@@ -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
@@ -8,14 +8,27 @@ 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 errors << "Doesn't have related products: #{product}"
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
31
+ errors << "Inception detected @ '#{key}' related product" if inception_detected?(products, product, key)
19
32
  end
20
33
  end
21
34
  errors.empty? ? 'OK' : errors
@@ -26,6 +39,10 @@ module Jekyll
26
39
  def api_data
27
40
  YAML.load_file('./_data/api/yaml/related/products.yml')
28
41
  end
42
+
43
+ def inception_detected?(filename_list, filename, title)
44
+ filename_list.include?(filename) && Products.title(filename) == title
45
+ end
29
46
  end
30
47
  end
31
48
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Tasks
5
- VERSION = '0.3.1'
5
+ VERSION = '0.5.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.3.1
4
+ version: 0.5.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: 2021-07-22 00:00:00.000000000 Z
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -50,6 +50,7 @@ metadata:
50
50
  homepage_uri: https://github.com/grupopv/jekyll-tasks/
51
51
  source_code_uri: https://github.com/grupopv/jekyll-tasks/
52
52
  changelog_uri: https://github.com/grupopv/jekyll-tasks/blob/master/CHANGELOG.md
53
+ rubygems_mfa_required: 'true'
53
54
  post_install_message:
54
55
  rdoc_options: []
55
56
  require_paths: