inch 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +8 -27
  3. data/CHANGELOG.md +6 -2
  4. data/lib/inch/api/diff.rb +1 -1
  5. data/lib/inch/api/filter.rb +1 -1
  6. data/lib/inch/api/get.rb +1 -1
  7. data/lib/inch/api/options/filter.rb +0 -4
  8. data/lib/inch/api/options/suggest.rb +0 -4
  9. data/lib/inch/api/suggest.rb +1 -1
  10. data/lib/inch/cli/arguments.rb +2 -2
  11. data/lib/inch/cli/command/base.rb +2 -2
  12. data/lib/inch/cli/command/options/diff.rb +3 -3
  13. data/lib/inch/cli/command/output/base.rb +2 -2
  14. data/lib/inch/cli/command/output/suggest.rb +2 -1
  15. data/lib/inch/cli/sparkline_helper.rb +4 -4
  16. data/lib/inch/code_object/provider/yard/docstring.rb +8 -8
  17. data/lib/inch/code_object/provider/yard/nodoc_helper.rb +1 -1
  18. data/lib/inch/code_object/provider/yard/object.rb +1 -1
  19. data/lib/inch/code_object/provider/yard/object/base.rb +15 -18
  20. data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +8 -4
  21. data/lib/inch/code_object/provider/yard/object/method_signature.rb +2 -1
  22. data/lib/inch/code_object/provider/yard/parser.rb +2 -2
  23. data/lib/inch/code_object/proxy/base.rb +4 -2
  24. data/lib/inch/code_object/proxy/method_parameter_object.rb +4 -2
  25. data/lib/inch/config/codebase.rb +1 -1
  26. data/lib/inch/evaluation/file.rb +1 -1
  27. data/lib/inch/evaluation/proxy/base.rb +1 -3
  28. data/lib/inch/evaluation/role/method.rb +2 -1
  29. data/lib/inch/rake/suggest.rb +1 -0
  30. data/lib/inch/version.rb +1 -1
  31. data/test/unit/code_object/provider/yard/docstring_test.rb +2 -1
  32. data/test/unit/code_object/provider/yard/nodoc_helper_test.rb +2 -1
  33. data/test/unit/code_object/proxy/method_object_test.rb +14 -7
  34. data/test/unit/evaluation/role/base_test.rb +1 -1
  35. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23c7cb734a65a10fc7e06dc15dae0ca5b845aa8e
4
- data.tar.gz: 599a33be129999facc125af4435facc9bf7f4ab6
3
+ metadata.gz: 4c31501ddee3364461246eb390c64f95d04f7af3
4
+ data.tar.gz: 8f43411cc6757e519799d3d47c394ccd92641d3b
5
5
  SHA512:
6
- metadata.gz: 5b3402fe65142f5c2700ea5bcdec56ded001b44c5341ef72d6caf6a2f287ed6deca1bd2415d8dca953f777bc061181f3bb6f7afafdcf1bfe93c45a3109f57bc4
7
- data.tar.gz: 0fe53ec630e0a1dec9763b59b1aebb0cf6c9941c79b6f1824a75eb5364b3bc2e2b5ce3cacecf2c749a0d7edf17f953570ef185413f55a26f7fa2b85004a2c093
6
+ metadata.gz: 208f12e02a0725d03b5b7e255534272deb0497d59aece0480a40c3173bfda2b9ae3e6b3d2861df7636f9b6933019c4de0462539c7c4816a2957a5aba3324d609
7
+ data.tar.gz: 23376ecad96b2146c8ad18690b3bb44826f4315c80685858b8b8c4c7c219fd55794d237c56acae6fd49f7e9a4436b1302029825984e73ff153414ab40ce1c9f5
@@ -1,5 +1,5 @@
1
1
  # This configuration was generated by `rubocop --auto-gen-config`
2
- # on 2014-08-06 21:26:49 +0900 using RuboCop version 0.24.1.
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: 6
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: 201
41
+ Max: 195
51
42
 
52
43
  # Offense count: 2
53
44
  Style/CyclomaticComplexity:
54
45
  Max: 7
55
46
 
56
- # Offense count: 87
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: 31
65
+ # Offense count: 10
75
66
  # Configuration parameters: AllowURI.
76
67
  Style/LineLength:
77
- Max: 123
68
+ Max: 111
78
69
 
79
- # Offense count: 22
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: 1
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:
@@ -1,11 +1,15 @@
1
1
  # Changelog
2
2
 
3
3
 
4
- ## 0.5.0 (pre)
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
 
@@ -30,7 +30,7 @@ module Inch
30
30
  private
31
31
 
32
32
  def codebase_for(revision)
33
- if cached = codebase_from_cache(revision)
33
+ if (cached = codebase_from_cache(revision))
34
34
  cached
35
35
  else
36
36
  codebase = codebase_from_copy(work_dir, revision)
@@ -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
@@ -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)
@@ -16,10 +16,6 @@ module Inch
16
16
  attribute :undocumented
17
17
  attribute :depth
18
18
  end
19
-
20
- def self.Filter(options_or_hash)
21
- Filter.new(options_or_hash)
22
- end
23
19
  end
24
20
  end
25
21
  end
@@ -27,10 +27,6 @@ module Inch
27
27
  attribute :object_min_priority, DEFAULT_OBJECT_MIN_PRIORITY
28
28
  attribute :object_max_score, DEFAULT_OBJECT_MAX_SCORE
29
29
  end
