inch 0.4.10 → 0.5.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2 -11
  3. data/Gemfile +2 -5
  4. data/README.md +1 -1
  5. data/Rakefile +2 -2
  6. data/bin/inch +3 -3
  7. data/config/defaults.rb +0 -7
  8. data/inch.gemspec +7 -7
  9. data/lib/inch.rb +9 -9
  10. data/lib/inch/api.rb +10 -10
  11. data/lib/inch/api/compare.rb +2 -2
  12. data/lib/inch/api/compare/code_objects.rb +3 -2
  13. data/lib/inch/api/compare/codebases.rb +1 -1
  14. data/lib/inch/api/diff.rb +10 -7
  15. data/lib/inch/api/filter.rb +1 -1
  16. data/lib/inch/api/get.rb +1 -1
  17. data/lib/inch/api/options/base.rb +4 -4
  18. data/lib/inch/api/options/filter.rb +4 -0
  19. data/lib/inch/api/options/suggest.rb +5 -1
  20. data/lib/inch/api/stats.rb +1 -0
  21. data/lib/inch/api/suggest.rb +10 -9
  22. data/lib/inch/cli.rb +6 -6
  23. data/lib/inch/cli/arguments.rb +2 -2
  24. data/lib/inch/cli/command.rb +15 -15
  25. data/lib/inch/cli/command/base.rb +4 -4
  26. data/lib/inch/cli/command/console.rb +5 -5
  27. data/lib/inch/cli/command/diff.rb +8 -7
  28. data/lib/inch/cli/command/inspect.rb +4 -5
  29. data/lib/inch/cli/command/list.rb +4 -4
  30. data/lib/inch/cli/command/options/base.rb +8 -8
  31. data/lib/inch/cli/command/options/base_list.rb +5 -9
  32. data/lib/inch/cli/command/options/console.rb +3 -4
  33. data/lib/inch/cli/command/options/diff.rb +6 -8
  34. data/lib/inch/cli/command/options/inspect.rb +2 -2
  35. data/lib/inch/cli/command/options/list.rb +2 -3
  36. data/lib/inch/cli/command/options/show.rb +2 -2
  37. data/lib/inch/cli/command/options/stats.rb +1 -2
  38. data/lib/inch/cli/command/options/suggest.rb +3 -6
  39. data/lib/inch/cli/command/output/base.rb +6 -4
  40. data/lib/inch/cli/command/output/console.rb +5 -4
  41. data/lib/inch/cli/command/output/diff.rb +6 -6
  42. data/lib/inch/cli/command/output/inspect.rb +8 -6
  43. data/lib/inch/cli/command/output/list.rb +1 -0
  44. data/lib/inch/cli/command/output/show.rb +5 -4
  45. data/lib/inch/cli/command/output/stats.rb +21 -21
  46. data/lib/inch/cli/command/output/suggest.rb +27 -30
  47. data/lib/inch/cli/command/show.rb +4 -4
  48. data/lib/inch/cli/command/stats.rb +4 -4
  49. data/lib/inch/cli/command/suggest.rb +6 -6
  50. data/lib/inch/cli/command_parser.rb +5 -6
  51. data/lib/inch/cli/sparkline_helper.rb +6 -6
  52. data/lib/inch/cli/trace_helper.rb +1 -1
  53. data/lib/inch/cli/yardopts_helper.rb +3 -4
  54. data/lib/inch/code_object.rb +3 -3
  55. data/lib/inch/code_object/converter.rb +8 -6
  56. data/lib/inch/code_object/provider.rb +1 -1
  57. data/lib/inch/code_object/provider/yard.rb +12 -10
  58. data/lib/inch/code_object/provider/yard/docstring.rb +19 -51
  59. data/lib/inch/code_object/provider/yard/nodoc_helper.rb +4 -4
  60. data/lib/inch/code_object/provider/yard/object.rb +10 -12
  61. data/lib/inch/code_object/provider/yard/object/base.rb +27 -48
  62. data/lib/inch/code_object/provider/yard/object/method_object.rb +10 -47
  63. data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +6 -10
  64. data/lib/inch/code_object/provider/yard/object/method_signature.rb +8 -12
  65. data/lib/inch/code_object/provider/yard/object/namespace_object.rb +4 -1
  66. data/lib/inch/code_object/provider/yard/parser.rb +3 -3
  67. data/lib/inch/code_object/proxy.rb +9 -10
  68. data/lib/inch/code_object/proxy/base.rb +10 -12
  69. data/lib/inch/code_object/proxy/method_object.rb +2 -3
  70. data/lib/inch/code_object/proxy/method_parameter_object.rb +3 -5
  71. data/lib/inch/codebase.rb +5 -4
  72. data/lib/inch/codebase/objects_filter.rb +4 -2
  73. data/lib/inch/codebase/serializer.rb +3 -3
  74. data/lib/inch/config.rb +2 -2
  75. data/lib/inch/config/base.rb +1 -0
  76. data/lib/inch/config/codebase.rb +4 -4
  77. data/lib/inch/core_ext.rb +1 -1
  78. data/lib/inch/core_ext/string.rb +1 -1
  79. data/lib/inch/evaluation.rb +15 -16
  80. data/lib/inch/evaluation/file.rb +1 -1
  81. data/lib/inch/evaluation/grade_list.rb +2 -2
  82. data/lib/inch/evaluation/object_schema.rb +1 -1
  83. data/lib/inch/evaluation/proxy.rb +7 -8
  84. data/lib/inch/evaluation/proxy/base.rb +10 -13
  85. data/lib/inch/evaluation/proxy/constant_object.rb +1 -1
  86. data/lib/inch/evaluation/proxy/method_object.rb +5 -12
  87. data/lib/inch/evaluation/proxy/module_object.rb +1 -1
  88. data/lib/inch/evaluation/proxy/namespace_object.rb +1 -1
  89. data/lib/inch/evaluation/role/base.rb +1 -1
  90. data/lib/inch/evaluation/role/method.rb +2 -2
  91. data/lib/inch/evaluation/role/method_parameter.rb +1 -2
  92. data/lib/inch/evaluation/role/object.rb +2 -2
  93. data/lib/inch/rake.rb +2 -2
  94. data/lib/inch/rake/suggest.rb +2 -3
  95. data/lib/inch/utils/shell_helper.rb +1 -1
  96. data/lib/inch/utils/ui.rb +5 -5
  97. data/lib/inch/utils/weighted_list.rb +3 -2
  98. data/lib/inch/version.rb +1 -1
  99. data/test/fixtures/simple/lib/broken.rb +7 -35
  100. data/test/fixtures/simple/lib/foo.rb +1 -22
  101. data/test/integration/api/compare/codebases.rb +1 -1
  102. data/test/integration/cli/command/console_test.rb +5 -5
  103. data/test/integration/cli/command/inspect_test.rb +5 -4
  104. data/test/integration/cli/command/list_test.rb +4 -3
  105. data/test/integration/cli/command/show_test.rb +4 -4
  106. data/test/integration/cli/command/stats_test.rb +2 -2
  107. data/test/integration/cli/command/suggest_test.rb +10 -10
  108. data/test/integration/stats_options_test.rb +3 -3
  109. data/test/integration/visibility_options_test.rb +13 -13
  110. data/test/shared/base_list.rb +3 -4
  111. data/test/test_helper.rb +6 -16
  112. data/test/unit/api/filter_test.rb +7 -7
  113. data/test/unit/api/get_test.rb +1 -1
  114. data/test/unit/api/list_test.rb +1 -1
  115. data/test/unit/api/options/base_test.rb +3 -3
  116. data/test/unit/api/stats_test.rb +1 -1
  117. data/test/unit/api/suggest_test.rb +3 -3
  118. data/test/unit/cli/arguments_test.rb +1 -1
  119. data/test/unit/cli/command/base_test.rb +1 -1
  120. data/test/unit/cli/command/options/base_list_test.rb +2 -2
  121. data/test/unit/cli/command/options/base_object_test.rb +1 -1
  122. data/test/unit/cli/command/options/base_test.rb +1 -1
  123. data/test/unit/cli/command_parser_test.rb +2 -2
  124. data/test/unit/cli/trace_helper_test.rb +1 -1
  125. data/test/unit/cli/yardopts_helper_test.rb +3 -4
  126. data/test/unit/code_object/converter_test.rb +1 -1
  127. data/test/unit/code_object/provider/yard/docstring_test.rb +28 -106
  128. data/test/unit/code_object/provider/yard/nodoc_helper_test.rb +5 -6
  129. data/test/unit/code_object/provider/yard/object/method_object_test.rb +10 -20
  130. data/test/unit/code_object/provider/yard_test.rb +4 -4
  131. data/test/unit/code_object/provider_test.rb +1 -1
  132. data/test/unit/code_object/proxy/method_object_test.rb +262 -382
  133. data/test/unit/code_object/proxy_test.rb +1 -1
  134. data/test/unit/codebase/objects_test.rb +2 -2
  135. data/test/unit/codebase/proxy_test.rb +1 -1
  136. data/test/unit/config/codebase_test.rb +1 -1
  137. data/test/unit/evaluation/role/base_test.rb +2 -2
  138. data/test/unit/utils/ui_test.rb +4 -4
  139. data/test/unit/utils/weighted_list_test.rb +4 -7
  140. metadata +4 -14
  141. data/.rubocop.yml +0 -15
  142. data/.rubocop_todo.yml +0 -94
  143. data/lib/inch/code_object/provider/yard/object/class_variable_object.rb +0 -12
  144. data/lib/inch/code_object/proxy/class_variable_object.rb +0 -8
  145. data/lib/inch/evaluation/proxy/class_variable_object.rb +0 -19
  146. data/lib/inch/evaluation/role/class_variable.rb +0 -55
  147. data/test/fixtures/simple/lib/broken_ruby_2_0_features.rb +0 -7
  148. data/test/fixtures/simple/lib/directives.rb +0 -8
