lutaml 0.11.4 → 0.11.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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +28 -5
  3. data/.github/workflows/links.yml +14 -0
  4. data/README.adoc +6 -43
  5. data/docs/_config.yml +1 -1
  6. data/docs/_guides/cli-usage.adoc +43 -0
  7. data/docs/_guides/diagram-generation.adoc +3 -3
  8. data/docs/_guides/index.adoc +21 -20
  9. data/docs/_guides/parsing/index.adoc +9 -8
  10. data/docs/_guides/parsing/qea-parsing.adoc +47 -0
  11. data/docs/_guides/repository-management.adoc +44 -0
  12. data/docs/_guides/sysml-modeling.adoc +2 -2
  13. data/docs/_guides/uml-modeling.adoc +3 -5
  14. data/docs/_pages/concepts/diagram-generation.adoc +4 -4
  15. data/docs/_pages/concepts/lur-format.adoc +4 -4
  16. data/docs/_pages/concepts/qea-parsing.adoc +4 -4
  17. data/docs/_pages/concepts/uml-models.adoc +43 -0
  18. data/docs/_pages/core/architecture.adoc +4 -4
  19. data/docs/_pages/core/installation.adoc +7 -7
  20. data/docs/_pages/core/overview.adoc +10 -10
  21. data/docs/_pages/index.adoc +11 -10
  22. data/docs/_pages/uml-syntax.adoc +41 -25
  23. data/docs/_references/api/parsers.adoc +61 -0
  24. data/docs/_references/api/presenters.adoc +43 -0
  25. data/docs/_references/api/repository.adoc +67 -0
  26. data/docs/_references/cli/commands.adoc +72 -0
  27. data/docs/_references/configuration/diagram-styles.adoc +3 -3
  28. data/docs/_references/configuration/index.adoc +5 -4
  29. data/docs/_references/configuration/package-metadata.adoc +4 -4
  30. data/docs/_references/formats/index.adoc +5 -4
  31. data/docs/_references/formats/lur-format.adoc +39 -0
  32. data/docs/_references/formats/qea-structure.adoc +4 -4
  33. data/docs/_references/index.adoc +26 -25
  34. data/docs/_tutorials/documentation-site.adoc +47 -0
  35. data/docs/_tutorials/first-lur-package.adoc +45 -0
  36. data/docs/_tutorials/generating-diagrams.adoc +42 -0
  37. data/docs/_tutorials/getting-started.adoc +45 -0
  38. data/docs/_tutorials/index.adoc +28 -37
  39. data/docs/_tutorials/querying-models.adoc +44 -0
  40. data/docs/examples/build_package.rb +12 -0
  41. data/docs/examples/build_site.rb +12 -0
  42. data/docs/examples/city_model.rb +21 -0
  43. data/docs/examples/present_class.rb +10 -0
  44. data/docs/examples/query_model.rb +12 -0
  45. data/docs/examples/render_diagram.rb +11 -0
  46. data/docs/index.adoc +12 -12
  47. data/docs/lychee.toml +24 -57
  48. data/lib/lutaml/version.rb +1 -1
  49. data/lutaml.gemspec +1 -1
  50. data/scripts/check-site-urls.rb +54 -0
  51. data/scripts/check-vendor-link.py +64 -0
  52. metadata +26 -4
data/docs/lychee.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  # Lychee link checker configuration for LutaML documentation
2
2
 
3
- # Cache results for 1 day to speed up repeated checks
3
+ # Cache results to speed up repeated checks
4
4
  cache = true
5
5
 
6
6
  # Maximum number of concurrent requests
@@ -12,72 +12,39 @@ timeout = 30
12
12
  # Maximum number of retries per link
13
13
  max_retries = 3
14
14
 
15
- # Follow redirects
16
- follow_redirects = true
17
-
18
- # Maximum redirect depth
15
+ # Maximum redirect depth (redirects are followed up to this many)
19
16
  max_redirects = 5
20
17
 
21
- # Accept status codes
22
- accept = [
23
- 200, # OK
24
- 203, # Non-Authoritative Information
25
- 204, # No Content
26
- 206, # Partial Content
27
- 429, # Too Many Requests (we'll retry)
28
- ]
18
+ # Accept these HTTP status codes as success
19
+ accept = [200, 203, 204, 206, 429]
29
20
 
