utopia-project 0.42.0 → 0.43.0

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: 48f72fdf878294e638e5053f5b0e4cdc19e5d1ee28aa1c51732a1ec467c9a9cb
4
- data.tar.gz: bfb6d2e71535e496d6f1c42db8a89be441bfc33a881e8e49d00e6bdaea19df00
3
+ metadata.gz: 4e03635789e50ada548501b8220d49ae33e6ee4ec89aa993cddb358d7a8efc30
4
+ data.tar.gz: a97fb27c10530e9d5cd66d4caae0c173eb5f40b72dd48d2a92d35fd52e1b12a7
5
5
  SHA512:
6
- metadata.gz: e2fecc25e48c3573d61fec6db7a8ca9120b6b3580f62a8e7a249b1012b5ba1c88f341831bcb65409af6c1df82512f63fdcd56704ef7e6c5396d38bda110c5196
7
- data.tar.gz: e1b11e6f7566973149e116bc0cf8f1c886d269c0d116e1f8e4b2eb357367abc7208adea969db77cb35d399b0f8016e93908fe65867dee8bcaa747851680dab80
6
+ metadata.gz: 38468ed82c56f4048427dd94d7f687d5a45c978d7f398e3033483cfdcb9689c78e23a5b6c4cbefc8d1ae65fb9d62ae06fa05d0c85cdf21721fe5bde350ab5f68
7
+ data.tar.gz: 6035c40a3578098292f084f63614c3bac24ac396774466b8c649ac7770b745d74b0e75676bb4d1d03555a888f65efe2008e2d8790da9e0e67ca0463b35dd5341
checksums.yaml.gz.sig CHANGED
Binary file
data/context/index.yaml CHANGED
@@ -3,9 +3,11 @@
3
3
  ---
4
4
  description: A project documentation tool based on Utopia.
5
5
  metadata:
6
+ bug_tracker_uri: https://github.com/socketry/utopia-project/issues
7
+ changelog_uri: https://github.com/socketry/utopia-project/blob/main/releases.md
6
8
  documentation_uri: https://socketry.github.io/utopia-project/
7
9
  funding_uri: https://github.com/sponsors/ioquatix/
8
- source_code_uri: https://github.com/socketry/utopia-project/
10
+ source_code_uri: https://github.com/socketry/utopia-project.git
9
11
  files:
10
12
  - path: getting-started.md
11
13
  title: Getting Started
@@ -13,8 +13,8 @@ module Utopia
13
13
  # A method inherited from another definition.
14
14
  Method = Struct.new(:name, :definition)
15
15
 
16
- # A group of inherited methods with the same origin.
17
- Group = Struct.new(:definition, :methods)
16
+ # Methods inherited through a direct relationship.
17
+ Group = Struct.new(:kind, :definition, :methods)
18
18
 
19
19
  # Initialize inheritance resolution for the given definition.
20
20
  # @parameter index [Decode::Index] The index used to resolve relationships.
@@ -55,10 +55,10 @@ module Utopia
55
55
  end
56
56
 
57
57
  # Enumerate documented public and protected methods inherited by the definition.
58
- # @returns [Array(Group)] Methods grouped by the definition which provides them.
58
+ # @returns [Array(Group)] Methods grouped by the direct relationship which provides them.
59
59
  def inherited_methods
60
60
  @groups = []
61
- @groups_by_definition = {}
61
+ @groups_by_relationship = {}
62
62
 
63
63
  collect_instance_methods(@definition, false, {}, {})
64
64
  collect_class_methods(@definition, false, {}, {})
@@ -113,46 +113,46 @@ module Utopia
113
113
  end
114
114
  end
115
115
 
116
- def collect_instance_methods(definition, include_own, seen, visited, display_prefix = "#")
116
+ def collect_instance_methods(definition, include_own, seen, visited, display_prefix: "#", kind: nil, provider: nil)
117
117
  key = [definition.qualified_name, display_prefix]
118
118
  return if visited[key]
119
119
  visited[key] = true
120
120
 
121
121
  relationship_definitions(definition, :prepends).reverse_each do |relationship|
122
- collect_instance_methods(relationship, true, seen, visited, display_prefix)
122
+ collect_instance_methods(relationship, true, seen, visited, display_prefix: display_prefix, kind: kind || :prepend, provider: provider || relationship)
123
123
  end
124
124
 
125
- collect_methods(definition, "#", display_prefix, include_own, seen)
125
+ collect_methods(definition, "#", display_prefix, include_own, seen, kind: kind, provider: provider)
126
126
 
127
127
  relationship_definitions(definition, :includes).reverse_each do |relationship|
