utopia-project 0.34.0 → 0.34.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bake/utopia/project/agent/context.rb +23 -12
- data/bake/utopia/project/readme/update.rb +4 -14
- data/context/index.yaml +9 -6
- data/lib/utopia/project/base.rb +14 -0
- data/lib/utopia/project/guide.rb +25 -0
- data/lib/utopia/project/version.rb +1 -1
- data/readme.md +4 -0
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6d7813076feeeb716ee8b2fed2db46d2d5522d63ef443632687aec95be009f9
|
4
|
+
data.tar.gz: a77ff26f76a698e3d9c90b86270a4ee9fefeecd6108e9bade9c5d603ffe38081
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33e47b9495910bd0e04b7b3f35f05f06de0e02c827dcb2c08cc8619b81b70e9986b288f4014a3c5fa544b38c97a21e3373287f49881ad67cedd868353b4e91cf
|
7
|
+
data.tar.gz: aad59c90eb1f6556f6332f42afab40bc81031f2414df7fe83231a9bdb71fe2de7f6a4491aec52b53ab225049732c3d7cd0f92722ae4813331bebc29385c2be3c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -14,28 +14,39 @@ def update
|
|
14
14
|
project = Utopia::Project::Base.new(context.root)
|
15
15
|
|
16
16
|
FileUtils.mkdir_p self.context_root
|
17
|
-
|
17
|
+
files = []
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
# Sort guides by order, then by name
|
20
|
+
sorted_guides = project.guides.select(&:readme?).sort
|
21
|
+
|
22
|
+
sorted_guides.each do |guide|
|
23
|
+
FileUtils.cp guide.readme_path, self.context_path_for(guide)
|
24
|
+
files << {
|
25
|
+
"path" => guide.name + ".md",
|
26
|
+
"title" => guide.title,
|
27
|
+
"description" => guide.description.to_markdown.chomp,
|
28
|
+
}
|
28
29
|
end
|
29
30
|
|
30
|
-
if
|
31
|
+
if files.any?
|
32
|
+
# Create index in agent-context compatible format
|
33
|
+
gemspec = project.gemspec
|
34
|
+
index = {
|
35
|
+
"description" => gemspec&.summary,
|
36
|
+
"metadata" => gemspec&.metadata || {},
|
37
|
+
"files" => files,
|
38
|
+
}
|
39
|
+
|
31
40
|
File.open(self.context_index_path, "w") do |file|
|
32
41
|
file.puts "# Automatically generated context index for Utopia::Project guides."
|
33
42
|
file.puts "# Do not edit then files in this directory directly, instead edit the guides and then run `bake utopia:project:agent:context:update`."
|
34
43
|
YAML.dump(index, file)
|
35
44
|
end
|
45
|
+
|
46
|
+
return index
|
36
47
|
end
|
37
48
|
|
38
|
-
return
|
49
|
+
return nil
|
39
50
|
end
|
40
51
|
|
41
52
|
private
|
@@ -13,7 +13,7 @@ def update(path: "readme.md", documentation_url: nil)
|
|
13
13
|
project = Utopia::Project::Base.new(context.root)
|
14
14
|
readme = project.readme_document
|
15
15
|
|
16
|
-
documentation_url ||= public_documentation_url
|
16
|
+
documentation_url ||= public_documentation_url(project)
|
17
17
|
|
18
18
|
readme.replace_section("Usage") do |header|
|
19
19
|
current = header
|
@@ -42,25 +42,15 @@ private
|
|
42
42
|
|
43
43
|
Scope = Struct.new(:documentation_url, :project)
|
44
44
|
|
45
|
-
def gemspec_path
|
46
|
-
Dir.glob("*.gemspec", base: context.root).first
|
47
|
-
end
|
48
|
-
|
49
|
-
def gemspec
|
50
|
-
if gemspec_path = self.gemspec_path
|
51
|
-
@gemspec ||= ::Gem::Specification.load(gemspec_path)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
45
|
# The public documentation URL if it can be determined.
|
56
|
-
def public_documentation_url
|
57
|
-
if metadata = gemspec
|
46
|
+
def public_documentation_url(project)
|
47
|
+
if metadata = project.gemspec&.metadata
|
58
48
|
if documentation_uri = metadata["documentation_uri"]
|
59
49
|
return documentation_uri
|
60
50
|
end
|
61
51
|
end
|
62
52
|
|
63
|
-
return gemspec&.homepage
|
53
|
+
return project.gemspec&.homepage
|
64
54
|
end
|
65
55
|
|
66
56
|
def usage_section(documentation_url, project)
|
data/context/index.yaml
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
# Automatically generated context index for Utopia::Project guides.
|
2
2
|
# Do not edit then files in this directory directly, instead edit the guides and then run `bake utopia:project:agent:context:update`.
|
3
3
|
---
|
4
|
-
|
4
|
+
description: A project documentation tool based on Utopia.
|
5
|
+
metadata:
|
6
|
+
documentation_uri: https://socketry.github.io/utopia-project/
|
7
|
+
funding_uri: https://github.com/sponsors/ioquatix/
|
8
|
+
source_code_uri: https://github.com/socketry/utopia-project/
|
9
|
+
files:
|
10
|
+
- path: getting-started.md
|
5
11
|
title: Getting Started
|
6
|
-
order: 1
|
7
12
|
description: This guide explains how to use `utopia-project` for your own project.
|
8
|
-
documentation-formatting
|
13
|
+
- path: documentation-formatting.md
|
9
14
|
title: Documentation Formatting
|
10
|
-
order: 2
|
11
15
|
description: This guide explains the conventions used by `utopia-project` when generating
|
12
16
|
documentation for your project.
|
13
|
-
github-pages-integration
|
17
|
+
- path: github-pages-integration.md
|
14
18
|
title: GitHub Pages Integration
|
15
|
-
order: 3
|
16
19
|
description: This guide shows you how to use `utopia-project` with GitHub Pages.
|
data/lib/utopia/project/base.rb
CHANGED
@@ -203,6 +203,20 @@ module Utopia
|
|
203
203
|
releases_document.releases
|
204
204
|
end
|
205
205
|
end
|
206
|
+
|
207
|
+
# Get the path to the gemspec file for this project.
|
208
|
+
# @returns [String | nil] The relative path to the gemspec file, or nil if not found.
|
209
|
+
private def gemspec_path
|
210
|
+
Dir.glob("*.gemspec", base: @root).first
|
211
|
+
end
|
212
|
+
|
213
|
+
# Load and return the gemspec for this project.
|
214
|
+
# @returns [Gem::Specification | nil] The loaded gemspec, or nil if not found.
|
215
|
+
def gemspec
|
216
|
+
if gemspec_path = self.gemspec_path
|
217
|
+
@gemspec ||= ::Gem::Specification.load(File.join(@root, gemspec_path))
|
218
|
+
end
|
219
|
+
end
|
206
220
|
end
|
207
221
|
end
|
208
222
|
end
|
data/lib/utopia/project/guide.rb
CHANGED
@@ -40,6 +40,31 @@ module Utopia
|
|
40
40
|
metadata[:order]
|
41
41
|
end
|
42
42
|
|
43
|
+
def <=> other
|
44
|
+
if order = self.order
|
45
|
+
if other_order = other.order
|
46
|
+
if order < other_order
|
47
|
+
return -1
|
48
|
+
elsif order > other_order
|
49
|
+
return 1
|
50
|
+
end
|
51
|
+
else
|
52
|
+
# If we have order, but the other doesn't, we come first:
|
53
|
+
return -1
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
if name = self.name
|
58
|
+
if other_name = other.name
|
59
|
+
return name <=> other_name
|
60
|
+
else
|
61
|
+
return -1
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
return 0
|
66
|
+
end
|
67
|
+
|
43
68
|
README = "readme.md"
|
44
69
|
|
45
70
|
# The path to the README file for the guide.
|
data/readme.md
CHANGED
@@ -31,6 +31,10 @@ Please see the [project documentation](https://socketry.github.io/utopia-project
|
|
31
31
|
|
32
32
|
Please see the [project releases](https://socketry.github.io/utopia-project/releases/index) for all releases.
|
33
33
|
|
34
|
+
### v0.34.1
|
35
|
+
|
36
|
+
- Fix schema for `index.yaml` context file.
|
37
|
+
|
34
38
|
### v0.34.0
|
35
39
|
|
36
40
|
- Introduce `bake utopia:project:agent:context:update` command to update the agent context from the guides in the project.
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|