inch 0.3.1.rc4 → 0.3.1.rc5

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: e0e0ac12145f490c8344decf540c18bfde47cd80
4
- data.tar.gz: 9bcb872f479818b9feac08c5d2db80303aee6ef5
3
+ metadata.gz: a7b99573da9408ffa0e56ee31e420c296a42b3ea
4
+ data.tar.gz: 93ab1ce0fe32d5ab28f52dc92a6fa17261b32bee
5
5
  SHA512:
6
- metadata.gz: 65f3ce04102ade8753d5b1b7d0db2620f7a8087df58949fd9efe21c41ac54c27c82a4031885d913acbc9cd48353333ef36b1147d848f462a033cbb22162fcae1
7
- data.tar.gz: acfdb32fe9cfb3a2301feef2110eedbf39ccfe6e4f78eb8e07dc2dffba2dd8f4e43601630c96b463b493a1c3a1453c2240c0072fb18b25bdedf27c2b133a9bfe
6
+ metadata.gz: a66b5b26a2bbbb2840413cb20082f14df0e158fde60c72655c5627b252f4ae08daa26148df44f8239ecd9ca5ceb1bacbb0e8ad2d3c79810471834e66f14b9f15
7
+ data.tar.gz: 293663583786f286140ce3df1f0910e8660413156113231d12f8588724f8b72bbaf3cf07ed6c05de20a4d13562b57ee8794eae986136a9a524472270e60fbbad
@@ -37,7 +37,7 @@ module Inch
37
37
  parameters
38
38
  private?
39
39
  tagged_as_internal_api?
40
- private_tag?
40
+ tagged_as_private?
41
41
  protected?
42
42
  public?
43
43
  questioning_name?
@@ -11,6 +11,10 @@ module Inch
11
11
  first_line =~ /^Internal\:\ .+/
12
12
  end
13
13
 
14
+ def describes_private_object?
15
+ first_line =~ /^Private\:\ .+/
16
+ end
17
+
14
18
  def empty?
15
19
  @text.strip.empty?
16
20
  end
@@ -10,7 +10,7 @@ module Inch
10
10
  # @note Doesnot recognize ":startdoc:" and ":stopdoc:"
11
11
  #
12
12
  def nodoc?
13
- private_tag? || nodoc_comment?
13
+ tagged_as_private? || nodoc_comment?
14
14
  end
15
15
 
16
16
  NO_DOC_REGEX = /#\s*\:nodoc\:/
@@ -186,20 +186,14 @@ module Inch
186
186
  visibility == :private
187
187
  end
188
188
 
189
- # @return [Boolean]
190
- # +true+ if the object or its parent is tagged as @private
191
- def private_tag?
192
- !private_tag.nil?
193
- end
194
-
195
- def private_tag
196
- @__private_tag
197
- end
198
-
199
189
  def tagged_as_internal_api?
200
190
  private_api_tag? || docstring.describes_internal_api?
201
191
  end
202
192
 
193
+ def tagged_as_private?
194
+ private_tag? || docstring.describes_private_object?
195
+ end
196
+
203
197
  def protected?
204
198
  visibility == :protected
205
199
  end
@@ -235,6 +229,16 @@ module Inch
235
229
  object.docstring.all
236
230
  end
237
231
 
232
+ # @return [Boolean]
233
+ # +true+ if the object or its parent is tagged as @private
234
+ def private_tag?
235
+ !private_tag.nil?
236
+ end
237
+
238
+ def private_tag
239
+ @__private_tag
240
+ end
241
+
238
242
  def private_api_tag?
239
243
  api_tag && api_tag.text == 'private'
240
244
  end
@@ -163,10 +163,13 @@ module Inch
163
163
 
164
164
  # @return [Boolean]
165
165
  # +true+ if the object or its parent is tagged as @private
166
- def private_tag?
167
- self[:private_tag?]
166
+ def tagged_as_private?
167
+ self[:tagged_as_private?]
168
168
  end
169
169
 
170
+ # @return [Boolean]
171
+ # +true+ if the object or its parent is tagged as part of an
172
+ # internal api
170
173
  def tagged_as_internal_api?
171
174
  self[:tagged_as_internal_api?]
172
175
  end
@@ -52,7 +52,7 @@ module Inch
52
52
  end
53
53
  if !options.visibility.include?(:private)
54
54
  @list = @list.reject do |o|
55
- o.private_tag?
55
+ o.tagged_as_private?
56
56
  end
57
57
  end
58
58
  end
@@ -104,6 +104,7 @@ module Inch
104
104
  Role::Object::Tagged => score_for_unconsidered_tags,
105
105
  Role::Object::TaggedAsAPI => nil,
106
106
  Role::Object::TaggedAsInternalAPI => nil,
107
+ Role::Object::TaggedAsPrivate => nil,
107
108
  }
108
109
  end
109
110
 
@@ -57,6 +57,18 @@ module Inch
57
57
  end
58
58
  end
59
59
 
60
+ # Role assigned to objects explicitly or implicitly tagged to be
61
+ # private.
62
+ #
63
+ # @see CodeObject::NodocHelper
64
+ class TaggedAsPrivate < Base
65
+ applicable_if :tagged_as_private?
66
+
67
+ def priority
68
+ -5
69
+ end
70
+ end
71
+
60
72
  # Role assigned to objects declared in the top-level namespace
61
73
  class InRoot < Base
62
74
  applicable_if :in_root?
@@ -1,3 +1,3 @@
1
1
  module Inch
2
- VERSION = "0.3.1.rc4"
2
+ VERSION = "0.3.1.rc5"
3
3
  end
@@ -100,10 +100,14 @@ module InchTest
100
100
  end
101
101
 
102
102
  # @api private
103
- def internal_api_with_yard
103
+ def private_api_with_yard
104
104
  end
105
105
 
106
106
  # Internal: Normalize the filename.
107
107
  def internal_api_with_tomdoc
108
108
  end
109
+
110
+ # Private: Normalize the filename.
111
+ def private_method_with_tomdoc
112
+ end
109
113
  end
@@ -28,7 +28,7 @@ describe ::Inch::API::Filter do
28
28
  it "should work with option: visibility == :private" do
29
29
  @options = {:visibility => [:private]}
30
30
  @context = ::Inch::API::Filter.new @codebase, @options
31
- assert @context.objects.all? { |o| o.private? || o.private_tag? }
31
+ assert @context.objects.all? { |o| o.private? || o.tagged_as_private? }
32
32
  end
33
33
 
34
34
  it "should work with option: namespaces == :only" do
@@ -12,8 +12,16 @@ describe ::Inch::CodeObject::Proxy::MethodObject do
12
12
  assert m.undocumented?
13
13
  end
14
14
 
15
+ def test_tagged_as_private
16
+ %w( InchTest#method_with_private_tag
17
+ InchTest#private_method_with_tomdoc).each do |fullname|
18
+ m = @codebase.objects.find(fullname)
19
+ assert m.tagged_as_private?
20
+ end
21
+ end
22
+
15
23
  def test_tagged_as_internal_api
16
- %w( InchTest#internal_api_with_yard
24
+ %w( InchTest#private_api_with_yard
17
25
  InchTest#internal_api_with_tomdoc).each do |fullname|
18
26
  m = @codebase.objects.find(fullname)
19
27
  assert m.tagged_as_internal_api?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.rc4
4
+ version: 0.3.1.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - René Föhring