128
- collect_instance_methods(relationship, true, seen, visited, display_prefix)
128
+ collect_instance_methods(relationship, true, seen, visited, display_prefix: display_prefix, kind: kind || :include, provider: provider || relationship)
129
129
  end
130
130
 
131
131
  if display_prefix == "#" && (super_class = super_class_for(definition))
132
- collect_instance_methods(super_class, true, seen, visited, display_prefix)
132
+ collect_instance_methods(super_class, true, seen, visited, display_prefix: display_prefix, kind: kind || :super_class, provider: provider || super_class)
133
133
  end
134
134
  end
135
135
 
136
- def collect_class_methods(definition, include_own, seen, visited)
136
+ def collect_class_methods(definition, include_own, seen, visited, kind: nil, provider: nil)
137
137
  key = definition.qualified_name
138
138
  return if visited[key]
139
139
  visited[key] = true
140
140
 
141
- collect_methods(definition, ".", ".", include_own, seen)
141
+ collect_methods(definition, ".", ".", include_own, seen, kind: kind, provider: provider)
142
142
  if singleton = singleton_for(definition)
143
- collect_methods(singleton, "#", ".", include_own, seen, definition)
143
+ collect_methods(singleton, "#", ".", include_own, seen, kind: kind, provider: provider)
144
144
  end
145
145
 
146
146
  relationship_definitions(definition, :extends).reverse_each do |relationship|
147
- collect_instance_methods(relationship, true, seen, {}, ".")
147
+ collect_instance_methods(relationship, true, seen, {}, display_prefix: ".", kind: kind || :extend, provider: provider || relationship)
148
148
  end
149
149
 
150
150
  if super_class = super_class_for(definition)
151
- collect_class_methods(super_class, true, seen, visited)
151
+ collect_class_methods(super_class, true, seen, visited, kind: kind || :super_class, provider: provider || super_class)
152
152
  end
153
153
  end
154
154
 
155
- def collect_methods(definition, source_prefix, display_prefix, include_own, seen, origin = definition)
155
+ def collect_methods(definition, source_prefix, display_prefix, include_own, seen, kind:, provider:)
156
156
  methods_for(definition, source_prefix).each do |method|
157
157
  name = "#{display_prefix}#{method.name}"
158
158
  next if seen[name]
@@ -168,13 +168,14 @@ module Utopia
168
168
  next unless method.documented?
169
169
  next if method.respond_to?(:private?) && method.private?
170
170
 
171
- add_method(origin, name, method)
171
+ add_method(kind, provider, name, method)
172
172
  end
173
173
  end
174
174
 
175
- def add_method(definition, name, method)
176
- group = @groups_by_definition[definition.qualified_name] ||= begin
177
- group = Group.new(definition, [])
175
+ def add_method(kind, provider, name, method)
176
+ key = [kind, provider.qualified_name]
177
+ group = @groups_by_relationship[key] ||= begin
178
+ group = Group.new(kind, provider, [])
178
179
  @groups << group
179
180
  group
180
181
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2025, by Samuel Williams.
4
+ # Copyright, 2020-2026, by Samuel Williams.
5
5
 
6
6
  module Utopia
7
7
  module Project
8
- VERSION = "0.42.0"
8
+ VERSION = "0.43.0"
9
9
  end
10
10
  end
data/pages/_header.xnode CHANGED
@@ -12,7 +12,7 @@
12
12
  ?><a href="#{link.href}" class="#{active ? 'active' : nil}" aria-current="#{active ? 'page' : 'false'}">#{link.title}</a><?r
13
13
  end ?>
14
14
  <?r if github_url = base.source_code_uri ?>
15
- <a href="#{github_url}" class="github" target="_blank" rel="noopener noreferrer" aria-label="View source on GitHub">GitHub <span aria-hidden="true">↗</span></a>
15
+ <a href="#{github_url}" class="github" target="_blank" rel="noopener noreferrer" aria-label="View source on GitHub">GitHub</a>
16
16
  <?r end ?>
17
17
  </div>
18
18
  <div class="header-actions">
@@ -2,8 +2,9 @@
2
2
  base = self[:base]
3
3
  symbol = self[:symbol]
4
4
  link = self[:link]
5
+ inheritance = self[:inheritance] != false
5
6
 
6
- if symbol.respond_to?(:super_class)
7
+ if inheritance && symbol.respond_to?(:super_class)
7
8
  super_class = symbol.super_class
8
9
  end
9
10
 
@@ -5,6 +5,9 @@ inheritance = base.inheritance_for(symbol)
5
5
 