30
- # Exclude patterns (glob format)
21
+ # Exclude URLs matching these regexes
31
22
  exclude = [
32
- # Exclude localhost links
33
- 'http://localhost*',
34
- 'http://127.0.0.1*',
35
-
36
- # Exclude example domains
37
- 'http://example.com*',
38
- 'https://example.com*',
39
-
40
- # Exclude GitHub edit links (they may 404 for non-contributors)
41
- 'https://github.com/*/edit/*',
42
-
43
- # Exclude potential rate-limited APIs
44
- 'https://api.github.com/*',
45
- ]
46
-
47
- # Include patterns - check these file types
48
- include = [
49
- '**/*.html',
50
- '**/*.md',
51
- '**/*.adoc',
23
+ # This exact URL is probed separately; only an explicit challenge is deferred.
24
+ '^https://sparxsystems\.com/$',
25
+ # Checked against built files by scripts/check-site-urls.rb before lychee.
26
+ '^https://www\.lutaml\.org/lutaml(?:/|$)',
27
+ '^https://lutaml\.github\.io/lutaml(?:/|$)',
28
+ '^https?://localhost(?:[:/]|$)',
29
+ '^https?://127\.0\.0\.1(?:[:/]|$)',
30
+ '^https?://example\.com(?:[:/]|$)',
31
+ '^https://github\.com/[^/]+/[^/]+/edit/',
32
+ '^https://api\.github\.com/',
52
33
  ]
53
34
 
54
- # HTTP headers to send with requests
55
- [headers]
56
- # Set user agent
57
- User-Agent = "Mozilla/5.0 (compatible; Lychee/0.13.0; +https://github.com/lycheeverse/lychee)"
58
-
59
- # GitHub API token (if available in environment)
60
- # Authorization = "Bearer ${GITHUB_TOKEN}"
61
-
62
- # Verbose output
63
- verbose = true
64
-
65
- # Don't show progress bar in CI
35
+ # Do not show a progress bar in CI
66
36
  no_progress = true
67
37
 
68
38
  # Output format
69
39
  format = "markdown"
70
40
 
71
- # Exclude paths from file system checks
72
- exclude_path = [
73
- ".git/",
74
- "_site/",
75
- "node_modules/",
76
- "vendor/",
77
- ]
41
+ # HTTP headers to send with requests
42
+ header = { "User-Agent" = "Mozilla/5.0 (compatible; Lychee/0.23.0; +https://github.com/lycheeverse/lychee)" }
78
43
 
79
- # Scheme to use when checking local files
80
- scheme = "https"
44
+ # Schemes to check
45
+ scheme = ["https", "http"]
81
46
 
