jekyll-theme-open-project-helpers 2.0.19 → 2.1.2

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: ca57af7201d24be44b8599119f06542dc5259103eb3f1e7b6e2296039ba0a150
4
- data.tar.gz: 8517f92762844b2b3c3219190c9240229d4217cf0d167ab69455e7bf8db257cc
3
+ metadata.gz: ff8126d52bf314ac4b6a39f232dce02bce77a121b22063fc5fb1b62333481c9a
4
+ data.tar.gz: 965b43ee7edce41c4901dd7ab92a57a3f2d8ea586f319eaa26d4a38d1aa6e73f
5
5
  SHA512:
6
- metadata.gz: b423c8c81a5c1f329c77fcf76e0fe6ea1471effd204320050f537aa26f6348be85c87b95d620ecc7a8e5fd37addc4658cfe881a5cff9d1536248f65247bf030d
7
- data.tar.gz: f2bfa0879b66b8266e66a4e04d970fb35ec193f81d140291bbc629fc47071d9bfaa02042feb41865fd6de02422f42310dfa854a58e67cad109ec7cb6988ba585
6
+ metadata.gz: 01f428993882c421af571725613e52e1ab7c4a0ccdc9b4e0a715b3b9efa4a1d963afbf267ee65e48ae45d6223efcafbb324770e9335237841e03cb31d53d8d32
7
+ data.tar.gz: c764bbac19e62eb28bd0b42a2196b786cf70a0e2e865ef313b3b843e4266eec850e3c6586bc93ca8fd3d75464fcdb7240c2fd6b555efe4b8c641652617b694db
@@ -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
@@ -8,3 +8,20 @@ required by the theme.
8
8
  Currently it enables such features as tag-based filtering
9
9
  of open software and specification indexes, unified blog index,
10
10
  fetching open project/software/specification data from their repos.
11
+
12
+ ## Releasing
13
+
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.
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:
23
+
24
+ * Builds new gem version
25
+ * Pushes gem to rubygems.org
26
+ * Creates new version tag in this repository
27
+ * Pushes changes to GitHub
@@ -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.19'
5
+ s.version = '2.1.2'
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.19
4
+ version: 2.1.2
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-09-08 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,8 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubyforge_project:
123
- rubygems_version: 2.7.6.2
122
+ rubygems_version: 3.0.3
124
123
  signing_key:
125
124
  specification_version: 4
126
125
  summary: Helpers for the Open Project Jekyll theme