jekyll-theme-open-project-helpers 2.0.20 → 2.1.3

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: f4171bb52044da1871926010e89b596e2de0426a534f49a349f0a2a7a9419056
4
- data.tar.gz: 35f85e3fb538d00d22a7ec53c6ad01b1b33daa38919e7a86c99f25118fb7adb0
3
+ metadata.gz: 41c88b1efe40f6112387d3d2a0c1dbcc9ac5492c1dbb44b23fbabcc07eba88ff
4
+ data.tar.gz: cbf2ad92454b97bb43cb23bee8e38f00b7394e1a13efb9bd283bd9aca0174a3d
5
5
  SHA512:
6
- metadata.gz: 8adbfc5e2a52cc6c8484cc7814c725932b9f1c45b17fb154f9ed3d3e13369fffc8a9bbb07f4f08f1fccbe5fd8715d0ec6d310025cb33b62ef04ac5912884e328
7
- data.tar.gz: e104986345cde94f0abee2ec76b9e75d53583b8216be88d34e5c9c6442593b830e6371666369a538146781024dbd314568c6e256eba81eb621a35ce3cbc37867
6
+ metadata.gz: ddf5c0d05f8e808ce21c94ae8b2ff263e31da28cf1c092cd0e57c0ea65157a574883ec42aa0a532633098246554f003e79941407a086990603db821a94f637d3
7
+ data.tar.gz: 234074e6bb51cc98a49bbbf334ae4ac43f3fd6423c4c0a15b12838b690762ffa9e3ab16f3b810891f069d09b7ede2c9e11230accdbbedee864434bacb3bec513
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 Ribose
3
+ Copyright (c) 2020 Ribose
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
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-helpers](theme gem docs) for more.
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.0.20'
5
+ s.version = '2.1.3'
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', '~> 3.8'
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
- items = site.collections[collection_name].docs.select { |item|
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.0.20
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-06 00:00:00.000000000 Z
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: '3.8'
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: '3.8'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: git
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.0.6
122
+ rubygems_version: 3.0.3
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Helpers for the Open Project Jekyll theme