jekyll-tasks 0.1.0 → 0.2.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: 6fbbec826de69c35da63a9482cba43e16b3468784d93e565f33e84aaa96646fd
4
- data.tar.gz: e7b7478d03f91f2568a146c6cea0251f40dcf77c24a0cec44929d5d57f7df1ad
3
+ metadata.gz: cb2bd9522e96a7b8fafa4905183266847f438dba39e3377f8ed424f101c29dff
4
+ data.tar.gz: 26756a715081ca1b56c6ad360f88719830a6d1fe40e714341526152159db852b
5
5
  SHA512:
6
- metadata.gz: c3deabd17c94da6a44993462699f59a15487eb9badc9832ee1468fca323c84a7af82fd21b03f0dbc9e8a5dd60eea15ec16401813ff53a411dfd2be43a50ed5d0
7
- data.tar.gz: 888323cd27fcf050c099443a9bd4e28541746cce95999871346668abdf60c13dd81ca5870519eff6f96af23661563df1a0ff1d4e083a9ba8e58750a4d0026a58
6
+ metadata.gz: 95c5de860f3ae0a6fe2aec83eef0283208579ec4344999329fc95765479ef60617ea3390b1d2620df82706aba582e5640f18c6131717293557d16ac1f4fb822c
7
+ data.tar.gz: 0af10c8ca07e5d81697b14f58e6f16512fbe59e7a4b1b88b4a919bb84b2c26e47c7cef05ed2b4b29b0e90252d05875ea6c01681375476088a22008a39a34b046
@@ -0,0 +1,15 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: weekly
8
+ day: thursday
9
+ time: "09:00"
10
+ timezone: "America/Chihuahua"
11
+ open-pull-requests-limit: 10
12
+ reviewers: ["mlopez-grupopv"]
13
+ labels:
14
+ - dependencies
15
+ - ruby
data/.travis.yml CHANGED
@@ -2,7 +2,7 @@ os: linux
2
2
  language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
- - 2.5.7
5
+ - 2.7.3
6
6
 
7
7
  before_install:
8
8
  - gem install bundler
data/CODEOWNERS ADDED
@@ -0,0 +1,4 @@
1
+ * @cetinajero
2
+
3
+ # Gemfile lockfile
4
+ Gemfile.lock @cetinajero @mlopez-grupopv
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.1', require: false
7
+ gem 'codecov', '~> 0.5', require: false
8
8
  gem 'minitest', '~> 5.14'
9
9
  gem 'rake', '~> 13.0'
10
- gem 'rubocop', '~> 0.79'
10
+ gem 'rubocop', '~> 1.12'
11
11
  end
data/Gemfile.lock CHANGED
@@ -1,49 +1,50 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-tasks (0.1.0)
4
+ jekyll-tasks (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.0)
10
- codecov (0.1.16)
11
- json
12
- simplecov
13
- url
14
- docile (1.3.2)
15
- jaro_winkler (1.5.4)
16
- json (2.3.0)
17
- minitest (5.14.0)
18
- parallel (1.19.1)
19
- parser (2.7.0.2)
20
- ast (~> 2.4.0)
9
+ ast (2.4.2)
10
+ codecov (0.5.2)
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.1.0)
16
+ ast (~> 2.4.1)
21
17
  rainbow (3.0.0)
22
- rake (13.0.1)
23
- rubocop (0.79.0)
24
- jaro_winkler (~> 1.5.1)
18
+ rake (13.0.3)
19
+ regexp_parser (2.1.1)
20
+ rexml (3.2.5)
21
+ rubocop (1.12.1)
25
22
  parallel (~> 1.10)
26
- parser (>= 2.7.0.1)
23
+ parser (>= 3.0.0.0)
27
24
  rainbow (>= 2.2.2, < 4.0)
25
+ regexp_parser (>= 1.8, < 3.0)
26
+ rexml
27
+ rubocop-ast (>= 1.2.0, < 2.0)
28
28
  ruby-progressbar (~> 1.7)
29
- unicode-display_width (>= 1.4.0, < 1.7)
30
- ruby-progressbar (1.10.1)
31
- simplecov (0.18.2)
29
+ unicode-display_width (>= 1.4.0, < 3.0)
30
+ rubocop-ast (1.4.1)
31
+ parser (>= 2.7.1.5)
32
+ ruby-progressbar (1.11.0)
33
+ simplecov (0.18.5)
32
34
  docile (~> 1.1)
33
35
  simplecov-html (~> 0.11)
34
- simplecov-html (0.12.0)
35
- unicode-display_width (1.6.1)
36
- url (0.3.2)
36
+ simplecov-html (0.12.3)
37
+ unicode-display_width (2.0.0)
37
38
 
38
39
  PLATFORMS
39
40
  ruby
40
41
 
41
42
  DEPENDENCIES
42
- codecov (~> 0.1)
43
+ codecov (~> 0.5)
43
44
  jekyll-tasks!
44
45
  minitest (~> 5.14)
45
46
  rake (~> 13.0)
46
- rubocop (~> 0.79)
47
+ rubocop (~> 1.12)
47
48
 
48
49
  BUNDLED WITH
49
- 2.1.2
50
+ 2.1.4
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Edgar Tinajero
3
+ Copyright (c) 2021 Edgar Tinajero
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1 @@
1
+ title: PRODUCT/1
@@ -0,0 +1 @@
1
+ title: PRODUCT/2
@@ -0,0 +1 @@
1
+ title: PRODUCT/3
@@ -0,0 +1,2 @@
1
+ PRODUCT/1: ["product-2", "product-3", "product-4", "product-5", "product-6"]
2
+ PRODUCT/2: ["product-1", "product-3", "product-4", "product-5"]
data/jekyll-tasks.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'A set of rake tasks to help you on your Jekyll sites.'
12
12
  spec.homepage = 'https://github.com/grupopv/jekyll-tasks/'
