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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebf25f4d0d965036850d04c859580025a2fce1361e6bd99d73d0d3a4912ab9e0
4
- data.tar.gz: c17189420b7ffb6105cf5b1439ccd0b73677b900de1dab4efaf74f70e0b07d25
3
+ metadata.gz: f8fcf73f1ebef0ac81488b0ee0a04eba51bcc228e9ba8a6e414b444bc19a6335
4
+ data.tar.gz: fe947ee1fc8c5fe274234e05feec1cf99238dbf20940542684ed3287289d4167
5
5
  SHA512:
6
- metadata.gz: f49d8edda2cb446af0a24ebe9ffa164db854f8965cca06d7b8f856cb5d4d834944de98f2fbaad8ea1659adcff4e1490044a6922b63aa4864513e015670624d20
7
- data.tar.gz: e48995e33ecd0175352fec3d0cf8464bff98cab4c498f26cdb9822dc5d8cfee0519d5f8c4611bed1d33a52a6f8f550c35e3893b76ea9eebee6e9acd820a50c4b
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
- - Remove special readme tag names (README_YARD args) from docs when parsing docstring 983e1485b89888d390dc4879e7019fd7785dedda
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.1.1)
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.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 = text.sub(/\A(source|docstring|object)/, "")
94
+ readme_text = self.class.strip_readme_tag_arg(text)
77
95
  readme_text << "\n\n" if readme_text
78
96
  end
79
97
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YARDReadme
4
- VERSION = "0.1.2"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-readme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Ruzicka