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 +4 -4
- data/lib/inch/code_object/converter.rb +1 -1
- data/lib/inch/code_object/provider/yard/docstring.rb +4 -0
- data/lib/inch/code_object/provider/yard/nodoc_helper.rb +1 -1
- data/lib/inch/code_object/provider/yard/object/base.rb +14 -10
- data/lib/inch/code_object/proxy/base.rb +5 -2
- data/lib/inch/codebase/objects_filter.rb +1 -1
- data/lib/inch/evaluation/proxy/base.rb +1 -0
- data/lib/inch/evaluation/role/object.rb +12 -0
- data/lib/inch/version.rb +1 -1
- data/test/fixtures/simple/lib/role_methods.rb +5 -1
- data/test/inch/api/filter_test.rb +1 -1
- data/test/inch/code_object/proxy/method_object_test.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7b99573da9408ffa0e56ee31e420c296a42b3ea
|
4
|
+
data.tar.gz: 93ab1ce0fe32d5ab28f52dc92a6fa17261b32bee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a66b5b26a2bbbb2840413cb20082f14df0e158fde60c72655c5627b252f4ae08daa26148df44f8239ecd9ca5ceb1bacbb0e8ad2d3c79810471834e66f14b9f15
|
7
|
+
data.tar.gz: 293663583786f286140ce3df1f0910e8660413156113231d12f8588724f8b72bbaf3cf07ed6c05de20a4d13562b57ee8794eae986136a9a524472270e60fbbad
|
@@ -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
|
167
|
-
self[:
|
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
|
@@ -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?
|
data/lib/inch/version.rb
CHANGED
@@ -100,10 +100,14 @@ module InchTest
|
|
100
100
|
end
|
101
101
|
|
102
102
|
# @api private
|
103
|
-
def
|
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.
|
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#
|
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?
|