inch 0.6.1 → 0.6.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f20cc532c358b6ed1b38c07a3aee0fb70463c854
|
4
|
+
data.tar.gz: 02ca81c0f84df27a474e41ecef356742e6336d17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e86adb1bf23ee8ce3d70435756af852cf00afb95e6caf53828e7b20043dab221e79d08513587dc15ad18d135529fa9cd24df579ddfc752beea66797a0d6dc9f6
|
7
|
+
data.tar.gz: c244532af0d1fad89f9448037a4cd2663263b36914a2467123e6e1c7a22bb5de00b4c5612797797f591ed9605a3fc17741d9b4381e38999a4879dc93e6e7f0e2
|
@@ -28,6 +28,8 @@ module Inch
|
|
28
28
|
@code_examples ||= parse_code_examples
|
29
29
|
end
|
30
30
|
|
31
|
+
# Returns +true+ if the docstring describes the parameter with the
|
32
|
+
# given +name+.
|
31
33
|
def describes_parameter?(name)
|
32
34
|
return false if name.nil?
|
33
35
|
describe_parameter_regexps(name).any? do |pattern|
|
@@ -149,7 +151,7 @@ module Inch
|
|
149
151
|
same_line_regexps =
|
150
152
|
mention_parameter_patterns(name).map do |pattern|
|
151
153
|
r = pattern.is_a?(Regexp) ? pattern : Regexp.escape(pattern)
|
152
|
-
|
154
|
+
/^\s*[-\*]?\s*#{r}\s?\S+/
|
153
155
|
end
|
154
156
|
same_line_regexps + describe_parameter_extra_regexps(name)
|
155
157
|
end
|
data/lib/inch/version.rb
CHANGED
@@ -3,6 +3,31 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../../../test_helper')
|
|
3
3
|
describe ::Inch::Language::Ruby::Provider::YARD::Docstring do
|
4
4
|
let(:described_class) { ::Inch::Language::Ruby::Provider::YARD::Docstring }
|
5
5
|
|
6
|
+
it 'should notice things in phoenix style docs' do
|
7
|
+
text = <<-DOC
|
8
|
+
Unsubscribes the pid from the topic.
|
9
|
+
|
10
|
+
* `param1` - The registered server name or pid
|
11
|
+
* `p2` - The subscriber pid
|
12
|
+
* `prm3` - The string topic, ie "users:123"
|
13
|
+
|
14
|
+
## Examples
|
15
|
+
|
16
|
+
iex> unsubscribe(:param1, self, "foo")
|
17
|
+
:ok
|
18
|
+
DOC
|
19
|
+
docstring = described_class.new(text)
|
20
|
+
assert docstring.mentions_parameter?(:param1)
|
21
|
+
assert docstring.mentions_parameter?(:p2)
|
22
|
+
assert docstring.mentions_parameter?(:prm3)
|
23
|
+
assert docstring.describes_parameter?(:param1)
|
24
|
+
assert docstring.describes_parameter?(:p2)
|
25
|
+
assert docstring.describes_parameter?(:prm3)
|
26
|
+
assert docstring.contains_code_example?
|
27
|
+
refute docstring.mentions_return?
|
28
|
+
refute docstring.describes_return?
|
29
|
+
end
|
30
|
+
|
6
31
|
#
|
7
32
|
# loose TomDoc compatibility
|
8
33
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- René Föhring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -403,7 +403,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
403
403
|
version: '0'
|
404
404
|
requirements: []
|
405
405
|
rubyforge_project:
|
406
|
-
rubygems_version: 2.
|
406
|
+
rubygems_version: 2.2.2
|
407
407
|
signing_key:
|
408
408
|
specification_version: 4
|
409
409
|
summary: Documentation measurement tool for Ruby
|