82
- # Base URL for relative links
83
- # base = "https://lutaml.github.io/lutaml"
47
+ # Exclude these paths from file-system discovery. NOTE: do not exclude _site/
48
+ # here — the CI link check explicitly targets _site/**/*.html, and excluding it
49
+ # would drop every file ("No files found") and fail with failIfEmpty.
50
+ exclude_path = [".git/", "node_modules/", "vendor/"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lutaml
4
- VERSION = "0.11.4"
4
+ VERSION = "0.11.6"
5
5
  end
data/lutaml.gemspec CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  # (fiddle was removed from Ruby 4.0 default gems, breaking reline on Windows)
35
35
  spec.add_dependency "fiddle"
36
36
  spec.add_dependency "lutaml-lml"
37
- spec.add_dependency "lutaml-model", "~> 0.8.0"
37
+ spec.add_dependency "lutaml-model", "~> 0.8.156"
38
38
  spec.add_dependency "lutaml-uml", "~> 1.0"
39
39
  spec.metadata["rubygems_mfa_required"] = "true"
40
40
  end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cgi"
4
+ require "pathname"
5
+ require "set"
6
+ require "uri"
7
+ require "yaml"
8
+
9
+ config = YAML.safe_load(File.read(ARGV.fetch(0)))
10
+ site = Pathname.new(ARGV.fetch(1)).realpath
11
+ origin = URI(config.fetch("url"))
12
+ base = config.fetch("baseurl", "").sub(%r{/$}, "")
13
+ hosts = [origin.host, "lutaml.github.io"]
14
+ checked = Set.new
15
+ errors = []
16
+
17
+ site.glob("**/*.html").each do |file|
18
+ File.read(file).scan(/\b(?:href|src)=["']([^"']+)["']/).flatten.each do |value|
19
+ uri = URI(CGI.unescapeHTML(value))
20
+ own_url = %w[http https].include?(uri.scheme) && hosts.include?(uri.host)
21
+ local_url = uri.scheme.nil? && uri.host.nil?
22
+ next unless own_url || local_url
23
+
24
+ if local_url && uri.path.start_with?("/") && !base.empty? &&
25
+ uri.path != base && !uri.path.start_with?("#{base}/")
26
+ errors << "#{file.relative_path_from(site)}: #{value} is outside baseurl #{base}"
27
+ next
28
+ end
29
+
30
+ if own_url || uri.path.start_with?("/")
31
+ next if own_url && uri.path != base && !uri.path.start_with?("#{base}/")
32
+ path = URI::DEFAULT_PARSER.unescape(uri.path.delete_prefix(base)).sub(%r{^/}, "")
33
+ target = site.join(path).cleanpath
34
+ else
35
+ target = uri.path.empty? ? file : file.dirname.join(URI::DEFAULT_PARSER.unescape(uri.path)).cleanpath
36
+ end
37
+ target = target.join("index.html") if target.directory?
38
+ key = "#{target}##{uri.fragment}"
39
+ next unless checked.add?(key)
40
+
41
+ if !target.to_s.start_with?("#{site}/") || !target.file? || !target.realpath.to_s.start_with?("#{site}/")
42
+ errors << "#{file.relative_path_from(site)}: #{value} has no built target"
43
+ elsif uri.fragment && !uri.fragment.empty?
44
+ anchors = File.read(target).scan(/\b(?:id|name)=["']([^"']+)["']/).flatten
45
+ fragment = URI::DEFAULT_PARSER.unescape(uri.fragment)
46
+ errors << "#{file.relative_path_from(site)}: #{value} has no built anchor" unless anchors.include?(fragment)
47
+ end
48
+ rescue URI::InvalidURIError
49
+ errors << "#{file.relative_path_from(site)}: invalid URL #{value}"
50
+ end
51
+ end
52
+ abort "No site URLs found in #{site}" if checked.empty?
53
+ abort errors.join("\n") unless errors.empty?
54
+ puts "Verified #{checked.size} built local/canonical targets and anchors"
@@ -0,0 +1,64 @@
1
+ """Probe the exact vendor homepage without treating arbitrary 403s as success."""
2
+ import sys
3
+ import urllib.error
4
+ import urllib.request
5
+
6
+ VENDOR_URL = "https://sparxsystems.com/"
7
+
8
+
9
+ def classify(url, status, headers):
10
+ if url != VENDOR_URL:
11
+ raise ValueError("Unexpected vendor URL or redirect target")
12
+ if 200 <= status < 300:
13
+ return "reachable"
14
+ normalized = {key.lower(): value.strip().lower() for key, value in headers.items()}
15
+ if status == 403 and normalized.get("cf-mitigated") == "challenge":
16
+ return "automated access blocked; availability unverified"
17
+ raise ValueError(f"Vendor link returned unaccepted HTTP {status}")
18
+
19
+
20
+ class NoRedirect(urllib.request.HTTPRedirectHandler):
21
+ def redirect_request(self, request, fp, code, message, headers, new_url):
22
+ return None
23
+
24
+
25
+ def self_test():
26
+ assert classify(VENDOR_URL, 200, {}) == "reachable"
27
+ assert "unverified" in classify(VENDOR_URL, 403, {"CF-Mitigated": "challenge"})
28
+ for url, status, headers in [
29
+ (VENDOR_URL, 403, {}),
30
+ (VENDOR_URL, 403, {"cf-mitigated": "other"}),
31
+ (VENDOR_URL, 404, {"cf-mitigated": "challenge"}),
32
+ ("https://unrelated.example/", 403, {"cf-mitigated": "challenge"}),
33
+ ("https://sparxsystems.com/missing", 200, {}),
34
+ (VENDOR_URL, 302, {}),
35
+ ]:
36
+ try:
37
+ classify(url, status, headers)
38
+ except ValueError:
39
+ continue
40
+ raise AssertionError((url, status, headers))
41
+ print("Vendor policy controls passed: 2 positive, 6 negative")
42
+
43
+
44
+ def probe():
45
+ opener = urllib.request.build_opener(NoRedirect())
46
+ request = urllib.request.Request(VENDOR_URL, headers={"User-Agent": "Lutaml-docs-link-check"})
47
+ try:
48
+ response = opener.open(request, timeout=30)
49
+ except urllib.error.HTTPError as response:
50
+ result = classify(response.geturl(), response.code, response.headers)
51
+ else:
52
+ with response:
53
+ result = classify(response.geturl(), response.status, response.headers)
54
+ if "unverified" in result:
55
+ print(f"::notice title=Vendor link availability::{VENDOR_URL}: {result}")
56
+ else:
57
+ print(f"Verified vendor homepage: {VENDOR_URL}")
58
+
59
+
60
+ if __name__ == "__main__":
61
+ try:
62
+ self_test() if sys.argv[1:] == ["--self-test"] else probe()
63
+ except (ValueError, OSError, urllib.error.URLError) as error:
64
+ sys.exit(str(error))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.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: 2026-09-29 00:00:00.000000000 Z
11
+ date: 2026-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: expressir
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.0
61
+ version: 0.8.156
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.8.0
68
+ version: 0.8.156
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: lutaml-uml
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -115,29 +115,49 @@ files:
115
115
  - docs/README.md
116
116
  - docs/REFACTOR_PLAN.md
117
117
  - docs/_config.yml
118
+ - docs/_guides/cli-usage.adoc
118
119
  - docs/_guides/diagram-generation.adoc
119
120
  - docs/_guides/index.adoc
120
121
  - docs/_guides/parsing/express-parsing.adoc
121
122
  - docs/_guides/parsing/index.adoc
123
+ - docs/_guides/parsing/qea-parsing.adoc
122
124
  - docs/_guides/parsing/xmi-parsing.adoc
125
+ - docs/_guides/repository-management.adoc
123
126
  - docs/_guides/sysml-modeling.adoc
124
127
  - docs/_guides/uml-modeling.adoc
125
128
  - docs/_pages/concepts/diagram-generation.adoc
126
129
  - docs/_pages/concepts/lur-format.adoc
127
130
  - docs/_pages/concepts/qea-parsing.adoc
131
+ - docs/_pages/concepts/uml-models.adoc
128
132
  - docs/_pages/core/architecture.adoc
129
133
  - docs/_pages/core/installation.adoc
130
134
  - docs/_pages/core/overview.adoc
131
135
  - docs/_pages/index.adoc
132
136
  - docs/_pages/uml-syntax.adoc
137
+ - docs/_references/api/parsers.adoc
138
+ - docs/_references/api/presenters.adoc
139
+ - docs/_references/api/repository.adoc
140
+ - docs/_references/cli/commands.adoc
133
141
  - docs/_references/configuration/diagram-styles.adoc
134
142
  - docs/_references/configuration/index.adoc
135
143
  - docs/_references/configuration/package-metadata.adoc
136
144
  - docs/_references/formats/index.adoc
145
+ - docs/_references/formats/lur-format.adoc
137
146
  - docs/_references/formats/lutaml-syntax.adoc
138
147
  - docs/_references/formats/qea-structure.adoc
139
148
  - docs/_references/index.adoc
149
+ - docs/_tutorials/documentation-site.adoc
150
+ - docs/_tutorials/first-lur-package.adoc
151
+ - docs/_tutorials/generating-diagrams.adoc
152
+ - docs/_tutorials/getting-started.adoc
140
153
  - docs/_tutorials/index.adoc
154
+ - docs/_tutorials/querying-models.adoc
155
+ - docs/examples/build_package.rb
156
+ - docs/examples/build_site.rb
157
+ - docs/examples/city_model.rb
158
+ - docs/examples/present_class.rb
159
+ - docs/examples/query_model.rb
160
+ - docs/examples/render_diagram.rb
141
161
  - docs/index.adoc
142
162
  - docs/lychee.toml
143
163
  - lib/lutaml.rb
@@ -146,6 +166,8 @@ files:
146
166
  - lib/lutaml/version.rb
147
167
  - lutaml.gemspec
148
168
  - plateau_all_packages.lur
169
+ - scripts/check-site-urls.rb
170
+ - scripts/check-vendor-link.py
149
171
  homepage: https://github.com/lutaml/lutaml
150
172
  licenses:
151
173
  - MIT