jekyll-theme-isotc211-helpers 0.6.0 → 0.6.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: 9f80662d92568d11c3e88549602635fac4ec35a401452b1a2dbf8e4f3d8c30b7
4
- data.tar.gz: d5dcb937239ea627b63d4e825022a116e2b5e2b5198c9a0be20f87b2ebf1234a
3
+ metadata.gz: 18514a72710e52ab9e597cdaaf04d060c861d4577654ede701b0917b033441a2
4
+ data.tar.gz: 4cc8d131a4372a249589ee3adbfd2515091b414281379c6ace7bd32a0778c519
5
5
  SHA512:
6
- metadata.gz: 5f82fc0ecc30ee7ceb971ac7a3cd6f30950b5305b9229b4aa25d32f0ecffc238d289c80921fd69d284770a90edbde05f186d254ec442997b88901fa7f646f176
7
- data.tar.gz: 6734c587bc22f2176abe09877430d5977ce17f4f7788065ff008591483e4cd14244542fa6361255b1c4202ccc423ea422a17c038c1de0d4dcd484699ac0a3425
6
+ metadata.gz: ff143f23193ea76f1976212b07ec0e4d6ac6a5271f8b3e291168a77aba8ebe735a834f4c5bc9e8f470f66bca2c083f38a0ed3fb026bde512b2f1aaad96913534
7
+ data.tar.gz: 1d76bde595eb14cb513ee658249385d7f139a290367111d63fafbb8719917bdf9aacd9a96a95eb2c54065af243a405d62ee00014c3233d81edad27a159438c8d
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ # Uncomment to enable the "spec" task
5
+ # RSpec::Core::RakeTask.new(:spec)
6
+ #
7
+ # task :default => :spec
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'jekyll-theme-isotc211-helpers'
5
- s.version = '0.6.0'
5
+ s.version = '0.6.1'
6
6
  s.authors = ['Ribose Inc.']
7
7
  s.email = ['open.source@ribose.com']
8
8
 
@@ -20,6 +20,8 @@ module Jekyll
20
20
 
21
21
  self.process(@name)
22
22
 
23
+ puts resources
24
+
23
25
  self.data = {
24
26
  'layout' => layout || 'resource-index',
25
27
  'title' => header,
@@ -78,32 +80,33 @@ module Jekyll
78
80
  # Returns a data structure representing a tree of resource subdirectories & files
79
81
  def read_resource_contents(dir, id, listing_id)
80
82
  cfg = self.config['resource_listings'][listing_id]
81
- return directory_hash(dir, "#{cfg['resource_label'].capitalize} #{id}")
83
+ directory_hash(dir, "#{cfg['resource_label'].capitalize} #{id}")
82
84
  end
83
85
 
84
86
  def generate_resource_pages
85
- if self.config.key?('resource_listings')
87
+ return unless self.config.key?('resource_listings')
88
+
89
+ self.config['resource_listings'].each do |listing_id, cfg|
90
+ resources = {}
86
91
 
87
- self.config['resource_listings'].each do |listing_id, cfg|
88
- resources = {}
92
+ Pathname(cfg['resource_root']).children.sort.each do |resource_dir|
89
93
 
90
- Pathname(cfg['resource_root']).children.each do |resource_dir|
91
- basename = File.basename(resource_dir)
92
- if basename[0] == '.'
93
- # Ignore dot-directories
94
- next
95
- end
94
+ # Ignore non-directories
95
+ next unless File.directory?(resource_dir)
96
+ basename = File.basename(resource_dir)
96
97
 
97
- id = basename
98
- resources[id] = {} # Empty hash can in future be resource metadata
99
- contents = self.read_resource_contents(resource_dir.to_s, id, listing_id)
100
- self.write_resource_page(listing_id, id, contents)
101
- end
98
+ # Ignore dot-directories
99
+ next if basename[0] == '.'
102
100
 
103
- self.write_resource_listing_page(listing_id, resources)
101
+ id = basename
102
+ resources[id] = {} # Empty hash can in future be resource metadata
103
+ contents = self.read_resource_contents(resource_dir.to_s, id, listing_id)
104
+ self.write_resource_page(listing_id, id, contents)
104
105
  end
105
106
 
107
+ self.write_resource_listing_page(listing_id, resources)
106
108
  end
109
+
107
110
  end
108
111
 
109
112
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-isotc211-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
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: 2020-04-11 00:00:00.000000000 Z
11
+ date: 2021-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.50'
55
- description:
55
+ description:
56
56
  email:
57
57
  - open.source@ribose.com
58
58
  executables: []
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - LICENSE.txt
63
63
  - README.md
64
+ - Rakefile
64
65
  - develop/release
65
66
  - jekyll-theme-isotc211-helpers.gemspec
66
67
  - lib/jekyll-theme-isotc211-helpers.rb
@@ -70,7 +71,7 @@ homepage: https://github.com/riboseinc/jekyll-theme-isotc211-helpers/
70
71
  licenses:
71
72
  - MIT
72
73
  metadata: {}
73
- post_install_message:
74
+ post_install_message:
74
75
  rdoc_options: []
75
76
  require_paths:
76
77
  - lib
@@ -86,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
87
  version: '0'
87
88
  requirements: []
88
89
  rubygems_version: 3.0.3
89
- signing_key:
90
+ signing_key:
90
91
  specification_version: 4
91
92
  summary: Helpers for the ISO/TC 211 Jekyll theme
92
93
  test_files: []