yard-rustdoc 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yard-rustdoc/handlers.rb +1 -1
- data/lib/yard-rustdoc/statements.rb +14 -1
- data/lib/yard-rustdoc/version.rb +1 -1
- data/lib/yard-rustdoc.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58b78b33712ec60e0a4489d201732d967599faf5dfc194cd370de1c2c4a556b2
|
4
|
+
data.tar.gz: bb346446018a4405f9778bac7d6c6d321e73d9b4b397e36d30f889574dfae9c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ffe5bd2255f7ed7d6fa3e493760b2d7b347bf917398323b2a699b0197d3af123ecbc864161f3d6598ed2b3dc250ce2b3b64508f22782f66fa40f00f5fb44fe4
|
7
|
+
data.tar.gz: d0dd9782942934d8dbffbb195a149ddf346566f61189bb1fc59c40096270d3a5dab5a8ea12efb061c43ca6a57e119be45575758323826e69384b65cfeb59122e
|
@@ -34,7 +34,7 @@ module YARD::Handlers
|
|
34
34
|
statement_class(Statements::Struct)
|
35
35
|
|
36
36
|
process do
|
37
|
-
obj =
|
37
|
+
obj = statement.code_object_class.new(:root, statement.name)
|
38
38
|
register(obj)
|
39
39
|
|
40
40
|
push_state(namespace: obj) do
|
@@ -10,7 +10,8 @@ module YARD::Parser::Rustdoc
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def docstring
|
13
|
-
@
|
13
|
+
@docstring ||= rust_docstring
|
14
|
+
.gsub(/^\s*@yard\s*\n/m, "") # remove @yard line
|
14
15
|
end
|
15
16
|
|
16
17
|
def source
|
@@ -79,6 +80,18 @@ module YARD::Parser::Rustdoc
|
|
79
80
|
# Fallback to the struct's name
|
80
81
|
@rustdoc.fetch("name")
|
81
82
|
end
|
83
|
+
|
84
|
+
def code_object_class
|
85
|
+
if rust_docstring.match?(/^@module\b/)
|
86
|
+
YARD::CodeObjects::ModuleObject
|
87
|
+
else
|
88
|
+
YARD::CodeObjects::ClassObject
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def rust_docstring
|
93
|
+
@rustdoc.fetch("docs")
|
94
|
+
end
|
82
95
|
end
|
83
96
|
|
84
97
|
class Method < Base
|
data/lib/yard-rustdoc/version.rb
CHANGED
data/lib/yard-rustdoc.rb
CHANGED
@@ -15,4 +15,5 @@ module YARD
|
|
15
15
|
Tags::Library.define_tag("Tagging docblock for yard", :yard)
|
16
16
|
Tags::Library.define_tag("Renaming class & methods", :rename)
|
17
17
|
Tags::Library.define_tag("Specify a method name and args", :def)
|
18
|
+
Tags::Library.define_tag("Specify that a Struct should be a module (instead of class)", :module)
|
18
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-rustdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Bourassa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '5.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '5.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|