jekyll-geolexica 1.8.6 → 1.8.8

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: 953781d4af25bb0fddf2369620b0eb6f80dbe78b5ed0513a2ccb936cb4766fcd
4
- data.tar.gz: 92a2f81efd01b51138ad95e3c2a3821688684ec2bc544f188b558999b35d91d8
3
+ metadata.gz: 28a92c6437e168d14b81c6230871e51b864ad78ca6e8a465c2361553d5273f10
4
+ data.tar.gz: 0f42f094620da7d67a4b744020e4f6063996f661281afb05488ccfdd422f9896
5
5
  SHA512:
6
- metadata.gz: 9eb581e4730853549c2560c406370a849638db0019f3da67d3893a14e9e356bf44d4ce9e0253cf87ffaac85b4edf523ee639c0129236010c284bd952a695ebeb
7
- data.tar.gz: 17c3fabebc23db2294405d7ee8914dd0bd895759fc33c582345ade2807a5c85660fa6c4af44abda90642d0154b0f3789d0784d3c6f8f94bed966a4ddfc3ee881
6
+ metadata.gz: 05c3892fd357900d2c6793b2725fcb43ec9cb2b24c3ca2e8ad536c266046c7fc1b6a0e3d88b6b1d18fd85694d09a99675cc5bfb7060da2c4e07a333530c52efa
7
+ data.tar.gz: e09f1a3c68284ac5a859cca8ac4dd8357f3c1b5212a8ae0e8ccc55afb4824127f28383245132342a95abcfde8ba8d96a72c313b80387d0ed50e44cdb93eb51bd
data/README.adoc ADDED
@@ -0,0 +1,15 @@
1
+ = jekyll-geolexica
2
+
3
+ image:https://github.com/geolexica/jekyll-geolexica/actions/workflows/test.yaml/badge.svg[Build Status,link=https://github.com/geolexica/jekyll-geolexica/actions/workflows/test.yaml]
4
+ image:https://img.shields.io/gem/v/jekyll-geolexica.svg[Gem Version,link=https://rubygems.org/gems/jekyll-geolexica]
5
+ image:https://img.shields.io/github/issues-pr-raw/geolexica/jekyll-geolexica.svg[Pull Requests,link=https://github.com/geolexica/jekyll-geolexica/pulls]
6
+ image:https://img.shields.io/github/commits-since/geolexica/jekyll-geolexica/latest.svg[Commits since latest,link=https://github.com/geolexica/jekyll-geolexica/releases]
7
+
8
+ Jekyll plugin for Geolexica by the Geolexica Team.
9
+
10
+ == Releasing
11
+
12
+ === New approach
13
+
14
+ Do `+git tag ${version-tag}+` or, start release manually with the
15
+ https://github.com/geolexica/jekyll-geolexica/actions/workflows/release.yml[`release.yml` workflow]
@@ -8,20 +8,20 @@ module Jekyll
8
8
 
9
9
  attr_reader :site
10
10
 
11
- alias_method :each_concept, :each_value
12
- alias_method :each_termid, :each_key
11
+ alias each_concept each_value
12
+ alias each_termid each_key
13
13
 
14
14
  def initialize(site)
15
15
  @site = site
16
16
  end
17
17
 
18
18
  def load_glossary
19
- Jekyll.logger.info("Geolexica:", "Loading concepts")
19
+ Jekyll.logger.info('Geolexica:', 'Loading concepts')
20
20
  Dir.glob(concepts_glob).each { |path| load_concept(path) }
21
21
  end
22
22
 
23
23
  def store(concept)
24
- super(concept.data["termid"], concept)
24
+ super(concept.data['termid'], concept)
25
25
  end
26
26
 
27
27
  def language_statistics
@@ -31,17 +31,17 @@ module Jekyll
31
31
  # Defines how Glossary is exposed in Liquid templates.
32
32
  def to_liquid
33
33
  {
34
- "language_statistics" => language_statistics,
34
+ 'language_statistics' => language_statistics
35
35
  }
36
36
  end
37
37
 
38
38
  protected
39
39
 
40
40
  def load_concept(concept_file_path)
41
- Jekyll.logger.debug("Geolexica:",
42
- "reading concept from file #{concept_file_path}")
41
+ Jekyll.logger.debug('Geolexica:',
42
+ "reading concept from file #{concept_file_path}")
43
43
 
44
- concept_hash = if glossary_format == "paneron"
44
+ concept_hash = if glossary_format == 'paneron'
45
45
  read_paneron_concept_file(concept_file_path)
46
46
  else
47
47
  read_concept_file(concept_file_path)
@@ -49,9 +49,9 @@ module Jekyll
49
49
 
50
50
  preprocess_concept_hash(concept_hash)
51
51
  store Concept.new(concept_hash)
52
- rescue
53
- Jekyll.logger.error("Geolexica:",
54
- "failed to read concept from file #{concept_file_path}")
52
+ rescue StandardError
53
+ Jekyll.logger.error('Geolexica:',
54
+ "failed to read concept from file #{concept_file_path}")
55
55
  raise
56
56
  end
57
57
 
@@ -63,14 +63,19 @@ module Jekyll
63
63
  def read_paneron_concept_file(path)
64
64
  safe_load_options = { permitted_classes: [Date, Time] }
65
65
  concept = YAML.safe_load(File.read(path), **safe_load_options)
66
- concept["termid"] = concept["data"]["identifier"]
66
+ concept['termid'] = concept['data']['identifier']
67
67
 
68
- concept["data"]["localizedConcepts"].each do |lang, local_concept_id|
68
+ concept['data']['localizedConcepts'].each do |lang, local_concept_id|
69
69
  localized_concept_path = File.join(localized_concepts_path, "#{local_concept_id}.yaml")
70
- concept[lang] = YAML.safe_load(File.read(localized_concept_path), **safe_load_options)["data"]
70
+ concept[lang] = YAML.safe_load(File.read(localized_concept_path), **safe_load_options)['data']
71
71
 
72
- if lang == "eng" && concept[lang]
73
- concept["term"] = concept[lang]["terms"].first["designation"]
72
+ next unless concept[lang]
73
+
74
+ concept['term'] = concept[lang]['terms'].first['designation'] if lang == 'eng'
75
+
76
+ if concept[lang]['status'] && !concept[lang]['status'].empty? &&
77
+ (concept[lang]['entry_status'].nil? || concept[lang]['entry_status'].empty?)
78
+ concept[lang]['entry_status'] = concept[lang]['status']
74
79
  end
75
80
  end
76
81
 
@@ -78,14 +83,13 @@ module Jekyll
78
83
  end
79
84
 
80
85
  # Does nothing, but some sites may replace this method.
81
- def preprocess_concept_hash(concept_hash)
82
- end
86
+ def preprocess_concept_hash(concept_hash); end
83
87
 
84
88
  def calculate_language_statistics
85
- unsorted = each_value.lazy.
86
- flat_map{ |concept| term_languages & concept.data.keys }.
87
- group_by(&:itself).
88
- transform_values(&:count)
89
+ unsorted = each_value.lazy
90
+ .flat_map { |concept| term_languages & concept.data.keys }
91
+ .group_by(&:itself)
92
+ .transform_values(&:count)
89
93
 
90
94
  # This is not crucial, but gives nicer output, and ensures that
91
95
  # all +term_languages+ are present.
@@ -95,7 +99,7 @@ module Jekyll
95
99
  class Concept
96
100
  attr_reader :data
97
101
 
98
- # TODO Maybe some kind of Struct instead of Hash.
102
+ # TODO: Maybe some kind of Struct instead of Hash.
99
103
  attr_reader :pages
100
104
 
101
105
  def initialize(data)
@@ -104,7 +108,7 @@ module Jekyll
104
108
  end
105
109
 
106
110
  def termid
107
- data["termid"]
111
+ data['termid']
108
112
  end
109
113
 
110
114
  class LiquidCompatibleHash < Hash
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Jekyll
5
5
  module Geolexica
6
- VERSION = "1.8.6".freeze
6
+ VERSION = "1.8.8".freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-geolexica
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6
4
+ version: 1.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-20 00:00:00.000000000 Z
11
+ date: 2023-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -156,6 +156,7 @@ extensions: []
156
156
  extra_rdoc_files: []
157
157
  files:
158
158
  - Gemfile
159
+ - README.adoc
159
160
  - Rakefile
160
161
  - _config.yml
161
162
  - _data/lang.yaml