@@ -1,4 +1,4 @@
1
- require "inch/code_object/provider/yard/object/method_signature"
1
+ require 'inch/code_object/provider/yard/object/method_signature'
2
2
 
3
3
  module Inch
4
4
  module CodeObject
@@ -46,7 +46,7 @@ module Inch
46
46
  end
47
47
 
48
48
  def parameter(name)
49
- parameters.find { |p| p.name == name.to_s }
49
+ parameters.detect { |p| p.name == name.to_s }
50
50
  end
51
51
 
52
52
  def overridden?
@@ -66,14 +66,13 @@ module Inch
66
66
  # Returns +true+ if a return value is described by it's type or
67
67
  # mentioned in the docstring (e.g. "Returns a String").
68
68
  def return_mentioned?
69
- return_tags.any? do |t|
70
- !t.types.nil? && !t.types.empty? && !YARD.implicit_tag?(t, self)
71
- end || docstring.mentions_return? && !implicit_docstring?
69
+ return_tags.any? { |t| !t.types.nil? && !t.types.empty? && !YARD.implicit_tag?(t, self) } ||
70
+ docstring.mentions_return? && !implicit_docstring?
72
71
  end
73
72
 
74
73
  # Returns +true+ if a return value is described by words.
75
74
  def return_described?
76
- return_described_via_tag? ||
75
+ return_tags.any? { |t| !t.text.empty? && !YARD.implicit_tag?(t, self) } ||
77
76
  docstring.describes_return? && !implicit_docstring?
78
77
  end
79
78
 
@@ -103,60 +102,24 @@ module Inch
103
102
 
104
103
  private
105
104
 
106
- # Returns @return tags that are assigned to the getter
107
- # corresponding to this setter.
108
- #
109
- # @return [Array<::YARD::Tag>]
110
- def attributed_return_tags
111
- if setter? && object.tags(:return).empty?
112
- method = corresponding_getter
113
- return method.object.tags(:return) if method
114
- end
115
- []
116
- end
117
-
118
- # @return [MethodObject,nil]
119
- def corresponding_getter
120
- clean_name = name.to_s.gsub(/(\=)$/, "")
121
- parent.child(clean_name.to_sym)
122
- end
123
-
124
- # Returns +true+ if the docstring was generated by YARD.
105
+ # Returns +true+ if the docstring was generated by YARD
125
106
  def implicit_docstring?
126
107
  YARD.implicit_docstring?(docstring, self)
127
108
  end
128
109
 
129
- # @return [Array<::YARD::Tag>]
130
110
  def overload_tags
131
111
  object.tags(:overload)
132
112
  end
133
113
 
134
- # @return [Array<::YARD::Tag>]
114
+ def return_tags
115
+ object.tags(:return) + overloaded_return_tags
116
+ end
117
+
135
118
  def overloaded_return_tags
136
119
  overload_tags.map do |overload_tag|
137
120
  overload_tag.tag(:return)
138
121
  end.compact
139
122
  end
140
-
141
- # @return [Array<::YARD::Tag>]
142
- def return_tags
143
- object.tags(:return) +
144
- overloaded_return_tags +
145
- attributed_return_tags
146
- end
147
-
148
- # Returns +true+ if a return value is described by words.
149
- def return_described_via_tag?
150
- return_tags.any? do |t|
151
- return_tag_describes_unusable_value?(t) ||
152
- !t.text.empty? && !YARD.implicit_tag?(t, self)
153
- end
154
- end
155
-
156
- def return_tag_describes_unusable_value?(t)
157
- return if t.types.nil?
158
- t.types.size == 1 && %w(void nil nothing).include?(t.types.first)
159
- end
160
123
  end
161
124
  end
162
125
  end
@@ -7,11 +7,9 @@ module Inch
7
7
  class MethodParameterObject
8
8
  attr_reader :name # @return [String]
9
9
 
10
- # @param method [YARD::Object::MethodObject] the method the
11
- # parameter belongs to
10
+ # @param method [YARD::Object::MethodObject] the method the parameter belongs to
12
11
  # @param name [String] the name of the parameter
13
- # @param in_signature [String] how the parameter is noted in the
14
- # method's signature
12
+ # @param in_signature [String] how the parameter is noted in the method's signature
15
13
  # @param tag [YARD::Tags::Tag] the Tag object for the parameter
16
14
  def initialize(method, name, in_signature, tag)
17
15
  @method = method
@@ -23,8 +21,7 @@ module Inch
23
21
  BAD_NAME_EXCEPTIONS = %w(id)
24
22
  BAD_NAME_THRESHOLD = 3
25
23
 
26
- # @return [Boolean] +true+ if the name of the parameter is
27
- # uncommunicative
24
+ # @return [Boolean] +true+ if the name of the parameter is uncommunicative
28
25
  def bad_name?
29
26
  return false if BAD_NAME_EXCEPTIONS.include?(name)
30
27
  name.size < BAD_NAME_THRESHOLD || name =~ /[0-9]$/
@@ -55,8 +52,7 @@ module Inch
55
52
  @tag && @tag.types && !@tag.types.empty?
56
53
  end
57
54
 
58
- # @return [Boolean] +true+ if the parameter is mentioned in the
59
- # docs, but not present in the method's signature
55
+ # @return [Boolean] +true+ if the parameter is mentioned in the docs, but not present in the method's signature
60
56
  def wrongly_mentioned?
61
57
  mentioned? && !@in_signature
62
58
  end
@@ -71,7 +67,7 @@ module Inch
71
67
  if @method.docstring.describes_parameter?(name)
72
68
  true
73
69
  else
74
- unsplatted = name.gsub(/^[\&\*]/, "")
70
+ unsplatted = name.gsub(/^[\&\*]/, '')
75
71
  @method.docstring.describes_parameter?(unsplatted)
76
72
  end
77
73
  end
@@ -80,7 +76,7 @@ module Inch
80
76
  if @method.docstring.mentions_parameter?(name)
81
77
  true
82
78
  else
83
- unsplatted = name.gsub(/^[\&\*]/, "")
79
+ unsplatted = name.gsub(/^[\&\*]/, '')
84
80
  @method.docstring.mentions_parameter?(unsplatted)
85
81
  end
86
82
  end
@@ -8,13 +8,11 @@ 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
12
- # normal signature is used
11
+ # @param method [::YARD::Tags::Tag,nil] if nil, the method's normal signature is used
13
12
  def initialize(method, yard_tag = nil)
14
13
  @method = method
15
14
  @yard_tag = yard_tag
16
- @docstring =
17
- Provider::YARD::Docstring.new(relevant_object.docstring)
15
+ @docstring = Provider::YARD::Docstring.new(relevant_object.docstring)
18
16
  end
19
17
 
20
18
  def all_signature_parameter_names
@@ -45,28 +43,26 @@ module Inch
45
43
  # @param name [String,Symbol]
46
44
  # @return [MethodParameterObject]
47
45
  def parameter(name)
48
- parameters.find { |p| p.name == name.to_s }
46
+ parameters.detect { |p| p.name == name.to_s }
49
47
  end
50
48
 
51
49
  # Returns +true+ if the other signature is identical to self
52
50
  # @param other [MethodSignature]
53
51
  # @return [Boolean]
54
52
  def same?(other)
55
- all_signature_parameter_names ==
56
- other.all_signature_parameter_names
53
+ all_signature_parameter_names == other.all_signature_parameter_names
57
54
  end
58
55
 
59
56
  # Returns the actual signature of the method.
60
57
  # @return [String]
61
58
  def signature
62
- relevant_object.signature.gsub(/^(def\ )/, "")
59
+ relevant_object.signature.gsub(/^(def\ )/, '')
63
60
  end
64
61
 
65
62
  private
66
63
 
67
64
  def all_parameter_names
68
- all_names = all_signature_parameter_names +
69
- parameter_tags.map(&:name)
65
+ all_names = all_signature_parameter_names + parameter_tags.map(&:name)
70
66
  all_names.map do |name|
71
67
  normalize_parameter_name(name) if name
72
68
  end.compact.uniq
@@ -94,11 +90,11 @@ module Inch
94
90
  # @param name [String] parameter name
95
91
  # @return [String]
96
92
  def normalize_parameter_name(name)
97
- name.gsub(/[\&\*\$\[\]]/, "")
93
+ name.gsub(/[\&\*\$\[\]]/, '')
98
94
  end
99
95
 
100
96
  def parameter_tag(param_name)
101
- parameter_tags.find do |tag|
97
+ parameter_tags.detect do |tag|
102
98
  tag.name == param_name
103
99
  end
104
100
  end
@@ -28,7 +28,9 @@ module Inch
28
28
 
29
29
  # called by MethodObject#getter?
30
30
  def child(name)
31
- children.find { |child| child.name == name } if children
31
+ if children
32
+ children.detect { |child| child.name == name }
33
+ end
32
34
  end
33
35
 
34
36
  def children
@@ -36,6 +38,7 @@ module Inch
36
38
  YARD::Object.for(o)
37
39
  end
38
40
  end
41
+
39
42
  end
40
43
  end
41
44
  end
@@ -11,7 +11,7 @@ module Inch
11
11
  # @see #parse
12
12
  # @return [CodeObject::Provider::YARD::Parser] the instance that ran
13
13
  def self.parse(*args)
14
- parser = new
14
+ parser = self.new
15
15
  parser.parse(*args)
16
16
  parser
17
17
  end
@@ -46,8 +46,8 @@ module Inch
46
46
  object.base_dir = dir
47
47
 
48
48
  object.aliases_fullnames.each do |fullname|
49
- alias_object = objects.find { |o| o.fullname == fullname }
50
- alias_object.aliased_object_fullname = object.fullname
49
+ _alias = objects.detect { |o| o.fullname == fullname }
50
+ _alias.aliased_object_fullname = object.fullname
51
51
  end
52
52
  end
53
53
  end
@@ -11,7 +11,7 @@ module Inch
11
11
  # @return [CodeObject::Proxy::Base]
12
12
  def for(code_object)
13
13
  attributes = Converter.to_hash(code_object)
14
- class_for(code_object).new(attributes)
14
+ proxy_object = class_for(code_object).new(attributes)
15
15
  end
16
16
 
17
17
  private
@@ -21,7 +21,7 @@ module Inch
21
21
  # @param code_object [YARD::CodeObject]
22
22
  # @return [Class]
23
23
  def class_for(code_object)
24
- class_name = code_object.class.to_s.split("::").last
24
+ class_name = code_object.class.to_s.split('::').last
25
25
  const_get(class_name)
26
26
  end
27
27
  end
@@ -29,11 +29,10 @@ module Inch
29
29
  end
30
30
  end
31
31
 
32
- require "inch/code_object/proxy/base"
33
- require "inch/code_object/proxy/namespace_object"
34
- require "inch/code_object/proxy/class_object"
35
- require "inch/code_object/proxy/class_variable_object"
36
- require "inch/code_object/proxy/constant_object"
37
- require "inch/code_object/proxy/method_object"
38
- require "inch/code_object/proxy/method_parameter_object"
39
- require "inch/code_object/proxy/module_object"
32
+ require 'inch/code_object/proxy/base'
33
+ require 'inch/code_object/proxy/namespace_object'
34
+ require 'inch/code_object/proxy/class_object'
35
+ require 'inch/code_object/proxy/constant_object'
36
+ require 'inch/code_object/proxy/method_object'
37
+ require 'inch/code_object/proxy/method_parameter_object'
38
+ require 'inch/code_object/proxy/module_object'
@@ -1,4 +1,4 @@
1
- require "forwardable"
1
+ require 'forwardable'
2
2
 
3
3
  module Inch
4
4
  module CodeObject
@@ -42,9 +42,9 @@ module Inch
42
42
 
43
43
  # @return [Symbol]
44
44
  def grade
45
- @grade ||= Evaluation.new_grade_lists.find do |range|
46
- range.scores.include?(score)
47
- end.grade
45
+ @grade ||= Evaluation.new_grade_lists.detect { |range|
46
+ range.scores.include?(score)
47
+ }.grade
48
48
  end
49
49
 
50
50
  # @return [Boolean] if the current object is an alias for something else
@@ -52,10 +52,9 @@ module Inch
52
52
  !aliased_object.nil?
53
53
  end
54
54
 
55
- # @return [CodeObject::Proxy::Base] the object the current object is an
56
- # alias of
55
+ # @return [CodeObject::Proxy::Base] the object the current object is an alias of
57
56
  def aliased_object
58
- object_lookup.find(self[:aliased_object_fullname])
57
+ object_lookup.find( self[:aliased_object_fullname] )
59
58
  end
60
59
 
61
60
  # @return [Boolean] +true+ if the object has an @api tag
@@ -171,10 +170,9 @@ module Inch
171
170
  self[:nodoc?]
172
171
  end
173
172
 
174
- # @return [CodeObject::Proxy::Base,nil] the parent of the current object
175
- # or +nil+
173
+ # @return [CodeObject::Proxy::Base,nil] the parent of the current object or +nil+
176
174
  def parent
177
- object_lookup.find(self[:parent_fullname])
175
+ object_lookup.find( self[:parent_fullname] )
178
176
  end
179
177
 
180
178
  def private?
@@ -207,7 +205,7 @@ module Inch
207
205
  end
208
206
 
209
207
  def type
210
- self.class.to_s.gsub(/Object$/, "")
208
+ self.class.to_s.gsub(/Object$/, '')
211
209
  end
212
210
 
213
211
  # @return [Boolean] +true+ if the object has no documentation at all
@@ -235,7 +233,7 @@ module Inch
235
233
  end
236
234
 
237
235
  def inspect
238
- "#<#{self.class}: #{fullname}>"
236
+ "#<#{self.class.to_s}: #{fullname}>"
239
237
  end
