markdown_ruby_documentation 0.21.2 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02c84572f9faa898b291c1a78d07365a2fc7fdaa
|
4
|
+
data.tar.gz: 190f670308fb4a9de7ee641aa78a1fd428e63bab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aca3be20490229c8a6351b1b639787c9ec12c02eccbf91cb08e71f760210f04773a57bec7a4e2dfab4af424531e38fa2ecff0df7a3c5a2a702d485d8e59c2ca0
|
7
|
+
data.tar.gz: a6ba7cb14f17136e43282812d65f5ee66023f88fa6a6ca6332adac198ea5b8f6468e070e75723a07b1dc559a18b0d01ac27ed68da13e4761341b78743c7a4820
|
@@ -40,28 +40,34 @@ module MarkdownRubyDocumentation
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def instances_methods
|
43
|
-
@instance_methods ||=
|
44
|
-
@instance_methods.map do |name, hash|
|
45
|
-
%[## #{name.to_s.titleize}\n#{hash[:text]}] unless hash[:text].blank?
|
46
|
-
end.join("\n\n")
|
43
|
+
@instance_methods ||= method_presenters("MarkdownRubyDocumentation::InstanceMethod")
|
47
44
|
end
|
48
45
|
|
49
46
|
def class_methods
|
50
|
-
@class_methods ||=
|
51
|
-
@class_methods.map do |name, hash|
|
52
|
-
%[## #{name.to_s.titleize}\n#{hash[:text]}] unless hash[:text].blank?
|
53
|
-
end.join("\n\n")
|
47
|
+
@class_methods ||= method_presenters("MarkdownRubyDocumentation::ClassMethod")
|
54
48
|
end
|
55
49
|
|
56
50
|
def null_methods
|
57
|
-
@null_methods ||=
|
58
|
-
|
59
|
-
|
51
|
+
@null_methods ||= begin
|
52
|
+
md = method_presenters("MarkdownRubyDocumentation::NullMethod", "###")
|
53
|
+
if md.blank?
|
54
|
+
""
|
55
|
+
else
|
56
|
+
"\n## Reference Values\n" << md
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def method_presenters(type, heading="##")
|
62
|
+
type_methods = item_types.delete(type) || []
|
63
|
+
order_by_location(type_methods).map do |(name, hash)|
|
64
|
+
%[#{heading} #{name.to_s.titleize}\n#{hash[:text]}] unless hash[:text].blank?
|
60
65
|
end.join("\n\n")
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
66
|
+
end
|
67
|
+
|
68
|
+
def order_by_location(items)
|
69
|
+
items.sort_by do |(_, hash)|
|
70
|
+
hash[:method_object].source_location
|
65
71
|
end
|
66
72
|
end
|
67
73
|
|