13
13
  spec.license = 'MIT'
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
14
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = 'https://github.com/grupopv/jekyll-tasks/'
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  all_files = `git ls-files -z`.split("\x0")
25
25
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
26
  all_files.reject do |f|
27
- excluded_files = %r{^(test|spec|features)/}
27
+ excluded_files = %r{^(bin|dependabot|test|spec|features|.gitignore|.travis.yml)/}
28
28
  f.match(excluded_files)
29
29
  end
30
30
  end
data/lib/jekyll/tasks.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'jekyll/tasks/dates'
4
+ require 'jekyll/tasks/products'
5
+ require 'jekyll/tasks/related'
4
6
  require 'jekyll/tasks/version'
5
7
 
6
8
  module Jekyll
@@ -4,7 +4,7 @@ require 'date'
4
4
 
5
5
  module Jekyll
6
6
  module Tasks
7
- # Customers module to configure jekyll's bundle per website
7
+ # Dates module to configure jekyll's bundle per website
8
8
  module Dates
9
9
  extend self
10
10
 
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Tasks
5
+ # Obtain products information
6
+ module Products
7
+ extend self
8
+
9
+ def products_filename_list
10
+ products = []
11
+ products_path_list.each do |product|
12
+ product = product
13
+ .gsub('./_data/api/hana/products/', '')
14
+ .gsub('.yml', '')
15
+ products << product
16
+ end
17
+ products
18
+ end
19
+
20
+ def products_model_list
21
+ products = []
22
+ products_path_list.each do |product|
23
+ data = YAML.load_file(product)
24
+ products << data['title']
25
+ end
26
+ products
27
+ end
28
+
29
+ private
30
+
31
+ def products_path_list
32
+ Dir.glob('./_data/api/hana/products/*.yml').to_a.sort
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Tasks
5
+ # Verify related API
6
+ module Related
7
+ extend self
8
+
9
+ MINIMUM_RELATED_PRODUCTS = 5
10
+
11
+ def all_products_with_related
12
+ errors = []
13
+ api = related_api_data
14
+ Products.products_model_list.each do |product|
15
+ if api[product]
16
+ count = api[product].count
17
+ errors << "Only has #{count} related products: #{product}" if count < MINIMUM_RELATED_PRODUCTS
18
+ else errors << "Doesn't have related products: #{product}"
19
+ end
20
+ end
21
+ errors.empty? ? 'OK' : errors
22
+ end
23
+
24
+ private
25
+
26
+ def related_api_data
27
+ YAML.load_file('./_data/api/yaml/related/products.yml')
28
+ end
29
+ end
30
+ end
31
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Tasks
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,36 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgar Tinajero
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-13 00:00:00.000000000 Z
11
+ date: 2021-05-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description:
14
14
  email:
15
15
  - 24572406+cetinajero@users.noreply.github.com
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - ".dependabot/config.yml"
20
+ - ".github/dependabot.yml"
21
21
  - ".gitignore"
22
22
  - ".travis.yml"
23
+ - CODEOWNERS
23
24
  - CODE_OF_CONDUCT.md
24
25
  - Gemfile
25
26
  - Gemfile.lock
26
27
  - LICENSE.txt
27
28
  - README.md
28
29
  - Rakefile
29
- - bin/console
30
- - bin/setup
30
+ - _data/api/hana/products/product-1.yml
31
+ - _data/api/hana/products/product-2.yml
32
+ - _data/api/hana/products/product-3.yml
33
+ - _data/api/yaml/related/products.yml
31
34
  - jekyll-tasks.gemspec
32
35
  - lib/jekyll/tasks.rb
33
36
  - lib/jekyll/tasks/dates.rb
37
+ - lib/jekyll/tasks/products.rb
38
+ - lib/jekyll/tasks/related.rb
34
39
  - lib/jekyll/tasks/version.rb
35
40
  homepage: https://github.com/grupopv/jekyll-tasks/
36
41
  licenses:
@@ -39,7 +44,7 @@ metadata:
39
44
  homepage_uri: https://github.com/grupopv/jekyll-tasks/
40
45
  source_code_uri: https://github.com/grupopv/jekyll-tasks/
41
46
  changelog_uri: https://github.com/grupopv/jekyll-tasks/blob/master/CHANGELOG.md
42
- post_install_message:
47
+ post_install_message:
43
48
  rdoc_options: []
44
49
  require_paths:
45
50
  - lib
@@ -47,15 +52,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
47
52
  requirements:
48
53
  - - ">="
49
54
  - !ruby/object:Gem::Version
50
- version: 2.3.0
55
+ version: 2.4.0
51
56
  required_rubygems_version: !ruby/object:Gem::Requirement
52
57
  requirements:
53
58
  - - ">="
54
59
  - !ruby/object:Gem::Version
55
60
  version: '0'
56
61
  requirements: []
57
- rubygems_version: 3.0.6
58
- signing_key:
62
+ rubygems_version: 3.1.6
63
+ signing_key:
59
64
  specification_version: 4
60
65
  summary: A set of rake tasks to help you on your Jekyll sites.
61
66
  test_files: []
@@ -1,8 +0,0 @@
1
- version: 1
2
-
3
- update_configs:
4
- - package_manager: "ruby:bundler"
5
- directory: "/"
6
- update_schedule: "daily"
7
- default_reviewers:
8
- - "cetinajero"
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'jekyll/tasks'
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require 'irb'
15
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here