6
6
  relationships = inheritance.relationships
7
7
  inherited_methods = inheritance.inherited_methods
8
+ inherited_methods_by_relationship = inherited_methods.to_h do |group|
9
+ [[group.kind, group.definition.qualified_name], group.methods]
10
+ end
8
11
 
9
12
  relationship_labels = {
10
13
  super_class: "Inherits from",
@@ -14,32 +17,35 @@ relationship_labels = {
14
17
  }
15
18
  ?>
16
19
  <?r if relationships.any? ?>
17
- <dl class="relationships"><?r
20
+ <dl class="relationships" data-pagefind-ignore><?r
18
21
  relationships.group_by(&:kind).each do |kind, entries|
19
22
  ?><dt>#{relationship_labels.fetch(kind)}</dt>
20
23
  <dd><?r
21
24
  entries.each_with_index do |relationship, index|
22
25
  if index > 0
23
- ?>, <?r
26
+ ?>; <?r
24
27
  end
25
28
 
26
29
  ?>#{base.linkify(relationship.name, symbol)}<?r
30
+
31
+ methods = if relationship.definition
32
+ key = [kind, relationship.definition.qualified_name]
33
+ inherited_methods_by_relationship[key]
34
+ end
35
+
36
+ if methods&.any?
37
+ ?><code>: <?r
38
+ methods.each_with_index do |method, method_index|
39
+ if method_index > 0
40
+ ?>, <?r
41
+ end
42
+
43
+ ?><a href="#{base.link_for(method.definition)}">#{method.name}</a><?r
44
+ end
45
+ ?></code><?r
46
+ end
27
47
  end
28
48
  ?></dd><?r
29
49
  end
30
50
  ?></dl>
31
51
  <?r end ?>
32
-
33
- <?r if inherited_methods.any? ?>
34
- <section>
35
- <h2>Inherited Methods</h2><?r
36
- inherited_methods.each do |group|
37
- ?><p>From <a href="#{base.link_for(group.definition)}"><code>#{group.definition.qualified_name}</code></a>:</p>
38
- <ul class="index"><?r
39
- group.methods.each do |method|
40
- ?><li><a href="#{base.link_for(method.definition)}"><code>#{method.name}</code></a></li><?r
41
- end
42
- ?></ul><?r
43
- end
44
- ?></section>
45
- <?r end ?>
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2025, by Samuel Williams.
4
+ # Copyright, 2020-2026, by Samuel Williams.
5
5
 
6
6
  prepend Actions
7
7
 
@@ -30,7 +30,7 @@
30
30
  if nested.any?
31
31
  ?>
32
32
  <section>
33
- <h2>Classes and Modules</h2>
33
+ <h2>Nested Classes and Modules</h2>
34
34
 
35
35
  <dl class="nested-definitions">
36
36
  <?r nested.each do |symbol|
@@ -40,7 +40,7 @@
40
40
  end
41
41
  ?>
42
42
  <div>
43
- <dt>#{partial 'content:declaration', symbol: symbol, link: true}</dt>
43
+ <dt>#{partial 'content:declaration', symbol: symbol, link: true, inheritance: false}</dt>
44
44
  <dd><?r unless description&.empty? ?>#{base.format(description, symbol)}<?r end ?></dd>
45
45
  </div>
46
46
  <?r end ?>
@@ -170,10 +170,6 @@ header .sections .github {
170
170
  opacity: 0.7;
171
171
  }
172
172
 
173
- header .sections .github span {
174
- font-size: 0.85em;
175
- }
176
-
177
173
  header .sections .github:hover {
178
174
  opacity: 1;
179
175
  }
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.42.0
4
+ version: 0.43.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -378,13 +378,15 @@ files:
378
378
  - template/config/serve.rb
379
379
  - template/gems.rb
380
380
  - template/preload.rb
381
- homepage: https://socketry.github.io/utopia-project
381
+ homepage: https://github.com/socketry/utopia-project
382
382
  licenses:
383
383
  - MIT
384
384
  metadata:
385
+ bug_tracker_uri: https://github.com/socketry/utopia-project/issues
386
+ changelog_uri: https://github.com/socketry/utopia-project/blob/main/releases.md
385
387
  documentation_uri: https://socketry.github.io/utopia-project/
386
388
  funding_uri: https://github.com/sponsors/ioquatix/
387
- source_code_uri: https://github.com/socketry/utopia-project/
389
+ source_code_uri: https://github.com/socketry/utopia-project.git
388
390
  rdoc_options: []
389
391
  require_paths:
390
392
  - lib
metadata.gz.sig CHANGED
Binary file