jekyll-archimate 0.2.4 → 0.2.5
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff80653eaa463970477dd3dbd4ecca16b3f3479a
|
4
|
+
data.tar.gz: c81145111de4852bb3899ca398a03b9d65f7976d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d44deb504efcd55b8c068fe0de590056306c0c2825a65357483874567212b9fcab1cfd22fb890f3e238094faf0c1c6f3c2536430e4457373a47d573ea110e5b6
|
7
|
+
data.tar.gz: 13924d4aaf7023978733669ce2d12c542782fbfacec46dc4cb46b9599bc5d420d94a85dbc4f9ccdf3279f5d79ca88433c9b6c9de44aba70ac89e9c3f28cf7f28
|
@@ -13,6 +13,7 @@ module Jekyll
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def cache_valid?(archimate_file)
|
16
|
+
return false unless archimate_file
|
16
17
|
path = archimate_file.path
|
17
18
|
@cache.key?(path) &&
|
18
19
|
@cache[path].archimate_file.modified_time.to_i == archimate_file.modified_time.to_i
|
@@ -30,7 +31,7 @@ module Jekyll
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def default_archimate_file=(archimate_file)
|
33
|
-
unless @cache.key?(archimate_file.path)
|
34
|
+
unless !archimate_file || @cache.key?(archimate_file.path)
|
34
35
|
raise(
|
35
36
|
"Default ArchiMate file does not exist in cache: #{archimate_file.relative_path}"
|
36
37
|
)
|
@@ -19,7 +19,10 @@ module Jekyll
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def render(context)
|
22
|
-
|
22
|
+
page = context.registers[:page]
|
23
|
+
page_dir = File.dirname(page["path"])
|
24
|
+
rel_archimate_dir = File.join(page_dir, "archimate")
|
25
|
+
baseurl = Dir.exist?(rel_archimate_dir) ? File.dirname(page["url"]) : context.registers[:site].baseurl
|
23
26
|
# TODO: make the archimate_dir configurable in _config.yml and as an
|
24
27
|
# optional argument in the tag.
|
25
28
|
archimate_dir = [baseurl, "archimate", "svg"].join("/")
|
@@ -5,26 +5,16 @@ module Jekyll
|
|
5
5
|
class ArchimateGenerator < Jekyll::Generator
|
6
6
|
def generate(site)
|
7
7
|
Jekyll.logger.info "ArchimateGenerator.generate"
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
cache.cache_valid?(cache.default_archimate_file)
|
19
|
-
end
|
20
|
-
|
21
|
-
def preload_cache(archimate_files)
|
22
|
-
archimate_files.each { |file| cache.model(file) }
|
23
|
-
cache.default_archimate_file = archimate_files.first # TODO: select file in the `archimate` directory
|
24
|
-
end
|
25
|
-
|
26
|
-
def cache
|
27
|
-
@cache ||= ArchimateCache.instance
|
8
|
+
site
|
9
|
+
.collections
|
10
|
+
.values
|
11
|
+
.flat_map(&:files)
|
12
|
+
.concat(site.static_files)
|
13
|
+
.select { |static_file| static_file.extname =~ /\.(archimate|xml)$/ }
|
14
|
+
.each do |archimate_file|
|
15
|
+
ArchimateSvgGenerator.new(site, archimate_file).generate
|
16
|
+
ArchimateIndexGenerator.new(site, archimate_file).generate
|
17
|
+
end
|
28
18
|
end
|
29
19
|
end
|
30
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-archimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Morga
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|