yard-readme 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -2
- data/Gemfile.lock +2 -2
- data/lib/yard-readme/docstring_parser.rb +19 -1
- data/lib/yard-readme/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8fcf73f1ebef0ac81488b0ee0a04eba51bcc228e9ba8a6e414b444bc19a6335
|
4
|
+
data.tar.gz: fe947ee1fc8c5fe274234e05feec1cf99238dbf20940542684ed3287289d4167
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4322e30867670192be390128fb6521de5985a70a156f9279d4419271be01e702a6e772365465bf3cf4746c7bbfbe567e410133f1ac5c4eb25c706a62ae9dbce6
|
7
|
+
data.tar.gz: 18eeae3284d48faf9195c54162a1468602f55daaf07dffb2f2a6593d7a1f75034800c5bdc0e82bae46ebd836b2e4c21a7bfa4d1aa9e952a7a8fc065833eef6d4
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.2.0] - 2021-08-07
|
4
|
+
|
5
|
+
- Be able to supprot new readme tag args in readme_yard without updating this gem b76ad2459168e4361ab38912e6faa7e36f249cec
|
3
6
|
|
4
7
|
## [0.1.2] - 2021-08-07
|
5
8
|
|
6
9
|
- Inherit from existing default to minimize conflict between plugins 69463cb2f580a1f5bcb734564eb51b32bf833250
|
7
10
|
- Avoid raising error when readme tag text is blank 294c9400de41d297c71212939b410e4ce821bc15
|
8
|
-
-
|
9
|
-
|
11
|
+
- Remove special readme tag names (README_YARD args) from docs when parsing docstring 983e1485b89888d390dc4879e7019fd7785dedda
|
10
12
|
|
11
13
|
## [0.1.1] - 2021-07-31
|
12
14
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
yard-readme (0.
|
4
|
+
yard-readme (0.2.0)
|
5
5
|
yard (~> 0.9.26)
|
6
6
|
|
7
7
|
GEM
|
@@ -11,7 +11,7 @@ GEM
|
|
11
11
|
rexml
|
12
12
|
pastel (0.8.0)
|
13
13
|
tty-color (~> 0.5)
|
14
|
-
readme_yard (0.1.
|
14
|
+
readme_yard (0.1.2)
|
15
15
|
tty-markdown (~> 0.7)
|
16
16
|
yard-readme (~> 0.1)
|
17
17
|
rexml (3.2.5)
|
@@ -10,6 +10,24 @@ module YARDReadme
|
|
10
10
|
# Doing so would make this custom parser obsolete.
|
11
11
|
#
|
12
12
|
class DocstringParser < YARD::Docstring.default_parser
|
13
|
+
class << self
|
14
|
+
attr_accessor :readme_tag_args
|
15
|
+
|
16
|
+
def readme_tag_args_regex
|
17
|
+
@readme_tag_args_regex ||= /\A(#{readme_tag_args.join("|")})/
|
18
|
+
end
|
19
|
+
|
20
|
+
def readme_tag_args_regex?
|
21
|
+
readme_tag_args && !readme_tag_args.empty?
|
22
|
+
end
|
23
|
+
|
24
|
+
def strip_readme_tag_arg(text)
|
25
|
+
return text unless readme_tag_args_regex?
|
26
|
+
|
27
|
+
text.sub(readme_tag_args_regex, "")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
13
31
|
def parse_content(content)
|
14
32
|
content = content.split(/\r?\n/) if content.is_a?(String)
|
15
33
|
return '' if !content || content.empty?
|
@@ -73,7 +91,7 @@ module YARDReadme
|
|
73
91
|
end
|
74
92
|
|
75
93
|
def parse_readme_text(text)
|
76
|
-
readme_text =
|
94
|
+
readme_text = self.class.strip_readme_tag_arg(text)
|
77
95
|
readme_text << "\n\n" if readme_text
|
78
96
|
end
|
79
97
|
|
data/lib/yard-readme/version.rb
CHANGED