jekyll-theme-open-project-helpers 2.0.21 → 2.1.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b66bfdb58fa9bd277603af3c29b2736c8af021a144eaa150c59285fa41804ad
|
4
|
+
data.tar.gz: f6c21cb54b396ef4ee17869e5539ca961c9485f669d1370e4071bc5e05034369
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 521ab65d046b3605ad8efbdb113f9a387986331c23421db0f14afe8429a9a28d4e4bce191275936b59471396541811f1aa7f0b1bd1d964ae08cee7fc227d635a
|
7
|
+
data.tar.gz: fbcbc3022c5930db262ea81afd94ac54544b4c32c817ad2e40f28b893cecc143bb473e66dedeec81a89c9a1585e2ba7cb1f61609a578a5528a1c8bcf11acc5a1
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -12,7 +12,7 @@ fetching open project/software/specification data from their repos.
|
|
12
12
|
## Releasing
|
13
13
|
|
14
14
|
**Release this helpers gem and theme gem in tandem with matching versions.**
|
15
|
-
See [https://github.com/riboseinc/jekyll-theme-open-project
|
15
|
+
See [Theme gem docs](https://github.com/riboseinc/jekyll-theme-open-project) for more.
|
16
16
|
|
17
17
|
|
18
18
|
1. Inside .gemspec within this repo’s root, update main gem version to the one being released.
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'jekyll-theme-open-project-helpers'
|
5
|
-
s.version = '2.
|
5
|
+
s.version = '2.1.4'
|
6
6
|
s.authors = ['Ribose Inc.']
|
7
7
|
s.email = ['open.source@ribose.com']
|
8
8
|
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|spec|features)/!) }
|
14
14
|
|
15
|
-
s.add_runtime_dependency 'jekyll', '~>
|
15
|
+
s.add_runtime_dependency 'jekyll', '~> 4.0'
|
16
16
|
s.add_runtime_dependency 'git', '~> 1.4'
|
17
17
|
s.add_runtime_dependency 'fastimage', '~> 2.1.4'
|
18
18
|
s.add_development_dependency 'rake', '~> 12.0'
|
@@ -55,7 +55,7 @@ module Jekyll
|
|
55
55
|
# Creates a data structure like { tag1: [item1, item2], tag2: [item2, item3] }
|
56
56
|
tags = {}
|
57
57
|
items.each do |item|
|
58
|
-
item.data['tags'].each do |tag|
|
58
|
+
(item.data['tags'] or []).each do |tag|
|
59
59
|
unless tags.key? tag
|
60
60
|
tags[tag] = []
|
61
61
|
end
|
@@ -131,7 +131,13 @@ end
|
|
131
131
|
def get_all_items(site, collection_name, filter_func)
|
132
132
|
# Fetches items of specified type, ordered and prepared for usage in index templates
|
133
133
|
|
134
|
-
|
134
|
+
collection = site.collections[collection_name]
|
135
|
+
|
136
|
+
if collection == nil
|
137
|
+
raise "Collection does not exist: #{collection_name}"
|
138
|
+
end
|
139
|
+
|
140
|
+
items = collection.docs.select { |item|
|
135
141
|
filter_func.call(item)
|
136
142
|
}
|
137
143
|
|
@@ -30,6 +30,8 @@ module Jekyll
|
|
30
30
|
entries.each do |entry|
|
31
31
|
path = File.join(dir, entry)
|
32
32
|
|
33
|
+
Jekyll.logger.debug("OPF:", "Reading entry #{path}")
|
34
|
+
|
33
35
|
if File.directory?(path)
|
34
36
|
read_project_subdir(path, collection, nested=true)
|
35
37
|
|
@@ -41,10 +43,14 @@ module Jekyll
|
|
41
43
|
|
42
44
|
# Add document to Jekyll document database if it refers to software or spec
|
43
45
|
# (as opposed to be some nested document like README)
|
44
|
-
if doc.url.split('/').size == 4
|
46
|
+
if (doc.url.split('/').size == 4) or (doc.url.split('/').size == 5 and collection.label === 'projects')
|
47
|
+
Jekyll.logger.debug("OPF:", "Adding document with URL: #{doc.url}")
|
45
48
|
collection.docs << doc
|
49
|
+
else
|
50
|
+
Jekyll.logger.debug("OPF:", "Did NOT add document with URL (nesting level doesn’t match): #{doc.url}")
|
46
51
|
end
|
47
52
|
else
|
53
|
+
Jekyll.logger.debug("OPF:", "Adding static file: #{path}")
|
48
54
|
collection.files << Jekyll::StaticFile.new(
|
49
55
|
@site,
|
50
56
|
@site.source,
|
@@ -104,6 +110,9 @@ module Jekyll
|
|
104
110
|
project['site']['git_repo_url'],
|
105
111
|
['assets', '_posts', '_software', '_specs'])
|
106
112
|
|
113
|
+
|
114
|
+
Jekyll.logger.debug("OPF:", "Reading files in project #{project_path}")
|
115
|
+
|
107
116
|
CollectionDocReader.new(site).read(
|
108
117
|
project_path,
|
109
118
|
@site.collections['projects'])
|
@@ -131,10 +140,10 @@ module Jekyll
|
|
131
140
|
spec_checkout_path
|
132
141
|
end
|
133
142
|
|
143
|
+
repo_checkout = nil
|
134
144
|
begin
|
135
145
|
repo_checkout = git_shallow_checkout(spec_checkout_path, repo_url, [repo_subtree])
|
136
146
|
rescue
|
137
|
-
repo_checkout = nil
|
138
147
|
end
|
139
148
|
|
140
149
|
if repo_checkout
|
@@ -164,14 +173,23 @@ module Jekyll
|
|
164
173
|
def fetch_and_read_specs(collection_name, build_pages=false)
|
165
174
|
# collection_name would be either specs or (for hub site) projects
|
166
175
|
|
176
|
+
Jekyll.logger.debug("OPF:", "Fetching specs for items in collection #{collection_name} (if it exists)")
|
177
|
+
|
167
178
|
return unless @site.collections.key?(collection_name)
|
168
179
|
|
180
|
+
Jekyll.logger.debug("OPF:", "Fetching specs for items in collection #{collection_name}")
|
181
|
+
|
169
182
|
# Get spec entry points
|
170
183
|
entry_points = @site.collections[collection_name].docs.select do |doc|
|
171
184
|
doc.data['spec_source']
|
172
185
|
end
|
173
186
|
|
187
|
+
if entry_points.size < 1
|
188
|
+
Jekyll.logger.info("OPF:", "Fetching specs for items in collection #{collection_name}: No entry points")
|
189
|
+
end
|
190
|
+
|
174
191
|
entry_points.each do |index_doc|
|
192
|
+
Jekyll.logger.debug("OPF:", "Fetching specs: entry point #{index_doc.id} in collection #{collection_name}")
|
175
193
|
build_and_read_spec_pages(collection_name, index_doc, build_pages)
|
176
194
|
end
|
177
195
|
end
|
@@ -179,14 +197,23 @@ module Jekyll
|
|
179
197
|
def fetch_and_read_software(collection_name)
|
180
198
|
# collection_name would be either software or (for hub site) projects
|
181
199
|
|
200
|
+
Jekyll.logger.debug("OPF:", "Fetching software for items in collection #{collection_name} (if it exists)")
|
201
|
+
|
182
202
|
return unless @site.collections.key?(collection_name)
|
183
203
|
|
204
|
+
Jekyll.logger.debug("OPF:", "Fetching software for items in collection #{collection_name}")
|
205
|
+
|
184
206
|
entry_points = @site.collections[collection_name].docs.select do |doc|
|
185
207
|
doc.data['repo_url']
|
186
208
|
end
|
187
209
|
|
210
|
+
if entry_points.size < 1
|
211
|
+
Jekyll.logger.info("OPF:", "Fetching software for items in collection #{collection_name}: No entry points")
|
212
|
+
end
|
213
|
+
|
188
214
|
entry_points.each do |index_doc|
|
189
215
|
item_name = index_doc.id.split('/')[-1]
|
216
|
+
Jekyll.logger.debug("OPF:", "Fetching software: entry point #{index_doc.id} in collection #{collection_name}")
|
190
217
|
|
191
218
|
docs = index_doc.data['docs']
|
192
219
|
main_repo = index_doc.data['repo_url']
|
@@ -196,10 +223,10 @@ module Jekyll
|
|
196
223
|
|
197
224
|
docs_path = "#{index_doc.path.split('/')[0..-2].join('/')}/#{item_name}"
|
198
225
|
|
226
|
+
sw_docs_checkout = nil
|
199
227
|
begin
|
200
228
|
sw_docs_checkout = git_shallow_checkout(docs_path, sw_docs_repo, [sw_docs_subtree])
|
201
229
|
rescue
|
202
|
-
sw_docs_checkout = nil
|
203
230
|
end
|
204
231
|
|
205
232
|
if sw_docs_checkout
|
@@ -280,6 +307,7 @@ module Jekyll
|
|
280
307
|
:modified_at => nil,
|
281
308
|
}
|
282
309
|
else
|
310
|
+
Jekyll.logger.debug("OPF:", "Fetching & checking out #{remote_url} for #{repo_path}")
|
283
311
|
repo.fetch(DEFAULT_REPO_REMOTE_NAME, { :depth => 1 })
|
284
312
|
repo.checkout("#{DEFAULT_REPO_REMOTE_NAME}/#{DEFAULT_REPO_BRANCH}", { :f => true })
|
285
313
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-open-project-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.4
|
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:
|
11
|
+
date: 2020-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
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: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: git
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.50'
|
83
|
-
description:
|
83
|
+
description:
|
84
84
|
email:
|
85
85
|
- open.source@ribose.com
|
86
86
|
executables: []
|
@@ -104,7 +104,7 @@ homepage: https://github.com/riboseinc/jekyll-theme-open-project-helpers/
|
|
104
104
|
licenses:
|
105
105
|
- MIT
|
106
106
|
metadata: {}
|
107
|
-
post_install_message:
|
107
|
+
post_install_message:
|
108
108
|
rdoc_options: []
|
109
109
|
require_paths:
|
110
110
|
- lib
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubygems_version: 3.0.6
|
123
|
-
signing_key:
|
123
|
+
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Helpers for the Open Project Jekyll theme
|
126
126
|
test_files: []
|