yard-markdown 0.3.0 → 0.3.2
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
- data/example/Bird.md +19 -17
- data/example/Duck.md +27 -17
- data/example/Waterfowl.md +10 -7
- data/templates/default/fulldoc/markdown/setup.rb +25 -35
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6a31bd0b9314cb81e288f61c6f923ad3b8b5708ae1776ca0728fc9e0e8b3a07
|
4
|
+
data.tar.gz: 83f19bcda05228295f943c1cb09cde16dc6738c60e96a7194eade9f15597c17e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e4d2ecd151a91ba5085d86f398f592c71d2d0744f46487bb07969190f8070acdeb15841325dff7a8c1b96e651fbf375a4cb3c358b5032b1734cbcc8b988c7e8
|
7
|
+
data.tar.gz: 1713b22f373b5fc163202d2e51b9c6ff3fe4f502facba94eaa37e77874ae2222f6e3e9dd5f16e6630210870528fc68cfbd86956d2bb8da6bd8b16cb4efef3724
|
data/example/Bird.md
CHANGED
@@ -1,19 +1,14 @@
|
|
1
1
|
# Class: Bird
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
| **Defined in:** | example.rb |
|
2
|
+
**Inherits:** Object
|
3
|
+
|
4
|
+
**Defined in:** example.rb
|
6
5
|
|
7
6
|
The base class for all birds.
|
8
|
-
# Constants
|
9
|
-
## DEFAULT_DUCK_VELOCITY [](#constant-DEFAULT_DUCK_VELOCITY)
|
10
|
-
Default velocity for a flying duck.
|
11
|
-
## DEFAULT_SPEED [](#constant-DEFAULT_SPEED)
|
12
|
-
Maximum speed for a swimming duck.
|
13
7
|
|
14
8
|
# Public Instance Methods
|
15
9
|
## _fly_impl(_direction, _velocity) [](#method-i-_fly_impl)
|
16
10
|
:nodoc:
|
11
|
+
|
17
12
|
## fly(direction, velocity) [](#method-i-fly)
|
18
13
|
Fly somewhere.
|
19
14
|
|
@@ -22,15 +17,22 @@ Flying is the most critical feature of birds.
|
|
22
17
|
:args: direction, velocity
|
23
18
|
|
24
19
|
:call-seq:
|
25
|
-
|
26
|
-
|
20
|
+
Bird.fly(symbol, number) -> bool
|
21
|
+
Bird.fly(string, number) -> bool
|
27
22
|
|
28
|
-
|
23
|
+
# Example
|
24
|
+
|
25
|
+
fly(:south, 70)
|
29
26
|
|
30
|
-
fly(:south, 70)
|
31
27
|
## speak() [](#method-i-speak)
|
32
|
-
Produce some noise.
|
33
|
-
|
34
|
-
|
35
|
-
|
28
|
+
Produce some noise. -- FIXME: maybe extract this to a base class `Animal`? ++
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
# Constants
|
33
|
+
## DEFAULT_DUCK_VELOCITY [](#constant-DEFAULT_DUCK_VELOCITY)
|
34
|
+
Default velocity for a flying duck.
|
35
|
+
|
36
|
+
## DEFAULT_SPEED [](#constant-DEFAULT_SPEED)
|
37
|
+
Maximum speed for a swimming duck.
|
36
38
|
|
data/example/Duck.md
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
# Class: Duck
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
**Inherits:** Object
|
3
|
+
|
4
|
+
**Extended by:** Animal
|
5
|
+
|
6
|
+
**Includes:** Waterfowl
|
7
|
+
|
8
|
+
**Defined in:** example.rb
|
8
9
|
|
9
10
|
A duck is a Waterfowl Bird.
|
10
11
|
|
11
12
|
Features:
|
12
13
|
|
13
|
-
|
14
|
+
bird::
|
14
15
|
|
15
|
-
|
16
|
-
|
16
|
+
* speak
|
17
|
+
* fly
|
17
18
|
|
18
|
-
|
19
|
+
waterfowl::
|
19
20
|
|
20
|
-
|
21
|
-
# Constants
|
22
|
-
## DEFAULT_DUCK_VELOCITY [](#constant-DEFAULT_DUCK_VELOCITY)
|
23
|
-
Default velocity for a flying duck.
|
24
|
-
## DEFAULT_SPEED [](#constant-DEFAULT_SPEED)
|
25
|
-
Maximum speed for a swimming duck.
|
21
|
+
* swim
|
26
22
|
|
27
23
|
# Public Instance Methods
|
28
24
|
## initialize(domestic, rubber) [](#method-i-initialize)
|
29
25
|
Creates a new duck.
|
26
|
+
|
30
27
|
## speak() [](#method-i-speak)
|
31
28
|
Duck overrides generic implementation.
|
29
|
+
|
32
30
|
## swim() [](#method-i-swim)
|
33
31
|
Swimming helper.
|
32
|
+
|
34
33
|
## useful?() [](#method-i-useful?)
|
35
34
|
Checks if this duck is a useful one.
|
36
35
|
|
37
36
|
:call-seq:
|
38
|
-
|
37
|
+
Bird.useful? -> bool
|
38
|
+
|
39
39
|
|
40
40
|
# Public Class Methods
|
41
41
|
## rubber_ducks() [](#method-c-rubber_ducks)
|
@@ -43,5 +43,15 @@ Checks if this duck is a useful one.
|
|
43
43
|
# Attributes
|
44
44
|
## domestic[RW] [](#attribute-i-domestic)
|
45
45
|
True for domestic ducks.
|
46
|
+
|
46
47
|
## rubber[RW] [](#attribute-i-rubber)
|
47
48
|
True for rubber ducks.
|
49
|
+
|
50
|
+
|
51
|
+
# Constants
|
52
|
+
## DEFAULT_DUCK_VELOCITY [](#constant-DEFAULT_DUCK_VELOCITY)
|
53
|
+
Default velocity for a flying duck.
|
54
|
+
|
55
|
+
## DEFAULT_SPEED [](#constant-DEFAULT_SPEED)
|
56
|
+
Maximum speed for a swimming duck.
|
57
|
+
|
data/example/Waterfowl.md
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
# Module: Waterfowl
|
2
|
-
|
3
|
-
|
4
|
-
| **Defined in:** | example.rb |
|
2
|
+
|
3
|
+
**Defined in:** example.rb
|
5
4
|
|
6
5
|
A mixin for waterfowl creatures.
|
6
|
+
|
7
|
+
# Public Instance Methods
|
8
|
+
## swim() [](#method-i-swim)
|
9
|
+
Swimming helper.
|
10
|
+
|
11
|
+
|
12
|
+
|
7
13
|
# Constants
|
8
14
|
## DEFAULT_DUCK_VELOCITY [](#constant-DEFAULT_DUCK_VELOCITY)
|
9
15
|
Default velocity for a flying duck.
|
16
|
+
|
10
17
|
## DEFAULT_SPEED [](#constant-DEFAULT_SPEED)
|
11
18
|
Maximum speed for a swimming duck.
|
12
19
|
|
13
|
-
# Public Instance Methods
|
14
|
-
## swim() [](#method-i-swim)
|
15
|
-
Swimming helper.
|
16
|
-
|
@@ -94,61 +94,51 @@ def serialize(object)
|
|
94
94
|
template =
|
95
95
|
ERB.new(
|
96
96
|
'# <%= format_object_title object %>
|
97
|
-
| | |
|
98
|
-
| -----------------: | :----- |
|
99
97
|
<% if CodeObjects::ClassObject === object && object.superclass %>
|
100
|
-
|
101
|
-
<% end %>
|
102
|
-
<% [[:class, "Extended by"], [:instance, "Includes"]].each do |scope, name| %>
|
98
|
+
**Inherits:** <%= object.superclass %>
|
99
|
+
<% end %><% [[:class, "Extended by"], [:instance, "Includes"]].each do |scope, name| %>
|
103
100
|
<% if (mix = run_verifier(object.mixins(scope))).size > 0 %>
|
104
|
-
|
105
|
-
<% end %>
|
106
|
-
<% end %>
|
101
|
+
**<%= name %>:** <%= mix.sort_by {|o| o.path }.join(", ") %>
|
102
|
+
<% end %><% end %>
|
107
103
|
<% unless object.root? %>
|
108
|
-
|
104
|
+
**Defined in:** <%= object.file ? object.file : "(unknown)" %>
|
109
105
|
<% end %>
|
110
106
|
|
111
107
|
<%= rdoc_to_md object.docstring %>
|
112
108
|
|
113
|
-
|
114
109
|
<% if (insmeths = public_instance_methods(object)).size > 0 %>
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
110
|
+
# Public Instance Methods
|
111
|
+
<% insmeths.each do |item| %>
|
112
|
+
## <%= item.name(false) %>(<%= item.parameters.map {|p| p.join("") }.join(", ")%>) [](#<%=aref(item)%>)
|
113
|
+
<%= rdoc_to_md item.docstring %>
|
119
114
|
|
120
|
-
|
121
|
-
<% end %>
|
115
|
+
<% end %><% end %>
|
122
116
|
|
123
117
|
<% if (pubmeths = public_class_methods(object)).size > 0 %>
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
118
|
+
# Public Class Methods
|
119
|
+
<% pubmeths.each do |item| %>
|
120
|
+
## <%= item.name(false) %>(<%= item.parameters.map {|p| p.join(" ") }.join(", ") %>) [](#<%=aref(item)%>)
|
121
|
+
<%= rdoc_to_md item.docstring %>
|
128
122
|
|
129
|
-
|
123
|
+
<% end %>
|
130
124
|
<% end %>
|
131
125
|
<% if (attrs = attr_listing(object)).size > 0 %>
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
126
|
+
# Attributes
|
127
|
+
<% attrs.each do |item|%>
|
128
|
+
## <%= item.name %><%= item.reader? ? "[RW]" : "[R]" %> [](#<%=aref(item)%>)
|
129
|
+
<%= rdoc_to_md item.docstring %>
|
136
130
|
|
137
|
-
<% end %>
|
138
131
|
<% end %>
|
139
|
-
|
132
|
+
<% end %>
|
140
133
|
|
141
134
|
<% if constant_listing.size > 0 %>
|
142
135
|
<% groups(constant_listing, "Constants") do |list, name| %>
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
136
|
+
# <%= name %>
|
137
|
+
<% list.each do |cnst| %>
|
138
|
+
## <%= cnst.name %> [](#<%=aref(cnst)%>)
|
139
|
+
<%= rdoc_to_md cnst.docstring %>
|
147
140
|
|
148
|
-
|
149
|
-
<% end %>
|
150
|
-
<% end %>
|
151
|
-
', trim_mode: "%<>")
|
141
|
+
<% end %><% end %><% end %>', trim_mode: "<>")
|
152
142
|
|
153
143
|
template.result(binding)
|
154
144
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanislav (Stas) Katkov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
|
-
rubygems_version: 3.5.
|
69
|
+
rubygems_version: 3.5.5
|
70
70
|
signing_key:
|
71
71
|
specification_version: 4
|
72
72
|
summary: yard plugin to generate markdown documentation
|