240
238
  end
241
239
  end
@@ -36,7 +36,7 @@ module Inch
36
36
  end
37
37
 
38
38
  def parameter(name)
39
- parameters.find { |p| p.name == name.to_s }
39
+ parameters.detect { |p| p.name == name.to_s }
40
40
  end
41
41
 
42
42
  def parameters
@@ -50,8 +50,7 @@ module Inch
50
50
  end
51
51
 
52
52
  def overridden_method
53
- @overridden_method ||=
54
- object_lookup.find(self[:overridden_method_fullname])
53
+ @overridden_method ||= object_lookup.find(self[:overridden_method_fullname])
55
54
  end
56
55
 
57
56
  def return_mentioned?
@@ -14,8 +14,7 @@ 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
18
- # uncommunicative
17
+ # @return [Boolean] +true+ if the name of the parameter is uncommunicative
19
18
  def bad_name?
20
19
  return false if BAD_NAME_EXCEPTIONS.include?(name)
21
20
  name.size < BAD_NAME_THRESHOLD || name =~ /[0-9]$/
@@ -39,7 +38,7 @@ module Inch
39
38
  def name
40
39
  self[:name]
41
40
  end
42
- alias_method :fullname, :name
41
+ alias fullname name
43
42
 
44
43
  # @return [Boolean] +true+ if the parameter is a splat argument
45
44
  def splat?
@@ -51,8 +50,7 @@ module Inch
51
50
  self[:typed?]
52
51
  end
53
52
 
54
- # @return [Boolean] +true+ if the parameter is mentioned in the docs,
55
- # but not present in the method's signature
53
+ # @return [Boolean] +true+ if the parameter is mentioned in the docs, but not present in the method's signature
56
54
  def wrongly_mentioned?
57
55
  self[:wrongly_mentioned?]
58
56
  end
@@ -15,7 +15,8 @@ module Inch
15
15
  end
16
16
  end
17
17
 
18
- require "inch/codebase/proxy"
19
- require "inch/codebase/objects"
20
- require "inch/codebase/objects_filter"
21
- require "inch/codebase/serializer"
18
+ require 'inch/codebase/proxy'
19
+ require 'inch/codebase/objects'
20
+ require 'inch/codebase/objects_filter'
21
+ require 'inch/codebase/serializer'
22
+
@@ -41,14 +41,16 @@ module Inch
41
41
  end
42
42
 
43
43
  def filter_depth
44
- @list = @list.select { |o| o.depth <= options.depth } if options.depth
44
+ if options.depth
45
+ @list = @list.select { |o| o.depth <= options.depth }
46
+ end
45
47
  end
46
48
 
47
49
  def filter_visibility
48
50
  @list = @list.select do |o|
49
51
  options.visibility.include?(o.visibility)
50
52
  end
51
- unless options.visibility.include?(:private)
53
+ if !options.visibility.include?(:private)
52
54
  @list = @list.reject do |o|
53
55
  o.tagged_as_private?
54
56
  end
@@ -9,12 +9,12 @@ module Inch
9
9
 
10
10
  def self.save(codebase, filename)
11
11
  content = Marshal.dump(codebase)
12
- FileUtils.mkdir_p(File.dirname(filename))
13
- File.open(filename, "wb") { |file| file.write(content) }
12
+ FileUtils.mkdir_p( File.dirname(filename) )
13
+ File.open(filename, 'wb') { |file| file.write(content) }
14
14
  end
15
15
 
16
16
  def self.load(filename)
17
- codebase = Marshal.load(File.binread(filename))
17
+ codebase = Marshal.load( File.binread(filename) )
18
18
  codebase.objects.each do |object|
19
19
  object.object_lookup = codebase.objects
20
20
  end
@@ -20,5 +20,5 @@ module Inch
20
20
  end
21
21
  end
22
22
 
23
- require "inch/config/base"
24
- require "inch/config/codebase"
23
+ require 'inch/config/base'
24
+ require 'inch/config/codebase'