inch 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +15 -0
  3. data/.rubocop_todo.yml +113 -0
  4. data/CHANGELOG.md +6 -0
  5. data/Gemfile +5 -2
  6. data/README.md +2 -2
  7. data/Rakefile +2 -2
  8. data/bin/inch +3 -2
  9. data/config/defaults.rb +7 -0
  10. data/inch.gemspec +7 -7
  11. data/lib/inch.rb +9 -10
  12. data/lib/inch/api.rb +10 -10
  13. data/lib/inch/api/compare.rb +2 -2
  14. data/lib/inch/api/compare/code_objects.rb +2 -3
  15. data/lib/inch/api/compare/codebases.rb +1 -1
  16. data/lib/inch/api/diff.rb +6 -9
  17. data/lib/inch/api/options/base.rb +4 -4
  18. data/lib/inch/api/options/suggest.rb +1 -1
  19. data/lib/inch/api/stats.rb +0 -1
  20. data/lib/inch/api/suggest.rb +8 -9
  21. data/lib/inch/cli.rb +6 -6
  22. data/lib/inch/cli/command.rb +15 -15
  23. data/lib/inch/cli/command/base.rb +2 -2
  24. data/lib/inch/cli/command/console.rb +5 -5
  25. data/lib/inch/cli/command/diff.rb +7 -8
  26. data/lib/inch/cli/command/inspect.rb +5 -4
  27. data/lib/inch/cli/command/list.rb +4 -4
  28. data/lib/inch/cli/command/options/base.rb +8 -8
  29. data/lib/inch/cli/command/options/base_list.rb +9 -5
  30. data/lib/inch/cli/command/options/console.rb +4 -3
  31. data/lib/inch/cli/command/options/diff.rb +6 -4
  32. data/lib/inch/cli/command/options/inspect.rb +2 -2
  33. data/lib/inch/cli/command/options/list.rb +4 -3
  34. data/lib/inch/cli/command/options/show.rb +2 -2
  35. data/lib/inch/cli/command/options/stats.rb +2 -1
  36. data/lib/inch/cli/command/options/suggest.rb +6 -3
  37. data/lib/inch/cli/command/output/base.rb +2 -4
  38. data/lib/inch/cli/command/output/console.rb +4 -5
  39. data/lib/inch/cli/command/output/diff.rb +6 -6
  40. data/lib/inch/cli/command/output/inspect.rb +6 -8
  41. data/lib/inch/cli/command/output/list.rb +0 -1
  42. data/lib/inch/cli/command/output/show.rb +4 -5
  43. data/lib/inch/cli/command/output/stats.rb +21 -21
  44. data/lib/inch/cli/command/output/suggest.rb +28 -26
  45. data/lib/inch/cli/command/show.rb +4 -4
  46. data/lib/inch/cli/command/stats.rb +4 -4
  47. data/lib/inch/cli/command/suggest.rb +6 -6
  48. data/lib/inch/cli/command_parser.rb +6 -5
  49. data/lib/inch/cli/sparkline_helper.rb +2 -2
  50. data/lib/inch/cli/trace_helper.rb +1 -1
  51. data/lib/inch/cli/yardopts_helper.rb +4 -3
  52. data/lib/inch/code_object.rb +3 -3
  53. data/lib/inch/code_object/converter.rb +6 -8
  54. data/lib/inch/code_object/provider.rb +1 -1
  55. data/lib/inch/code_object/provider/yard.rb +10 -12
  56. data/lib/inch/code_object/provider/yard/docstring.rb +53 -21
  57. data/lib/inch/code_object/provider/yard/nodoc_helper.rb +3 -3
  58. data/lib/inch/code_object/provider/yard/object.rb +11 -9
  59. data/lib/inch/code_object/provider/yard/object/base.rb +33 -9
  60. data/lib/inch/code_object/provider/yard/object/class_variable_object.rb +12 -0
  61. data/lib/inch/code_object/provider/yard/object/method_object.rb +36 -11
  62. data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +2 -2
  63. data/lib/inch/code_object/provider/yard/object/method_signature.rb +11 -8
  64. data/lib/inch/code_object/provider/yard/object/namespace_object.rb +1 -4
  65. data/lib/inch/code_object/provider/yard/parser.rb +2 -2
  66. data/lib/inch/code_object/proxy.rb +10 -9
  67. data/lib/inch/code_object/proxy/base.rb +8 -8
  68. data/lib/inch/code_object/proxy/class_variable_object.rb +8 -0
  69. data/lib/inch/code_object/proxy/method_object.rb +3 -2
  70. data/lib/inch/code_object/proxy/method_parameter_object.rb +1 -1
  71. data/lib/inch/codebase.rb +4 -5
  72. data/lib/inch/codebase/objects_filter.rb +2 -4
  73. data/lib/inch/codebase/serializer.rb +3 -3
  74. data/lib/inch/config.rb +2 -2
  75. data/lib/inch/config/base.rb +0 -1
  76. data/lib/inch/config/codebase.rb +3 -3
  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 +16 -15
  80. data/lib/inch/evaluation/grade_list.rb +2 -2
  81. data/lib/inch/evaluation/object_schema.rb +1 -1
  82. data/lib/inch/evaluation/proxy.rb +8 -7
  83. data/lib/inch/evaluation/proxy/base.rb +12 -7
  84. data/lib/inch/evaluation/proxy/class_variable_object.rb +19 -0
  85. data/lib/inch/evaluation/proxy/constant_object.rb +1 -1
  86. data/lib/inch/evaluation/proxy/method_object.rb +12 -5
  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/class_variable.rb +55 -0
  91. data/lib/inch/evaluation/role/method.rb +0 -1
  92. data/lib/inch/evaluation/role/method_parameter.rb +2 -1
  93. data/lib/inch/evaluation/role/object.rb +2 -2
  94. data/lib/inch/rake.rb +2 -2
  95. data/lib/inch/rake/suggest.rb +2 -2
  96. data/lib/inch/utils/shell_helper.rb +1 -1
  97. data/lib/inch/utils/ui.rb +5 -5
  98. data/lib/inch/utils/weighted_list.rb +2 -3
  99. data/lib/inch/version.rb +1 -1
  100. data/test/fixtures/simple/lib/broken.rb +35 -7
  101. data/test/fixtures/simple/lib/broken_ruby_2_0_features.rb +7 -0
  102. data/test/fixtures/simple/lib/directives.rb +8 -0
  103. data/test/fixtures/simple/lib/foo.rb +17 -0
  104. data/test/integration/api/compare/codebases.rb +1 -1
  105. data/test/integration/cli/command/console_test.rb +5 -5
  106. data/test/integration/cli/command/inspect_test.rb +4 -5
  107. data/test/integration/cli/command/list_test.rb +3 -4
  108. data/test/integration/cli/command/show_test.rb +4 -4
  109. data/test/integration/cli/command/stats_test.rb +2 -2
  110. data/test/integration/cli/command/suggest_test.rb +7 -7
  111. data/test/integration/stats_options_test.rb +3 -3
  112. data/test/integration/visibility_options_test.rb +13 -13
  113. data/test/shared/base_list.rb +4 -3
  114. data/test/test_helper.rb +16 -5
  115. data/test/unit/api/filter_test.rb +7 -7
  116. data/test/unit/api/get_test.rb +1 -1
  117. data/test/unit/api/list_test.rb +1 -1
  118. data/test/unit/api/options/base_test.rb +3 -3
  119. data/test/unit/api/stats_test.rb +1 -1
  120. data/test/unit/api/suggest_test.rb +3 -3
  121. data/test/unit/cli/arguments_test.rb +1 -1
  122. data/test/unit/cli/command/base_test.rb +1 -1
  123. data/test/unit/cli/command/options/base_list_test.rb +2 -2
  124. data/test/unit/cli/command/options/base_object_test.rb +1 -1
  125. data/test/unit/cli/command/options/base_test.rb +1 -1
  126. data/test/unit/cli/command_parser_test.rb +2 -2
  127. data/test/unit/cli/trace_helper_test.rb +1 -1
  128. data/test/unit/cli/yardopts_helper_test.rb +4 -3
  129. data/test/unit/code_object/converter_test.rb +1 -1
  130. data/test/unit/code_object/provider/yard/docstring_test.rb +105 -28
  131. data/test/unit/code_object/provider/yard/nodoc_helper_test.rb +5 -5
  132. data/test/unit/code_object/provider/yard/object/method_object_test.rb +20 -10
  133. data/test/unit/code_object/provider/yard_test.rb +4 -4
  134. data/test/unit/code_object/provider_test.rb +1 -1
  135. data/test/unit/code_object/proxy/method_object_test.rb +366 -262
  136. data/test/unit/code_object/proxy_test.rb +1 -1
  137. data/test/unit/codebase/objects_test.rb +2 -2
  138. data/test/unit/codebase/proxy_test.rb +1 -1
  139. data/test/unit/config/codebase_test.rb +1 -1
  140. data/test/unit/evaluation/role/base_test.rb +1 -1
  141. data/test/unit/utils/ui_test.rb +4 -4
  142. data/test/unit/utils/weighted_list_test.rb +7 -4
  143. metadata +12 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef6e8adf9c15caf207085b29dfd1645055779b1d
4
- data.tar.gz: 742b78011452c52a063b5bdfb753704b8cff4a13
3
+ metadata.gz: 23c7cb734a65a10fc7e06dc15dae0ca5b845aa8e
4
+ data.tar.gz: 599a33be129999facc125af4435facc9bf7f4ab6
5
5
  SHA512:
6
- metadata.gz: 06175a21a0890883b2385cb667d2b6e3520508c42bd0e7567e3463be0bca921497d595f87c5ab7cfd64f5eee41edc18c38c4dc98047048715624f32a7711fee1
7
- data.tar.gz: f8b9a873aa09601d5346aded469c0e11612ad1553e3c646a5d4bc8fe0b19484160517df21f7dbe8e18be44c124df405a385bc5f7e43d89fa0841ae37df6f6846
6
+ metadata.gz: 5b3402fe65142f5c2700ea5bcdec56ded001b44c5341ef72d6caf6a2f287ed6deca1bd2415d8dca953f777bc061181f3bb6f7afafdcf1bfe93c45a3109f57bc4
7
+ data.tar.gz: 0fe53ec630e0a1dec9763b59b1aebb0cf6c9941c79b6f1824a75eb5364b3bc2e2b5ce3cacecf2c749a0d7edf17f953570ef185413f55a26f7fa2b85004a2c093
@@ -0,0 +1,15 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ Include:
5
+ - '**/*.gemspec'
6
+ - '**/Gemfile'
7
+ - '**/Rakefile'
8
+ Exclude:
9
+ - 'test/fixtures/**/*'
10
+
11
+ Style/Encoding:
12
+ Enabled: true
13
+
14
+ Style/StringLiterals:
15
+ EnforcedStyle: double_quotes
@@ -0,0 +1,113 @@
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.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ # Offense count: 2
9
+ Lint/AmbiguousOperator:
10
+ Enabled: false
11
+
12
+ # Offense count: 87
13
+ Lint/AmbiguousRegexpLiteral:
14
+ Enabled: false
15
+
16
+ # Offense count: 9
17
+ # Configuration parameters: AllowSafeAssignment.
18
+ Lint/AssignmentInCondition:
19
+ Enabled: false
20
+
21
+ # Offense count: 1
22
+ Lint/Debugger:
23
+ Enabled: false
24
+
25
+ # Offense count: 3
26
+ Lint/UnderscorePrefixedVariableName:
27
+ Enabled: false
28
+
29
+ # Offense count: 6
30
+ # Cop supports --auto-correct.
31
+ Lint/UnusedMethodArgument:
32
+ Enabled: false
33
+
34
+ # Offense count: 6
35
+ Style/AccessorMethodName:
36
+ Enabled: false
37
+
38
+ # Offense count: 3
39
+ Style/AsciiComments:
40
+ Enabled: false
41
+
42
+ # Offense count: 1
43
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
44
+ Style/ClassAndModuleChildren:
45
+ Enabled: false
46
+
47
+ # Offense count: 5
48
+ # Configuration parameters: CountComments.
49
+ Style/ClassLength:
50
+ Max: 201
51
+
52
+ # Offense count: 2
53
+ Style/CyclomaticComplexity:
54
+ Max: 7
55
+
56
+ # Offense count: 87
57
+ Style/Documentation:
58
+ Enabled: false
59
+
60
+ # Offense count: 2
61
+ Style/DoubleNegation:
62
+ Enabled: false
63
+
64
+ # Offense count: 11
65
+ # Configuration parameters: MinBodyLength.
66
+ Style/GuardClause:
67
+ Enabled: false
68
+
69
+ # Offense count: 1
70
+ # Configuration parameters: MaxLineLength.
71
+ Style/IfUnlessModifier:
72
+ Enabled: false
73
+
74
+ # Offense count: 31
75
+ # Configuration parameters: AllowURI.
76
+ Style/LineLength:
77
+ Max: 123
78
+
79
+ # Offense count: 22
80
+ # Configuration parameters: CountComments.
81
+ Style/MethodLength:
82
+ Max: 34
83
+
84
+ # Offense count: 2
85
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
86
+ Style/MethodName:
87
+ Enabled: false
88
+
89
+ # Offense count: 22
90
+ # Configuration parameters: NamePrefixBlacklist.
91
+ Style/PredicateName:
92
+ Enabled: false
93
+
94
+ # Offense count: 2
95
+ # Configuration parameters: Methods.
96
+ Style/SingleLineBlockParams:
97
+ Enabled: false
98
+
99
+ # Offense count: 45
100
+ # Cop supports --auto-correct.
101
+ Style/SingleSpaceBeforeFirstArg:
102
+ Enabled: false
103
+
104
+ # Offense count: 1
105
+ # Cop supports --auto-correct.
106
+ Style/SpecialGlobalVars:
107
+ Enabled: false
108
+
109
+ # Offense count: 9
110
+ # Cop supports --auto-correct.
111
+ # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist.
112
+ Style/TrivialAccessors:
113
+ Enabled: false
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## 0.5.0 (pre)
5
+
6
+ - CLI classes must be required seperately from now on
7
+ - external data read by NoDocHelper is encoded as UTF-8
8
+
9
+
4
10
  ## 0.4.6
