metanorma-plugin-glossarist 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6c81322a6e6ffc687bba5c93bd828dd0575b311fa4d85e7b2dd05054b62132e
4
- data.tar.gz: bc2cfd48b22e009133a9b8dbfd8961020c63e3709b19294a8f9919979705032f
3
+ metadata.gz: d812a199689659153655480f40c426d2fbde384d892b6b9f90793dc69f9850d8
4
+ data.tar.gz: 5d6e5645e1ec1a97a357c3c959bd5a6dbea43f607032fbcfd9aee420f4a8fcc7
5
5
  SHA512:
6
- metadata.gz: bed6a841c96d5741a9ef8ae896e5676b787c3f9539eefe245ebb2808f43168c1b8d1381f265ed8798e5fd8a001f43360081d38be9cf96b35b38990fe87d45356
7
- data.tar.gz: c0e590d799ee958142f6943200f4fb2389c6e6d27934add0e9c741789be520875929bee28a2abc303720db216862e780533e73e679ddbd7b0456ad654ac34a48
6
+ metadata.gz: a936ef9f83abcf27f16c45d31020969dba9decd76df34ed7e908e3a2165fa2527422823db3a8c91785ba1762550a171e9e1fa4f895621e32701233dcee3abc4c
7
+ data.tar.gz: 69a9f2a0a632de754786b49fc0c646fcc810538b5df9cfb218ef296176bb388bbe80fa4d052bb340e0ec9b9766d1460046f8460fc3aa1021c979f467114dae89
@@ -27,11 +27,20 @@ module Liquid
27
27
  end
28
28
  end
29
29
 
30
+ def load_collection(folder_path)
31
+ @@collections ||= {}
32
+
33
+ return @@collections[folder_path] if @@collections[folder_path]
34
+
35
+ collection = ::Glossarist::ManagedConceptCollection.new
36
+ collection.load_from_files(folder_path)
37
+ @@collections[folder_path] = collection
38
+ end
39
+
30
40
  def render(context)
31
41
  @contexts.each do |local_context|
32
42
  context_file = local_context[:file_path].strip
33
- collection = ::Glossarist::ManagedConceptCollection.new
34
- collection.load_from_files(context_file)
43
+ collection = load_collection(context_file)
35
44
 
36
45
  context[local_context[:name]] = Liquid::Drops::ConceptsDrop.new(collection, @filters)
37
46
  end
@@ -1,7 +1,7 @@
1
1
  module Metanorma
2
2
  module Plugin
3
3
  module Glossarist
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-plugin-glossarist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
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-07-05 00:00:00.000000000 Z
11
+ date: 2023-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor