inch 0.6.1 → 0.6.2

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: ba3a203a48459da4bf88d52ff9855712483543f7
4
- data.tar.gz: 31403afde0e69710d5d6ab5c6f997f3940eee18f
3
+ metadata.gz: f20cc532c358b6ed1b38c07a3aee0fb70463c854
4
+ data.tar.gz: 02ca81c0f84df27a474e41ecef356742e6336d17
5
5
  SHA512:
6
- metadata.gz: 5efa4c765863b66ddb2775f4b14027645bb3dfb6fb06701a4dec796506ef3e59924222810fa58c7ea321515dc274110cb5011828d152b7ce6ec6f5cfa53303be
7
- data.tar.gz: 6b81968eeba91c2403550c649f877cc6d9f703afef025eb15e21162ba0e49e13375d5dc4d7c9f2486f63749c44099b7ed1605a841b0e7b27cf6388cc00af428d
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
- /^#{r}\s?\S+/
154
+ /^\s*[-\*]?\s*#{r}\s?\S+/
153
155
  end
154
156
  same_line_regexps + describe_parameter_extra_regexps(name)
155
157
  end
@@ -1,3 +1,3 @@
1
1
  module Inch
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
@@ -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.1
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-04-23 00:00:00.000000000 Z
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.4.2
406
+ rubygems_version: 2.2.2
407
407
  signing_key:
408
408
  specification_version: 4
409
409
  summary: Documentation measurement tool for Ruby