30
-
31
- def self.Suggest(options_or_hash)
32
- Suggest.new(options_or_hash)
33
- end
34
30
  end
35
31
  end
36
32
  end
@@ -5,7 +5,7 @@ module Inch
5
5
  class Suggest < Filter
6
6
  def initialize(codebase, options)
7
7
  super
8
- @options = Options::Suggest(options)
8
+ @options = Options::Suggest.new(options)
9
9
  end
10
10
 
11
11
  def files
@@ -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
@@ -87,8 +87,8 @@ module Inch
87
87
  #
88
88
  # @abstract
89
89
  # @note Override with implementation
90
- # @param *args [Array<String>]
91
- def run(*args)
90
+ # @param *_args [Array<String>]
91
+ def run(*_args)
92
92
  fail NotImplementedError
93
93
  end
94
94
 
@@ -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 = get_pushed_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
- # get_pushed_rev # => "origin/master"
77
- def get_pushed_rev
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, _color)
27
+ def print_file_info(o, color)
28
28
  o.files.each do |f|
29
- echo "-> #{f.filename}:#{f.line_no}".color(_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 meeting the criteria defined in +options+
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(_grade_lists)
5
- grade_lists = _grade_lists.reverse
6
- list = grade_lists.map { |r| r.objects.size }
7
- __sparkline(list, grade_lists)
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 indented,
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 _name [String] the name of the method parameter
102
+ # @param name [String] the name of the method parameter
103
103
  # @return [Array<Regexp>]
104
- def mention_parameter_patterns(_name)
105
- name = Regexp.escape(_name)
104
+ def mention_parameter_patterns(name)
105
+ escaped_name = Regexp.escape(name)
106
106
  type = /<[^>]+>/
107
- arr = [
108
- name,
109
- /#{name}#{type}/ # matches "param1<String,nil>"
107
+ [
108
+ escaped_name,
109
+ /#{escaped_name}#{type}/ # matches "param1<String,nil>"
110
110
  ].map do |expr|
111
111
  [
112
112
  /#{expr}\:\:/, # param1::
@@ -81,7 +81,7 @@ module Inch
81
81
  def get_line_no(filename, line_number)
82
82
  f = File.open(filename)
83
83
  line_number.times { f.gets }
84
- result = $_
84
+ result = $LAST_READ_LINE
85
85
  f.close
86
86
  result.encode("UTF-8", "binary",
87
87
  invalid: :replace, undef: :replace, replace: "")
@@ -16,7 +16,7 @@ module Inch
16
16
  # @return [Provider::YARD::Object]
17
17
  def for(yard_object)
18
18
  @cache ||= {}
19
- if proxy_object = @cache[cache_key(yard_object)]
19
+ if (proxy_object = @cache[cache_key(yard_object)])
20
20
  proxy_object
21
21
  else
22
22
  @cache[cache_key(yard_object)] =
@@ -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 object
28
+ # @param object [YARD::CodeObjects::Base] the actual (YARD) code
29
+ # object
29
30
  def initialize(object)
30
31
  @object = object
31
- @__api_tag = __api_tag
32
- @__parent = __parent
33
- @__private_tag = __private_tag
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
- def api_tag
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 object or +nil+
57
- def child(name)
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 object
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
- def parent
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
- def private_tag
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 parameter belongs to
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 method's signature
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 uncommunicative
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 docs, but not present in the method's signature
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 normal signature is used
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
- _alias = objects.find { |o| o.fullname == fullname }
50
- _alias.aliased_object_fullname = object.fullname
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 alias of
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 or +nil+
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 uncommunicative
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, but not present in the method's signature
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
@@ -27,7 +27,7 @@ module Inch
27
27
  end
28
28
 
29
29
  def update_via_yaml(dir)
30
- if yaml = self.class.yaml(dir)
30
+ if (yaml = self.class.yaml(dir))
31
31
  Dir.chdir(dir) do
32
32
  update_files yaml["files"]
33
33
  end
@@ -50,7 +50,7 @@ module Inch
50
50
  class << self
51
51
  def for(filename, objects)
52
52
  @cache ||= {}
53
- if file = @cache[filename]
53
+ if (file = @cache[filename])
54
54
  file
55
55
  else
56
56
  @cache[filename] = new(filename, objects)
@@ -67,9 +67,7 @@ module Inch
67
67
  end
68
68
 
69
69
  # @return [Array<Evaluation::Role::Base>]
70
- def roles
71
- @roles
72
- end
70
+ attr_reader :roles
73
71
 
74
72
  protected
75
73
 
@@ -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 docs
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
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "rake"
4
4
  require "rake/tasklib"
5
+ require "inch/cli"
5
6
 
6
7
  module Inch
7
8
  # Holds all Rake tasks
@@ -1,3 +1,3 @@
1
1
  module Inch
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
3
3
  end
@@ -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 it" do
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#method_with_implicit_doc"
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 (text comment)" do
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 attr_accessor" do
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 attr_accessor" do
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 attr_accessor" do
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 attr_accessor" do
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, but not on the actual method" do
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 parameters" do
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?
@@ -13,7 +13,7 @@ class MockPublicRole < ::Inch::Evaluation::Role::Base
13
13
  end
14
14
 
15
15
  class MockIndifferentRole < ::Inch::Evaluation::Role::Base
16
- def self.applicable?(object)
16
+ def self.applicable?(_object)
17
17
  true
18
18
  end
19
19
  end
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.7
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-08 00:00:00.000000000 Z
11
+ date: 2014-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler