jekyll-theme-open-project-helpers 2.1.0 → 2.1.1

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: 9b045cd70c2375d6cc096ac8d3323e15727c907bcc78ecb627641e0f87832ec9
4
- data.tar.gz: 283ad8eb59754e1d664d442aba2ead3b4fcb6a882a2fba05bc0658ddd5d09d30
3
+ metadata.gz: d096dee75cd2701ec861557d024217d5ae9a1ece20af4449b9711404afab5e40
4
+ data.tar.gz: b00a83ea68cded47ec6a54619ba8a9989de7a99efc366be0192b9dde65f69b6a
5
5
  SHA512:
6
- metadata.gz: cd120bba4d87dbe8b3a20c88b9c468d8c1a561d857597ff1d3111dd177ead51920a15d27b2ac8fc52f83894eba82623b3aeb8f3dd8fbe0bef49e70df215b478e
7
- data.tar.gz: 34c9f84aee668df5e6194b2a5256fe02a870286d5b3883dc9227447f110ba195e354debbe6e7788e5eb14b4d161508915930a0632da7b2c29b8e9a9946dbef73
6
+ metadata.gz: 8edabeaebf34a1dc29863c28387cdaa3f6f530694ce154a6d7dd5f6e3a730a7da4669f5e827b62cbec4ffc768bf584b064ee4be225e14aa272f04828d8ec8cb2
7
+ data.tar.gz: 2662e8d9aa452712988143669c2d91b1ff709bceaaf838578eb7a05f341431c87bfd32613ae28e8caa373bd6ec038bd2b01170b63b83812bc7dc504cbd9216e1
@@ -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.1.0'
5
+ s.version = '2.1.1'
6
6
  s.authors = ['Ribose Inc.']
7
7
  s.email = ['open.source@ribose.com']
8
8
 
@@ -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
@@ -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.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-14 00:00:00.000000000 Z
11
+ date: 2020-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll