inch 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +8 -27
- data/CHANGELOG.md +6 -2
- data/lib/inch/api/diff.rb +1 -1
- data/lib/inch/api/filter.rb +1 -1
- data/lib/inch/api/get.rb +1 -1
- data/lib/inch/api/options/filter.rb +0 -4
- data/lib/inch/api/options/suggest.rb +0 -4
- data/lib/inch/api/suggest.rb +1 -1
- data/lib/inch/cli/arguments.rb +2 -2
- data/lib/inch/cli/command/base.rb +2 -2
- data/lib/inch/cli/command/options/diff.rb +3 -3
- data/lib/inch/cli/command/output/base.rb +2 -2
- data/lib/inch/cli/command/output/suggest.rb +2 -1
- data/lib/inch/cli/sparkline_helper.rb +4 -4
- data/lib/inch/code_object/provider/yard/docstring.rb +8 -8
- data/lib/inch/code_object/provider/yard/nodoc_helper.rb +1 -1
- data/lib/inch/code_object/provider/yard/object.rb +1 -1
- data/lib/inch/code_object/provider/yard/object/base.rb +15 -18
- data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +8 -4
- data/lib/inch/code_object/provider/yard/object/method_signature.rb +2 -1
- data/lib/inch/code_object/provider/yard/parser.rb +2 -2
- data/lib/inch/code_object/proxy/base.rb +4 -2
- data/lib/inch/code_object/proxy/method_parameter_object.rb +4 -2
- data/lib/inch/config/codebase.rb +1 -1
- data/lib/inch/evaluation/file.rb +1 -1
- data/lib/inch/evaluation/proxy/base.rb +1 -3
- data/lib/inch/evaluation/role/method.rb +2 -1
- data/lib/inch/rake/suggest.rb +1 -0
- data/lib/inch/version.rb +1 -1
- data/test/unit/code_object/provider/yard/docstring_test.rb +2 -1
- data/test/unit/code_object/provider/yard/nodoc_helper_test.rb +2 -1
- data/test/unit/code_object/proxy/method_object_test.rb +14 -7
- data/test/unit/evaluation/role/base_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c31501ddee3364461246eb390c64f95d04f7af3
|
4
|
+
data.tar.gz: 8f43411cc6757e519799d3d47c394ccd92641d3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 208f12e02a0725d03b5b7e255534272deb0497d59aece0480a40c3173bfda2b9ae3e6b3d2861df7636f9b6933019c4de0462539c7c4816a2957a5aba3324d609
|
7
|
+
data.tar.gz: 23376ecad96b2146c8ad18690b3bb44826f4315c80685858b8b8c4c7c219fd55794d237c56acae6fd49f7e9a4436b1302029825984e73ff153414ab40ce1c9f5
|
data/.rubocop_todo.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
-
# on 2014-08-
|
2
|
+
# on 2014-08-09 22:59:20 +0200 using RuboCop version 0.24.1.
|
3
3
|
# The point is for the user to remove these configuration records
|
4
4
|
# one by one as the offenses are removed from the code base.
|
5
5
|
# Note that changes in the inspected code, or installation of new
|
@@ -13,25 +13,16 @@ Lint/AmbiguousOperator:
|
|
13
13
|
Lint/AmbiguousRegexpLiteral:
|
14
14
|
Enabled: false
|
15
15
|
|
16
|
-
# Offense count: 9
|
17
|
-
# Configuration parameters: AllowSafeAssignment.
|
18
|
-
Lint/AssignmentInCondition:
|
19
|
-
Enabled: false
|
20
|
-
|
21
16
|
# Offense count: 1
|
22
17
|
Lint/Debugger:
|
23
18
|
Enabled: false
|
24
19
|
|
25
20
|
# Offense count: 3
|
26
|
-
Lint/UnderscorePrefixedVariableName:
|
27
|
-
Enabled: false
|
28
|
-
|
29
|
-
# Offense count: 6
|
30
21
|
# Cop supports --auto-correct.
|
31
22
|
Lint/UnusedMethodArgument:
|
32
23
|
Enabled: false
|
33
24
|
|
34
|
-
# Offense count:
|
25
|
+
# Offense count: 5
|
35
26
|
Style/AccessorMethodName:
|
36
27
|
Enabled: false
|
37
28
|
|
@@ -47,13 +38,13 @@ Style/ClassAndModuleChildren:
|
|
47
38
|
# Offense count: 5
|
48
39
|
# Configuration parameters: CountComments.
|
49
40
|
Style/ClassLength:
|
50
|
-
Max:
|
41
|
+
Max: 195
|
51
42
|
|
52
43
|
# Offense count: 2
|
53
44
|
Style/CyclomaticComplexity:
|
54
45
|
Max: 7
|
55
46
|
|
56
|
-
# Offense count:
|
47
|
+
# Offense count: 85
|
57
48
|
Style/Documentation:
|
58
49
|
Enabled: false
|
59
50
|
|
@@ -71,21 +62,16 @@ Style/GuardClause:
|
|
71
62
|
Style/IfUnlessModifier:
|
72
63
|
Enabled: false
|
73
64
|
|
74
|
-
# Offense count:
|
65
|
+
# Offense count: 10
|
75
66
|
# Configuration parameters: AllowURI.
|
76
67
|
Style/LineLength:
|
77
|
-
Max:
|
68
|
+
Max: 111
|
78
69
|
|
79
|
-
# Offense count:
|
70
|
+
# Offense count: 23
|
80
71
|
# Configuration parameters: CountComments.
|
81
72
|
Style/MethodLength:
|
82
73
|
Max: 34
|
83
74
|
|
84
|
-
# Offense count: 2
|
85
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
86
|
-
Style/MethodName:
|
87
|
-
Enabled: false
|
88
|
-
|
89
75
|
# Offense count: 22
|
90
76
|
# Configuration parameters: NamePrefixBlacklist.
|
91
77
|
Style/PredicateName:
|
@@ -101,12 +87,7 @@ Style/SingleLineBlockParams:
|
|
101
87
|
Style/SingleSpaceBeforeFirstArg:
|
102
88
|
Enabled: false
|
103
89
|
|
104
|
-
# Offense count:
|
105
|
-
# Cop supports --auto-correct.
|
106
|
-
Style/SpecialGlobalVars:
|
107
|
-
Enabled: false
|
108
|
-
|
109
|
-
# Offense count: 9
|
90
|
+
# Offense count: 5
|
110
91
|
# Cop supports --auto-correct.
|
111
92
|
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist.
|
112
93
|
Style/TrivialAccessors:
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
|
4
|
-
## 0.
|
4
|
+
## 0.4.7
|
5
5
|
|
6
6
|
- CLI classes must be required seperately from now on
|
7
7
|
- external data read by NoDocHelper is encoded as UTF-8
|
8
|
-
|
8
|
+
- YARD's attribute directive is now interpreted correctly
|
9
|
+
- Docs are now evaluated for class variables as well
|
10
|
+
- TomDoc support has been improved
|
11
|
+
- Method parameter name recognition has been improved for RDoc style comments
|
12
|
+
- Compliance with the Ruby Style Guide has been improved (thanks @yous)
|
9
13
|
|
10
14
|
## 0.4.6
|
11
15
|
|
data/lib/inch/api/diff.rb
CHANGED
data/lib/inch/api/filter.rb
CHANGED
@@ -8,7 +8,7 @@ module Inch
|
|
8
8
|
|
9
9
|
def initialize(codebase, options)
|
10
10
|
@codebase = codebase
|
11
|
-
codebase.objects.filter! Options::Filter(options)
|
11
|
+
codebase.objects.filter! Options::Filter.new(options)
|
12
12
|
@objects = codebase.objects.to_a
|
13
13
|
@grade_lists = @codebase.grade_lists
|
14
14
|
end
|
data/lib/inch/api/get.rb
CHANGED
@@ -18,7 +18,7 @@ module Inch
|
|
18
18
|
# @return [Array<CodeObject::Proxy::Base>]
|
19
19
|
def find_objects_with_names(object_names)
|
20
20
|
object_names.map do |object_name|
|
21
|
-
if object = codebase.objects.find(object_name)
|
21
|
+
if (object = codebase.objects.find(object_name))
|
22
22
|
object
|
23
23
|
else
|
24
24
|
codebase.objects.starting_with(object_name)
|
data/lib/inch/api/suggest.rb
CHANGED
data/lib/inch/cli/arguments.rb
CHANGED
@@ -28,10 +28,10 @@ module Inch
|
|
28
28
|
# @param args [Array<String>]
|
29
29
|
# @return [void]
|
30
30
|
def parse(args)
|
31
|
-
if first_non_file = args.find_index { |e| !glob_or_file?(e) }
|
31
|
+
if (first_non_file = args.find_index { |e| !glob_or_file?(e) })
|
32
32
|
@files = args[0...first_non_file]
|
33
33
|
rest = args[first_non_file..-1]
|
34
|
-
if first_switch = rest.find_index { |e| switch?(e) }
|
34
|
+
if (first_switch = rest.find_index { |e| switch?(e) })
|
35
35
|
@object_names = rest[0...first_switch]
|
36
36
|
@switches = rest[first_switch..-1]
|
37
37
|
else
|
@@ -65,7 +65,7 @@ module Inch
|
|
65
65
|
end
|
66
66
|
opts.on("-p", "--since-last-push",
|
67
67
|
"Run diff against last pushed commit") do
|
68
|
-
@before_rev =
|
68
|
+
@before_rev = pushed_rev
|
69
69
|
@since_last_push = true
|
70
70
|
end
|
71
71
|
end
|
@@ -73,8 +73,8 @@ module Inch
|
|
73
73
|
# @return [String] the reference for the pushed revision
|
74
74
|
#
|
75
75
|
# @example
|
76
|
-
#
|
77
|
-
def
|
76
|
+
# pushed_rev # => "origin/master"
|
77
|
+
def pushed_rev
|
78
78
|
"#{remote}/#{current_branch}"
|
79
79
|
end
|
80
80
|
|
@@ -24,9 +24,9 @@ module Inch
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def print_file_info(o,
|
27
|
+
def print_file_info(o, color)
|
28
28
|
o.files.each do |f|
|
29
|
-
echo "-> #{f.filename}:#{f.line_no}".color(
|
29
|
+
echo "-> #{f.filename}:#{f.line_no}".color(color)
|
30
30
|
end
|
31
31
|
echo separator
|
32
32
|
end
|
@@ -18,7 +18,8 @@ module Inch
|
|
18
18
|
}
|
19
19
|
|
20
20
|
# @param options [Command::Options::Suggest]
|
21
|
-
# @param relevant_objects [Array<CodeObject::Proxy::Base>] the objects
|
21
|
+
# @param relevant_objects [Array<CodeObject::Proxy::Base>] the objects
|
22
|
+
# meeting the criteria defined in +options+
|
22
23
|
# @param objects_to_display [Array<CodeObject::Proxy::Base>]
|
23
24
|
# @param grade_lists [Array<Evaluation::GradeList>]
|
24
25
|
# @param files [Array<Evaluation::File>]
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Inch
|
2
2
|
module CLI
|
3
3
|
module SparklineHelper
|
4
|
-
def grade_lists_sparkline(
|
5
|
-
|
6
|
-
list =
|
7
|
-
__sparkline(list,
|
4
|
+
def grade_lists_sparkline(grade_lists)
|
5
|
+
new_grade_lists = grade_lists.reverse
|
6
|
+
list = new_grade_lists.map { |r| r.objects.size }
|
7
|
+
__sparkline(list, new_grade_lists)
|
8
8
|
end
|
9
9
|
|
10
10
|
def grades_sparkline(objects)
|
@@ -65,8 +65,8 @@ module Inch
|
|
65
65
|
end
|
66
66
|
|
67
67
|
# Returns the last lines of the docstring.
|
68
|
-
# @return [Array<String>] the last line and, if the last line(s) is
|
69
|
-
# the last unindented line
|
68
|
+
# @return [Array<String>] the last line and, if the last line(s) is
|
69
|
+
# indented, the last unindented line
|
70
70
|
def last_lines
|
71
71
|
@last_lines ||= begin
|
72
72
|
list = []
|
@@ -99,14 +99,14 @@ module Inch
|
|
99
99
|
# Returns patterns in which method parameters are mentioned
|
100
100
|
# in inline docs.
|
101
101
|
#
|
102
|
-
# @param
|
102
|
+
# @param name [String] the name of the method parameter
|
103
103
|
# @return [Array<Regexp>]
|
104
|
-
def mention_parameter_patterns(
|
105
|
-
|
104
|
+
def mention_parameter_patterns(name)
|
105
|
+
escaped_name = Regexp.escape(name)
|
106
106
|
type = /<[^>]+>/
|
107
|
-
|
108
|
-
|
109
|
-
/#{
|
107
|
+
[
|
108
|
+
escaped_name,
|
109
|
+
/#{escaped_name}#{type}/ # matches "param1<String,nil>"
|
110
110
|
].map do |expr|
|
111
111
|
[
|
112
112
|
/#{expr}\:\:/, # param1::
|
@@ -25,12 +25,13 @@ module Inch
|
|
25
25
|
:type, :namespace, :source, :source_type, :group,
|
26
26
|
:dynamic, :visibility
|
27
27
|
|
28
|
-
# @param object [YARD::CodeObjects::Base] the actual (YARD) code
|
28
|
+
# @param object [YARD::CodeObjects::Base] the actual (YARD) code
|
29
|
+
# object
|
29
30
|
def initialize(object)
|
30
31
|
@object = object
|
31
|
-
@
|
32
|
-
@
|
33
|
-
@
|
32
|
+
@api_tag = __api_tag
|
33
|
+
@parent = __parent
|
34
|
+
@private_tag = __private_tag
|
34
35
|
end
|
35
36
|
|
36
37
|
# Returns the fullname of the object that the current object
|
@@ -47,18 +48,18 @@ module Inch
|
|
47
48
|
!api_tag.nil?
|
48
49
|
end
|
49
50
|
|
50
|
-
|
51
|
-
@__api_tag
|
52
|
-
end
|
51
|
+
attr_reader :api_tag
|
53
52
|
|
54
53
|
# To be overridden
|
55
54
|
# @see Proxy::NamespaceObject
|
56
|
-
# @return [CodeObject::Proxy::Base,nil] the child inside the current
|
57
|
-
|
55
|
+
# @return [CodeObject::Proxy::Base,nil] the child inside the current
|
56
|
+
# object or +nil+
|
57
|
+
def child(_name)
|
58
58
|
nil
|
59
59
|
end
|
60
60
|
|
61
|
-
# @return [Array,nil] the full names of the children of the current
|
61
|
+
# @return [Array,nil] the full names of the children of the current
|
62
|
+
# object
|
62
63
|
def children_fullnames
|
63
64
|
[]
|
64
65
|
end
|
@@ -156,9 +157,9 @@ module Inch
|
|
156
157
|
if tags(:example).size > 1 || docstring.code_examples.size > 1
|
157
158
|
true
|
158
159
|
else
|
159
|
-
if tag = tag(:example)
|
160
|
+
if (tag = tag(:example))
|
160
161
|
multi_code_examples?(tag.text)
|
161
|
-
elsif text = docstring.code_examples.first
|
162
|
+
elsif (text = docstring.code_examples.first)
|
162
163
|
multi_code_examples?(text)
|
163
164
|
else
|
164
165
|
false
|
@@ -210,9 +211,7 @@ module Inch
|
|
210
211
|
end
|
211
212
|
|
212
213
|
# @return [Array,nil] the parent of the current object or +nil+
|
213
|
-
|
214
|
-
@__parent
|
215
|
-
end
|
214
|
+
attr_reader :parent
|
216
215
|
|
217
216
|
def __parent
|
218
217
|
YARD::Object.for(object.parent) if object.parent
|
@@ -267,9 +266,7 @@ module Inch
|
|
267
266
|
!private_tag.nil?
|
268
267
|
end
|
269
268
|
|
270
|
-
|
271
|
-
@__private_tag
|
272
|
-
end
|
269
|
+
attr_reader :private_tag
|
273
270
|
|
274
271
|
def private_api_tag?
|
275
272
|
api_tag && api_tag.text == "private"
|
@@ -7,9 +7,11 @@ module Inch
|
|
7
7
|
class MethodParameterObject
|
8
8
|
attr_reader :name # @return [String]
|
9
9
|
|
10
|
-
# @param method [YARD::Object::MethodObject] the method the
|
10
|
+
# @param method [YARD::Object::MethodObject] the method the
|
11
|
+
# parameter belongs to
|
11
12
|
# @param name [String] the name of the parameter
|
12
|
-
# @param in_signature [String] how the parameter is noted in the
|
13
|
+
# @param in_signature [String] how the parameter is noted in the
|
14
|
+
# method's signature
|
13
15
|
# @param tag [YARD::Tags::Tag] the Tag object for the parameter
|
14
16
|
def initialize(method, name, in_signature, tag)
|
15
17
|
@method = method
|
@@ -21,7 +23,8 @@ module Inch
|
|
21
23
|
BAD_NAME_EXCEPTIONS = %w(id)
|
22
24
|
BAD_NAME_THRESHOLD = 3
|
23
25
|
|
24
|
-
# @return [Boolean] +true+ if the name of the parameter is
|
26
|
+
# @return [Boolean] +true+ if the name of the parameter is
|
27
|
+
# uncommunicative
|
25
28
|
def bad_name?
|
26
29
|
return false if BAD_NAME_EXCEPTIONS.include?(name)
|
27
30
|
name.size < BAD_NAME_THRESHOLD || name =~ /[0-9]$/
|
@@ -52,7 +55,8 @@ module Inch
|
|
52
55
|
@tag && @tag.types && !@tag.types.empty?
|
53
56
|
end
|
54
57
|
|
55
|
-
# @return [Boolean] +true+ if the parameter is mentioned in the
|
58
|
+
# @return [Boolean] +true+ if the parameter is mentioned in the
|
59
|
+
# docs, but not present in the method's signature
|
56
60
|
def wrongly_mentioned?
|
57
61
|
mentioned? && !@in_signature
|
58
62
|
end
|
@@ -8,7 +8,8 @@ module Inch
|
|
8
8
|
attr_reader :method, :docstring
|
9
9
|
|
10
10
|
# @param method [Provider::YARD::Object::MethodObject]
|
11
|
-
# @param yard_tag [::YARD::Tags::Tag,nil] if nil, the method's
|
11
|
+
# @param yard_tag [::YARD::Tags::Tag,nil] if nil, the method's
|
12
|
+
# normal signature is used
|
12
13
|
def initialize(method, yard_tag = nil)
|
13
14
|
@method = method
|
14
15
|
@yard_tag = yard_tag
|
@@ -46,8 +46,8 @@ module Inch
|
|
46
46
|
object.base_dir = dir
|
47
47
|
|
48
48
|
object.aliases_fullnames.each do |fullname|
|
49
|
-
|
50
|
-
|
49
|
+
alias_object = objects.find { |o| o.fullname == fullname }
|
50
|
+
alias_object.aliased_object_fullname = object.fullname
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -52,7 +52,8 @@ module Inch
|
|
52
52
|
!aliased_object.nil?
|
53
53
|
end
|
54
54
|
|
55
|
-
# @return [CodeObject::Proxy::Base] the object the current object is an
|
55
|
+
# @return [CodeObject::Proxy::Base] the object the current object is an
|
56
|
+
# alias of
|
56
57
|
def aliased_object
|
57
58
|
object_lookup.find(self[:aliased_object_fullname])
|
58
59
|
end
|
@@ -170,7 +171,8 @@ module Inch
|
|
170
171
|
self[:nodoc?]
|
171
172
|
end
|
172
173
|
|
173
|
-
# @return [CodeObject::Proxy::Base,nil] the parent of the current object
|
174
|
+
# @return [CodeObject::Proxy::Base,nil] the parent of the current object
|
175
|
+
# or +nil+
|
174
176
|
def parent
|
175
177
|
object_lookup.find(self[:parent_fullname])
|
176
178
|
end
|
@@ -14,7 +14,8 @@ module Inch
|
|
14
14
|
BAD_NAME_EXCEPTIONS = %w(id)
|
15
15
|
BAD_NAME_THRESHOLD = 3
|
16
16
|
|
17
|
-
# @return [Boolean] +true+ if the name of the parameter is
|
17
|
+
# @return [Boolean] +true+ if the name of the parameter is
|
18
|
+
# uncommunicative
|
18
19
|
def bad_name?
|
19
20
|
return false if BAD_NAME_EXCEPTIONS.include?(name)
|
20
21
|
name.size < BAD_NAME_THRESHOLD || name =~ /[0-9]$/
|
@@ -50,7 +51,8 @@ module Inch
|
|
50
51
|
self[:typed?]
|
51
52
|
end
|
52
53
|
|
53
|
-
# @return [Boolean] +true+ if the parameter is mentioned in the docs,
|
54
|
+
# @return [Boolean] +true+ if the parameter is mentioned in the docs,
|
55
|
+
# but not present in the method's signature
|
54
56
|
def wrongly_mentioned?
|
55
57
|
self[:wrongly_mentioned?]
|
56
58
|
end
|
data/lib/inch/config/codebase.rb
CHANGED
data/lib/inch/evaluation/file.rb
CHANGED
@@ -32,7 +32,8 @@ module Inch
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
# Role assigned to methods where the return value is decribed in the
|
35
|
+
# Role assigned to methods where the return value is decribed in the
|
36
|
+
# docs
|
36
37
|
class WithReturnDescription < Base
|
37
38
|
applicable_if :return_described?
|
38
39
|
end
|
data/lib/inch/rake/suggest.rb
CHANGED
data/lib/inch/version.rb
CHANGED
@@ -139,7 +139,8 @@ returns nothing
|
|
139
139
|
assert docstring.describes_return?
|
140
140
|
end
|
141
141
|
|
142
|
-
it "should understand 'Returns ...' with a visibility modifier in front of
|
142
|
+
it "should understand 'Returns ...' with a visibility modifier in front of" \
|
143
|
+
" it" do
|
143
144
|
text = "Public: Returns the Integer color."
|
144
145
|
docstring = described_class.new(text)
|
145
146
|
assert docstring.mentions_return?
|
@@ -30,7 +30,8 @@ describe ::Inch::CodeObject::Provider::YARD::NodocHelper do
|
|
30
30
|
"Foo::Qux::Quux::PUBLIC_VALUE",
|
31
31
|
"Foo::Qux::DOCCED_VALUE",
|
32
32
|
"Foo::HiddenClass::EvenMoreHiddenClass::SuddenlyVisibleClass",
|
33
|
-
"Foo::HiddenClass::EvenMoreHiddenClass::SuddenlyVisibleClass
|
33
|
+
"Foo::HiddenClass::EvenMoreHiddenClass::SuddenlyVisibleClass" \
|
34
|
+
"#method_with_implicit_doc"
|
34
35
|
].each do |query|
|
35
36
|
m = @objects.find { |o| o.fullname == query }
|
36
37
|
refute m.nodoc?, "nodoc? should return false for #{query}"
|
@@ -163,7 +163,8 @@ describe ::Inch::CodeObject::Proxy::MethodObject do
|
|
163
163
|
assert m.score
|
164
164
|
end
|
165
165
|
|
166
|
-
it "should handle methods (without parameters) that have only a docstring
|
166
|
+
it "should handle methods (without parameters) that have only a docstring" \
|
167
|
+
" (text comment)" do
|
167
168
|
m = @objects.find("Foo::Bar#method_without_params_or_return_type")
|
168
169
|
assert m.has_doc?
|
169
170
|
refute m.has_parameters?
|
@@ -215,7 +216,8 @@ describe ::Inch::CodeObject::Proxy::MethodObject do
|
|
215
216
|
assert_equal 0, m.score
|
216
217
|
end
|
217
218
|
|
218
|
-
it "should recognize a getter in a getter/setter pair defined via
|
219
|
+
it "should recognize a getter in a getter/setter pair defined via" \
|
220
|
+
" attr_accessor" do
|
219
221
|
m = @objects.find("InchTest#attr_getset")
|
220
222
|
assert m.getter?, "should be a getter"
|
221
223
|
refute m.setter?
|
@@ -223,7 +225,8 @@ describe ::Inch::CodeObject::Proxy::MethodObject do
|
|
223
225
|
assert_equal 0, m.score
|
224
226
|
end
|
225
227
|
|
226
|
-
it "should recognize a setter in a getter/setter pair defined via
|
228
|
+
it "should recognize a setter in a getter/setter pair defined via" \
|
229
|
+
" attr_accessor" do
|
227
230
|
m = @objects.find("InchTest#attr_getset=")
|
228
231
|
refute m.getter?
|
229
232
|
assert m.setter?, "should be a setter"
|
@@ -247,13 +250,15 @@ describe ::Inch::CodeObject::Proxy::MethodObject do
|
|
247
250
|
assert_equal 0, m.score
|
248
251
|
end
|
249
252
|
|
250
|
-
it "should recognize docs on a getter in a getter/setter pair defined via
|
253
|
+
it "should recognize docs on a getter in a getter/setter pair defined via" \
|
254
|
+
" attr_accessor" do
|
251
255
|
m = @objects.find("Attributes#username")
|
252
256
|
refute_equal 0, m.score
|
253
257
|
refute m.undocumented?
|
254
258
|
end
|
255
259
|
|
256
|
-
it "should recognize docs on a setter in a getter/setter pair defined via
|
260
|
+
it "should recognize docs on a setter in a getter/setter pair defined via" \
|
261
|
+
" attr_accessor" do
|
257
262
|
m = @objects.find("Attributes#username=")
|
258
263
|
refute_equal 0, m.score
|
259
264
|
refute m.undocumented?
|
@@ -324,7 +329,8 @@ describe ::Inch::CodeObject::Proxy::MethodObject do
|
|
324
329
|
m, Inch::Evaluation::Role::MethodParameter::WithoutMention, "block")
|
325
330
|
end
|
326
331
|
|
327
|
-
it "should work if @param tags are only present in the @overload tags,
|
332
|
+
it "should work if @param tags are only present in the @overload tags," \
|
333
|
+
" but not on the actual method" do
|
328
334
|
m = @objects.find("Overloading#params_only_in_overloads")
|
329
335
|
unexpected_roles = [
|
330
336
|
Inch::Evaluation::Role::Object::WithoutCodeExample,
|
@@ -430,7 +436,8 @@ describe ::Inch::CodeObject::Proxy::MethodObject do
|
|
430
436
|
assert m.score >= 50 # TODO: don't use magic numbers
|
431
437
|
end
|
432
438
|
|
433
|
-
it "should recognize question mark methods with description and
|
439
|
+
it "should recognize question mark methods with description and" \
|
440
|
+
" parameters" do
|
434
441
|
m = @objects.find("InchTest#method_with_description_and_parameters?")
|
435
442
|
refute m.has_doc?
|
436
443
|
assert m.has_parameters?
|
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.4.
|
4
|
+
version: 0.4.8
|
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: 2014-08-
|
11
|
+
date: 2014-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|