5
11
 
6
12
  - Do not count @yield tag if it is auto-assigned via YARD
data/Gemfile CHANGED
@@ -1,6 +1,9 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in inch.gemspec
4
4
  gemspec
5
5
 
6
- gem 'simplecov', :require => false, :group => :test
6
+ group :test do
7
+ gem "simplecov", require: false
8
+ gem "rubocop", require: false
9
+ end
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Inch [![Build Status](https://travis-ci.org/rrrene/inch.png)](https://travis-ci.org/rrrene/inch) [![Code Climate](https://codeclimate.com/github/rrrene/inch.png)](https://codeclimate.com/github/rrrene/inch) [![Inline docs](http://inch-pages.github.io/github/rrrene/inch.png)](http://inch-pages.github.io/github/rrrene/inch)
1
+ # Inch [![Build Status](https://travis-ci.org/rrrene/inch.png)](https://travis-ci.org/rrrene/inch) [![Code Climate](https://codeclimate.com/github/rrrene/inch.png)](https://codeclimate.com/github/rrrene/inch) [![Inline docs](http://inch-ci.org/github/rrrene/inch.png)](http://inch-ci.org/github/rrrene/inch)
2
2
 
3
3
  `inch` gives you hints where to improve your docs. One Inch at a time.
4
4
 
@@ -18,7 +18,7 @@ If there are no inline-docs yet, `inch` can tell you where to start.
18
18
 
19
19
  Add this line to your application's Gemfile:
20
20
 
21
- gem 'inch'
21
+ gem 'inch', require: false
22
22
 
23
23
  And then execute:
24
24
 
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
- require 'rake/testtask'
3
+ require "rake/testtask"
4
4
 
5
5
  Rake::TestTask.new do |t|
6
6
  t.pattern = "test/**/*_test.rb"
@@ -14,4 +14,4 @@ Rake::TestTask.new(:"test:integration") do |t|
14
14
  t.pattern = "test/integration/**/*_test.rb"
15
15
  end
16
16
 
17
- task :default => :test
17
+ task default: :test
data/bin/inch CHANGED
@@ -12,11 +12,12 @@ def find_lib_path
12
12
  while File.symlink?(path)
13
13
  path = File.expand_path(File.readlink(path), File.dirname(path))
14
14
  end
15
- File.join(File.dirname(File.expand_path(path)), '..', 'lib')
15
+ File.join(File.dirname(File.expand_path(path)), "..", "lib")
16
16
  end
17
17
 
18
18
  $LOAD_PATH.unshift(find_lib_path)
19
19
 
20
- require 'inch'
20
+ require "inch"
21
+ require "inch/cli"
21
22
 
22
23
  Inch::CLI::CommandParser.run(*ARGV)
@@ -64,6 +64,13 @@ Inch::Config.run do
64
64
  unconsidered_tag 0.2
65
65
  end
66
66
 
67
+ schema(:ClassVariableObject) do
68
+ docstring 1.0
69
+
70
+ # optional:
71
+ unconsidered_tag 0.2
72
+ end
73
+
67
74
  schema(:ClassObject) do
68
75
  docstring 1.0
69
76
 
@@ -1,21 +1,21 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'inch/version'
4
+ require "inch/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "inch"
8
8
  spec.version = Inch::VERSION
9
9
  spec.authors = ["René Föhring"]
10
10
  spec.email = ["rf@bamaru.de"]
11
- spec.summary = %q{Documentation measurement tool for Ruby}
12
- spec.description = %q{Documentation measurement tool for Ruby, based on YARD.}
11
+ spec.summary = "Documentation measurement tool for Ruby"
12
+ spec.description = "Documentation measurement tool for Ruby, based on YARD."
13
13
  spec.homepage = "http://trivelop.de/inch/"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(/^(test|spec|features)\//)
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.5"
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "minitest", "~> 5.2"
24
24
 
25
25
  spec.add_dependency "pry"
26
- spec.add_dependency 'sparkr', ">= 0.2.0"
26
+ spec.add_dependency "sparkr", ">= 0.2.0"
27
27
  spec.add_dependency "term-ansicolor"
28
28
  spec.add_dependency "yard", "~> 0.8.7"
29
29
  end
@@ -1,16 +1,15 @@
1
- require 'inch/version'
1
+ require "inch/version"
2
2
 
3
3
  module Inch
4
4
  end
5
5
 
6
- require 'forwardable'
6
+ require "forwardable"
7
7
 
8
- require 'inch/api'
9
- require 'inch/core_ext'
10
- require 'inch/codebase'
11
- require 'inch/code_object'
12
- require 'inch/evaluation'
13
- require 'inch/cli'
8
+ require "inch/api"
9
+ require "inch/core_ext"
10
+ require "inch/codebase"
11
+ require "inch/code_object"
12
+ require "inch/evaluation"
14
13
 
15
- require 'inch/config'
16
- require File.join(File.dirname(__FILE__), '..', 'config', 'defaults.rb')
14
+ require "inch/config"
15
+ require File.join(File.dirname(__FILE__), "..", "config", "defaults.rb")
@@ -23,14 +23,14 @@ module Inch
23
23
  end
24
24
  end
25
25
 
26
- require 'inch/api/options/base'
27
- require 'inch/api/options/filter'
28
- require 'inch/api/options/suggest'
26
+ require "inch/api/options/base"
27
+ require "inch/api/options/filter"
28
+ require "inch/api/options/suggest"
29
29
 
30
- require 'inch/api/compare'
31
- require 'inch/api/filter'
32
- require 'inch/api/get'
33
- require 'inch/api/list'
34
- require 'inch/api/suggest'
35
- require 'inch/api/stats'
36
- require 'inch/api/diff'
30
+ require "inch/api/compare"
31
+ require "inch/api/filter"
32
+ require "inch/api/get"
33
+ require "inch/api/list"
34
+ require "inch/api/suggest"
35
+ require "inch/api/stats"
36
+ require "inch/api/diff"
@@ -1,2 +1,2 @@
1
- require 'inch/api/compare/code_objects'
2
- require 'inch/api/compare/codebases'
1
+ require "inch/api/compare/code_objects"
2
+ require "inch/api/compare/codebases"
@@ -3,11 +3,11 @@ module Inch
3
3
  module Compare
4
4
  class CodeObjects
5
5
  attr_reader :before, :after
6
-
6
+
7
7
  def initialize(object1, object2)
8
8
  @before, @after = object1, object2
9
9
  if @before.object_id == @after.object_id
10
- raise "@before and @after are identical ruby objects. this is bad."
10
+ fail "@before and @after are identical ruby objects. this is bad."
11
11
  end
12
12
  end
13
13
 
@@ -23,7 +23,6 @@ module Inch
23
23
  @after.grade
24
24
  end
25
25
 
26
-
27
26
  def added?
28
27
  @before.nil? && !@after.nil?
29
28
  end
@@ -31,7 +31,7 @@ module Inch
31
31
  end
32
32
 
33
33
  def find(fullname)
34
- comparisons.detect do |comparison|
34
+ comparisons.find do |comparison|
35
35
  comparison.fullname == fullname
36
36
  end
37
37
  end
@@ -1,4 +1,4 @@
1
- require 'inch/utils/shell_helper'
1
+ require "inch/utils/shell_helper"
2
2
 
3
3
  module Inch
4
4
  module API
@@ -20,10 +20,10 @@ module Inch
20
20
  @work_dir = dir
21
21
  @codebase_old = codebase_for(before_rev)
22
22
  @codebase_new = if after_rev.nil?
23
- Codebase.parse(work_dir)
24
- else
25
- codebase_for(after_rev)
26
- end
23
+ Codebase.parse(work_dir)
24
+ else
25
+ codebase_for(after_rev)
26
+ end
27
27
  @comparer = API::Compare::Codebases.new(@codebase_old, @codebase_new)
28
28
  end
29
29
 
@@ -42,9 +42,7 @@ module Inch
42
42
 
43
43
  def codebase_from_cache(revision)
44
44
  filename = Codebase::Serializer.filename(revision)
45
- if File.exist?(filename)
46
- Codebase::Serializer.load(filename)
47
- end
45
+ Codebase::Serializer.load(filename) if File.exist?(filename)
48
46
  end
49
47
 
50
48
  def codebase_from_copy(original_dir, revision)
@@ -65,7 +63,6 @@ module Inch
65
63
  def git_reset(dir, revision = nil)
66
64
  git dir, "reset --hard #{revision}"
67
65
  end
68
-
69
66
  end
70
67
  end
71
68
  end
@@ -33,10 +33,10 @@ module Inch
33
33
 
34
34
  def read(options_or_hash, name)
35
35
  value = if options_or_hash.is_a?(Hash)
36
- options_or_hash[name]
37
- else
38
- options_or_hash.send(name)
39
- end
36
+ options_or_hash[name]
37
+ else
38
+ options_or_hash.send(name)
39
+ end
40
40
  instance_variable_set("@#{name}", value)
41
41
  end
42
42
  end
@@ -1,4 +1,4 @@
1
- require 'inch/evaluation/proxy/base'
1
+ require "inch/evaluation/proxy/base"
2
2
 
3
3
  module Inch
4
4
  module API
@@ -1,7 +1,6 @@
1
1
  module Inch
2
2
  module API
3
3
  class Stats < Filter
4
-
5
4
  end
6
5
  end
7
6
  end
@@ -1,4 +1,4 @@
1
- require 'inch/utils/weighted_list'
1
+ require "inch/utils/weighted_list"
2
2
 
3
3
  module Inch
4
4
  module API
@@ -19,7 +19,6 @@ module Inch
19
19
  filter_objects_to_display
20
20
  end
21
21
 
22
-
23
22
  # @return [Array] all the objects that match +@options+
24
23
  def all_objects
25
24
  relevant_objects
@@ -52,15 +51,13 @@ module Inch
52
51
 
53
52
  list = Codebase::Objects.sort_by_priority(weighted_list.to_a.flatten)
54
53
 
55
- if list.size > object_count
56
- list = list[0...object_count]
57
- end
54
+ list = list[0...object_count] if list.size > object_count
58
55
  list
59
56
  end
60
57
 
61
58
  def files_sorted_by_importance
62
59
  list = all_filenames(relevant_objects).uniq.map do |filename|
63
- f = Evaluation::File.for(filename, relevant_objects)
60
+ Evaluation::File.for(filename, relevant_objects)
64
61
  end
65
62
 
66
63
  priority_list = list.select do |f|
@@ -68,7 +65,8 @@ module Inch
68
65
  relevant_priorities.include?(f.priority)
69
66
  end
70
67
 
71
- Codebase::Objects.sort_by_priority(priority_list.empty? ? list : priority_list)
68
+ Codebase::Objects.sort_by_priority(
69
+ priority_list.empty? ? list : priority_list)
72
70
  end
73
71
 
74
72
  def all_filenames(objects)
@@ -87,7 +85,7 @@ module Inch
87
85
  end
88
86
 
89
87
  def grade_list(grade_symbol)
90
- grade_lists.detect { |r| r.grade.to_sym == grade_symbol }
88
+ grade_lists.find { |r| r.grade.to_sym == grade_symbol }
91
89
  end
92
90
 
93
91
  def select_by_priority(list, min_priority)
@@ -99,7 +97,8 @@ module Inch
99
97
  end
100
98
 
101
99
  def relevant_objects
102
- @relevant_objects ||= select_by_priority(codebase.objects, @options.object_min_priority)
100
+ @relevant_objects ||= select_by_priority(codebase.objects,
101
+ @options.object_min_priority)
103
102
  end
104
103
 
105
104
  def relevant_priorities