jekyll-theme-open-project-helpers 2.1.8 → 2.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5340ebd6b73a77f544854b7425860b5a2fa78ae1508182b0fa53f2aaa6002906
4
- data.tar.gz: 2f9025c1a872c6176924c2f936c9bc1fdb7f14c5ce272da54a96ded564528122
3
+ metadata.gz: 3b1d4e97d9aad4f03905d45ae68993220d23c8b52fa5bbf3be588c7ed9b11300
4
+ data.tar.gz: 496d9fdb62b4b2e7b44c59e2ab3b6b8142ec11ebd956b54b0423f487f78974ad
5
5
  SHA512:
6
- metadata.gz: 992ce56cd7eafea9d7167384a227eaff95d3dc20bd368e277f386238b13725db49662185aef4f0f415f28784fe392036bf01196af7d715fb3b1790f4ec66848e
7
- data.tar.gz: 9e6d476f0a89b3aee43f1c3e5d0becc5ca2b3ee3d297eb371143587ae19d7182248fd3c6c1c14fe69bfda241e1522a062fcd363dedab3273ee05a5fc323fbb1e
6
+ metadata.gz: 4f6ddb7b29aad86b3d71fcff8a424a17b8a62971def177ae1dc99aa1ae2c9b7bc70efa8ca50782f2164d3061724993662442632e860bdd8d80485fc2ec041555
7
+ data.tar.gz: bed4fcefeafea0edd8517733d30ea90b507f7694a10ca2a8cda234255de2c534fde126841c5a1742d5f31d8d3bc31c3347a4792a5cd0cf1539ff7340f1e70249
@@ -0,0 +1,31 @@
1
+ name: rake
2
+
3
+ on:
4
+ push:
5
+ branches: [ master, main ]
6
+ tags: [ v* ]
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ rake:
12
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
13
+ runs-on: ${{ matrix.os }}
14
+ continue-on-error: ${{ matrix.experimental }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
19
+ os: [ ubuntu-latest ]
20
+ experimental: [ false ]
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ with:
24
+ submodules: true
25
+
26
+ - uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.ruby }}
29
+ bundler-cache: true
30
+
31
+ - run: bundle exec rake
@@ -0,0 +1,44 @@
1
+ name: release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ next_version:
7
+ description: |
8
+ Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
9
+ required: true
10
+ default: 'skip'
11
+ push:
12
+ tags: [ v* ]
13
+
14
+ jobs:
15
+ release:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+
20
+ - uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: '2.6'
23
+ bundler-cache: true
24
+
25
+ - run: gem install gem-release
26
+
27
+ - run: |
28
+ git config user.name github-actions
29
+ git config user.email github-actions@github.com
30
+
31
+ - if: github.event_name == 'workflow_dispatch' && github.event.inputs.next_version != 'skip'
32
+ run: gem bump --version ${{ github.event.inputs.next_version }} --tag --push
33
+
34
+ - name: publish to rubygems.org
35
+ env:
36
+ RUBYGEMS_API_KEY: ${{secrets.RIBOSE_RUBYGEMS_API_KEY}}
37
+ run: |
38
+ gem install gem-release
39
+ envsubst << 'EOF' > ~/.gem/credentials
40
+ ---
41
+ :rubygems_api_key: ${RUBYGEMS_API_KEY}
42
+ EOF
43
+ chmod 0600 ~/.gem/credentials
44
+ gem release
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  /Gemfile.lock
2
2
  /.rubocop-https*
3
+ /.rspec_status
data/README.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Open Project theme helpers
2
2
 
3
+ [![Build Status](https://github.com/riboseinc/jekyll-theme-open-project-helpers/actions/workflows/rake.yml/badge.svg)](https://github.com/riboseinc/jekyll-theme-open-project-helpers/actions/workflows/rake.yml)
4
+ [![Gem Version](https://img.shields.io/gem/v/jekyll-theme-open-project-helpers.svg)](https://rubygems.org/gems/jekyll-theme-open-project-helpers
5
+ )
6
+ [![Pull Requests](https://img.shields.io/github/issues-pr-raw/riboseinc/jekyll-theme-open-project-helpers.svg)](https://github.com/riboseinc/jekyll-theme-open-project-helpers/pulls)
7
+ [![Commits since latest](https://img.shields.io/github/commits-since/riboseinc/jekyll-theme-open-project-helpers/latest.svg)](https://github.com/riboseinc/jekyll-theme-open-project-helpers/releases)
8
+
9
+
3
10
  Jekyll plugin for the Open Project gem-based Jekyll theme by Ribose.
4
11
 
5
12
  It provides the data reading and page generation capabilities
@@ -11,17 +18,7 @@ fetching open project/software/specification data from their repos.
11
18
 
12
19
  ## Releasing
13
20
 
14
- **Release this helpers gem and theme gem in tandem with matching versions.**
15
- See [Theme gem docs](https://github.com/riboseinc/jekyll-theme-open-project) for more.
16
-
17
-
18
- 1. Inside .gemspec within this repo’s root, update main gem version to the one being released.
19
-
20
- 2. Make a commit for the new release (“chore: Release vX.X.X”).
21
-
22
- 3. Execute `./develop/release`. This does the following:
21
+ ### New approach
23
22
 
24
- * Builds new gem version
25
- * Pushes gem to rubygems.org
26
- * Creates new version tag in this repository
27
- * Pushes changes to GitHub
23
+ Do `git tag ${version-tag}` or, start release manually with the
24
+ [`release.yml` workflow](https://github.com/riboseinc/jekyll-theme-open-project-helpers/actions/workflows/release.yml)
data/Rakefile CHANGED
@@ -9,4 +9,4 @@ require "rubocop/rake_task"
9
9
 
10
10
  RuboCop::RakeTask.new
11
11
 
12
- task default: %i[spec rubocop]
12
+ task default: %i[spec]
@@ -1,22 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = 'jekyll-theme-open-project-helpers'
5
- s.version = '2.1.8'
6
- s.authors = ['Ribose Inc.']
7
- s.email = ['open.source@ribose.com']
4
+ s.name = "jekyll-theme-open-project-helpers"
5
+ s.version = "2.1.9"
6
+ s.authors = ["Ribose Inc."]
7
+ s.email = ["open.source@ribose.com"]
8
8
 
9
- s.summary = 'Helpers for the Open Project Jekyll theme'
10
- s.homepage = 'https://github.com/riboseinc/jekyll-theme-open-project-helpers/'
11
- s.license = 'MIT'
9
+ s.summary = "Helpers for the Open Project Jekyll theme"
10
+ s.homepage = "https://github.com/riboseinc/jekyll-theme-open-project-helpers/"
11
+ s.license = "MIT"
12
12
 
13
- s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|spec|features)/!) }
13
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
14
+ f.match(%r!^(test|spec|features)/!)
15
+ end
14
16
 
15
- s.add_runtime_dependency 'jekyll', '~> 4.0'
16
- s.add_runtime_dependency 'git', '~> 1.4'
17
- s.add_runtime_dependency 'fastimage', '~> 2.1.4'
18
- s.add_development_dependency 'rake', '~> 12.0'
19
- s.add_development_dependency 'rubocop', '~> 0.50'
17
+ s.required_ruby_version = ">= 2.5.0"
18
+
19
+ s.add_runtime_dependency "fastimage", "~> 2.1.4"
20
+ s.add_runtime_dependency "git", "~> 1.4"
21
+ s.add_runtime_dependency "jekyll", "~> 4.0"
22
+
23
+ s.add_development_dependency "rake", "~> 13.0"
24
+ s.add_development_dependency "rspec", "~> 3.0"
25
+ s.add_development_dependency "rspec-command", "~> 1.0"
26
+ s.add_development_dependency "rubocop", "~> 1.5.2"
20
27
 
21
28
  s.require_paths = ["lib"]
22
29
  end
@@ -260,7 +260,7 @@ module Jekyll
260
260
  git_dir = File.join(repo_path, '.git')
261
261
  git_info_dir = File.join(git_dir, 'info')
262
262
  git_sparse_checkout_file = File.join(git_dir, 'info', 'sparse-checkout')
263
- unless File.exists? git_dir
263
+ unless File.exist? git_dir
264
264
  newly_initialized = true
265
265
 
266
266
  repo = Git.init(repo_path)
@@ -18,6 +18,12 @@ def get_nav_items_with_path(nav_items)
18
18
  items_with_path
19
19
  end
20
20
 
21
+ def find_nav_items(diagram_nav_items, png_name_noext)
22
+ diagram_nav_items.select do |item|
23
+ item["path"].start_with?(png_name_noext)
24
+ end
25
+ end
26
+
21
27
  module Builder
22
28
  class PngDiagramPage < Jekyll::Page
23
29
  EXTRA_STYLESHEETS = [{
@@ -47,45 +53,47 @@ module Builder
47
53
  end
48
54
  end
49
55
 
50
- def build_spec_pages(site, spec_info, source, destination, opts)
51
- images_path = source
52
- spec_root = destination
53
- pages = []
54
-
55
- diagram_nav_items = get_nav_items_with_path(
56
+ def build_spec_pages(site, spec_info, source, dest, _opts)
57
+ nav_items = get_nav_items_with_path(
56
58
  spec_info.data["navigation"]["items"],
57
59
  )
58
- not_found_items = diagram_nav_items.dup
59
60
 
60
- Dir.glob("#{images_path}/*.png") do |pngfile|
61
+ pages, not_found_items = process_spec_images(site, source, nav_items,
62
+ dest, spec_info)
63
+
64
+ not_found_items.each do |item|
65
+ warn "SPECIFIED PNG NOT FOUND: #{item['title']}.png not found " \
66
+ "at source as specified at (#{dest})."
67
+ end
68
+
69
+ pages
70
+ end
71
+
72
+ def process_spec_images(site, source, nav_items, dest, spec_info)
73
+ pages = []
74
+ not_found_items = nav_items.dup
75
+
76
+ Dir.glob("#{source}/*.png") do |pngfile|
61
77
  png_name = File.basename(pngfile)
62
78
  png_name_noext = File.basename(png_name, File.extname(png_name))
63
79
 
64
- nav_item = diagram_nav_items.select do |item|
65
- item["path"].start_with?(png_name_noext)
66
- end [0].clone
80
+ nav_item = find_nav_items(nav_items, png_name_noext)[0].clone
67
81
 
68
82
  if nav_item == nil
69
- warn "UNUSED PNG: #{png_name} detected at source without " \
70
- "a corresponding navigation item at (#{spec_root})."
83
+ warn "UNUSED PNG: #{File.basename(pngfile)} detected at source " \
84
+ "without a corresponding navigation item at (#{dest})."
71
85
  next
72
86
  end
73
87
 
74
88
  not_found_items.delete_if { |item| item["title"] == nav_item["title"] }
75
89
 
76
- data = build_spec_page_data(pngfile, spec_root, png_name, nav_item,
90
+ data = build_spec_page_data(pngfile, dest, png_name, nav_item,
77
91
  spec_info)
78
92
 
79
- pages << build_spec_page(site, spec_root, png_name_noext, data)
80
- end
81
-
82
- not_found_items.each do |item|
83
- title = item["title"]
84
- warn "SPECIFIED PNG NOT FOUND: #{title}.png not found at source " \
85
- "as specified at (#{spec_root})."
93
+ pages << build_spec_page(site, dest, png_name_noext, data)
86
94
  end
87
95
 
88
- pages
96
+ [pages, not_found_items]
89
97
  end
90
98
 
91
99
  def build_spec_page(site, spec_root, png_name_noext, data)
@@ -103,17 +111,21 @@ module Builder
103
111
  end
104
112
 
105
113
  def build_spec_page_data(pngfile, spec_root, png_name, nav_item, spec_info)
114
+ data = fill_image_data(pngfile, spec_info, spec_root, png_name)
115
+ .merge(nav_item)
116
+
117
+ data["title"] = "#{spec_info['title']}: #{nav_item['title']}"
118
+ data["article_header_title"] = nav_item["title"].to_s
119
+
120
+ data
121
+ end
122
+
123
+ def fill_image_data(pngfile, spec_info, spec_root, png_name)
106
124
  png_dimensions = FastImage.size(pngfile)
107
125
  data = spec_info.data.clone
108
126
  data["image_path"] = "/#{spec_root}/images/#{png_name}"
109
127
  data["image_width"] = png_dimensions[0]
110
128
  data["image_height"] = png_dimensions[1]
111
-
112
- data = data.merge(nav_item)
113
-
114
- data["title"] = "#{spec_info['title']}: #{nav_item['title']}"
115
- data["article_header_title"] = nav_item["title"].to_s
116
-
117
129
  data
118
130
  end
119
131
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-open-project-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.8
4
+ version: 2.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-10 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: jekyll
14
+ name: fastimage
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: 2.1.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: git
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,61 +39,90 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.4'
41
41
  - !ruby/object:Gem::Dependency
42
- name: fastimage
42
+ name: jekyll
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.1.4
47
+ version: '4.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.1.4
54
+ version: '4.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '12.0'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '12.0'
68
+ version: '13.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec-command
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rubocop
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: '0.50'
103
+ version: 1.5.2
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: '0.50'
83
- description:
110
+ version: 1.5.2
111
+ description:
84
112
  email:
85
113
  - open.source@ribose.com
86
114
  executables: []
87
115
  extensions: []
88
116
  extra_rdoc_files: []
89
117
  files:
118
+ - ".github/workflows/rake.yml"
119
+ - ".github/workflows/release.yml"
90
120
  - ".gitignore"
91
121
  - ".rubocop.yml"
92
122
  - Gemfile
93
123
  - LICENSE.txt
94
124
  - README.md
95
125
  - Rakefile
96
- - develop/release
97
126
  - jekyll-theme-open-project-helpers.gemspec
98
127
  - lib/jekyll-theme-open-project-helpers.rb
99
128
  - lib/jekyll-theme-open-project-helpers/blog_index.rb
@@ -108,7 +137,7 @@ homepage: https://github.com/riboseinc/jekyll-theme-open-project-helpers/
108
137
  licenses:
109
138
  - MIT
110
139
  metadata: {}
111
- post_install_message:
140
+ post_install_message:
112
141
  rdoc_options: []
113
142
  require_paths:
114
143
  - lib
@@ -116,15 +145,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
145
  requirements:
117
146
  - - ">="
118
147
  - !ruby/object:Gem::Version
119
- version: '0'
148
+ version: 2.5.0
120
149
  required_rubygems_version: !ruby/object:Gem::Requirement
121
150
  requirements:
122
151
  - - ">="
123
152
  - !ruby/object:Gem::Version
124
153
  version: '0'
125
154
  requirements: []
126
- rubygems_version: 3.0.3
127
- signing_key:
155
+ rubygems_version: 3.0.3.1
156
+ signing_key:
128
157
  specification_version: 4
129
158
  summary: Helpers for the Open Project Jekyll theme
130
159
  test_files: []
data/develop/release DELETED
@@ -1,41 +0,0 @@
1
- #!/bin/sh
2
- # Tag and push a release.
3
-
4
- set -e
5
-
6
- # Make sure we're in the project root.
7
-
8
- cd $(dirname "$0")/..
9
-
10
- # Make sure the darn thing works? Meh.
11
- # bundle update
12
-
13
- # Build a new gem archive.
14
-
15
- rm -rf jekyll-theme-open-project-helpers-*.gem
16
- gem build -q jekyll-theme-open-project-helpers.gemspec
17
-
18
- # Make sure we're on the master branch.
19
-
20
- (git branch | grep -q 'master') || {
21
- echo "Only release from the master branch."
22
- exit 1
23
- }
24
-
25
- # Figure out what version we're releasing.
26
-
27
- tag=v`ls jekyll-theme-open-project-helpers-*.gem | sed 's/^jekyll-theme-open-project-helpers-\(.*\)\.gem$/\1/'`
28
-
29
- # Make sure we haven't released this version before.
30
-
31
- git fetch -t origin
32
-
33
- (git tag -l | grep -q "$tag") && {
34
- echo "Whoops, there's already a '${tag}' tag."
35
- exit 1
36
- }
37
-
38
- # Tag it and bag it.
39
-
40
- gem push jekyll-theme-open-project-helpers-*.gem && git tag "$tag" &&
41
- git push origin master && git push origin "$tag"