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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -11
- data/Gemfile +2 -5
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/bin/inch +3 -3
- data/config/defaults.rb +0 -7
- data/inch.gemspec +7 -7
- data/lib/inch.rb +9 -9
- data/lib/inch/api.rb +10 -10
- data/lib/inch/api/compare.rb +2 -2
- data/lib/inch/api/compare/code_objects.rb +3 -2
- data/lib/inch/api/compare/codebases.rb +1 -1
- data/lib/inch/api/diff.rb +10 -7
- data/lib/inch/api/filter.rb +1 -1
- data/lib/inch/api/get.rb +1 -1
- data/lib/inch/api/options/base.rb +4 -4
- data/lib/inch/api/options/filter.rb +4 -0
- data/lib/inch/api/options/suggest.rb +5 -1
- data/lib/inch/api/stats.rb +1 -0
- data/lib/inch/api/suggest.rb +10 -9
- data/lib/inch/cli.rb +6 -6
- data/lib/inch/cli/arguments.rb +2 -2
- data/lib/inch/cli/command.rb +15 -15
- data/lib/inch/cli/command/base.rb +4 -4
- data/lib/inch/cli/command/console.rb +5 -5
- data/lib/inch/cli/command/diff.rb +8 -7
- data/lib/inch/cli/command/inspect.rb +4 -5
- data/lib/inch/cli/command/list.rb +4 -4
- data/lib/inch/cli/command/options/base.rb +8 -8
- data/lib/inch/cli/command/options/base_list.rb +5 -9
- data/lib/inch/cli/command/options/console.rb +3 -4
- data/lib/inch/cli/command/options/diff.rb +6 -8
- data/lib/inch/cli/command/options/inspect.rb +2 -2
- data/lib/inch/cli/command/options/list.rb +2 -3
- data/lib/inch/cli/command/options/show.rb +2 -2
- data/lib/inch/cli/command/options/stats.rb +1 -2
- data/lib/inch/cli/command/options/suggest.rb +3 -6
- data/lib/inch/cli/command/output/base.rb +6 -4
- data/lib/inch/cli/command/output/console.rb +5 -4
- data/lib/inch/cli/command/output/diff.rb +6 -6
- data/lib/inch/cli/command/output/inspect.rb +8 -6
- data/lib/inch/cli/command/output/list.rb +1 -0
- data/lib/inch/cli/command/output/show.rb +5 -4
- data/lib/inch/cli/command/output/stats.rb +21 -21
- data/lib/inch/cli/command/output/suggest.rb +27 -30
- data/lib/inch/cli/command/show.rb +4 -4
- data/lib/inch/cli/command/stats.rb +4 -4
- data/lib/inch/cli/command/suggest.rb +6 -6
- data/lib/inch/cli/command_parser.rb +5 -6
- data/lib/inch/cli/sparkline_helper.rb +6 -6
- data/lib/inch/cli/trace_helper.rb +1 -1
- data/lib/inch/cli/yardopts_helper.rb +3 -4
- data/lib/inch/code_object.rb +3 -3
- data/lib/inch/code_object/converter.rb +8 -6
- data/lib/inch/code_object/provider.rb +1 -1
- data/lib/inch/code_object/provider/yard.rb +12 -10
- data/lib/inch/code_object/provider/yard/docstring.rb +19 -51
- data/lib/inch/code_object/provider/yard/nodoc_helper.rb +4 -4
- data/lib/inch/code_object/provider/yard/object.rb +10 -12
- data/lib/inch/code_object/provider/yard/object/base.rb +27 -48
- data/lib/inch/code_object/provider/yard/object/method_object.rb +10 -47
- data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +6 -10
- data/lib/inch/code_object/provider/yard/object/method_signature.rb +8 -12
- data/lib/inch/code_object/provider/yard/object/namespace_object.rb +4 -1
- data/lib/inch/code_object/provider/yard/parser.rb +3 -3
- data/lib/inch/code_object/proxy.rb +9 -10
- data/lib/inch/code_object/proxy/base.rb +10 -12
- data/lib/inch/code_object/proxy/method_object.rb +2 -3
- data/lib/inch/code_object/proxy/method_parameter_object.rb +3 -5
- data/lib/inch/codebase.rb +5 -4
- data/lib/inch/codebase/objects_filter.rb +4 -2
- data/lib/inch/codebase/serializer.rb +3 -3
- data/lib/inch/config.rb +2 -2
- data/lib/inch/config/base.rb +1 -0
- data/lib/inch/config/codebase.rb +4 -4
- data/lib/inch/core_ext.rb +1 -1
- data/lib/inch/core_ext/string.rb +1 -1
- data/lib/inch/evaluation.rb +15 -16
- data/lib/inch/evaluation/file.rb +1 -1
- data/lib/inch/evaluation/grade_list.rb +2 -2
- data/lib/inch/evaluation/object_schema.rb +1 -1
- data/lib/inch/evaluation/proxy.rb +7 -8
- data/lib/inch/evaluation/proxy/base.rb +10 -13
- data/lib/inch/evaluation/proxy/constant_object.rb +1 -1
- data/lib/inch/evaluation/proxy/method_object.rb +5 -12
- data/lib/inch/evaluation/proxy/module_object.rb +1 -1
- data/lib/inch/evaluation/proxy/namespace_object.rb +1 -1
- data/lib/inch/evaluation/role/base.rb +1 -1
- data/lib/inch/evaluation/role/method.rb +2 -2
- data/lib/inch/evaluation/role/method_parameter.rb +1 -2
- data/lib/inch/evaluation/role/object.rb +2 -2
- data/lib/inch/rake.rb +2 -2
- data/lib/inch/rake/suggest.rb +2 -3
- data/lib/inch/utils/shell_helper.rb +1 -1
- data/lib/inch/utils/ui.rb +5 -5
- data/lib/inch/utils/weighted_list.rb +3 -2
- data/lib/inch/version.rb +1 -1
- data/test/fixtures/simple/lib/broken.rb +7 -35
- data/test/fixtures/simple/lib/foo.rb +1 -22
- data/test/integration/api/compare/codebases.rb +1 -1
- data/test/integration/cli/command/console_test.rb +5 -5
- data/test/integration/cli/command/inspect_test.rb +5 -4
- data/test/integration/cli/command/list_test.rb +4 -3
- data/test/integration/cli/command/show_test.rb +4 -4
- data/test/integration/cli/command/stats_test.rb +2 -2
- data/test/integration/cli/command/suggest_test.rb +10 -10
- data/test/integration/stats_options_test.rb +3 -3
- data/test/integration/visibility_options_test.rb +13 -13
- data/test/shared/base_list.rb +3 -4
- data/test/test_helper.rb +6 -16
- data/test/unit/api/filter_test.rb +7 -7
- data/test/unit/api/get_test.rb +1 -1
- data/test/unit/api/list_test.rb +1 -1
- data/test/unit/api/options/base_test.rb +3 -3
- data/test/unit/api/stats_test.rb +1 -1
- data/test/unit/api/suggest_test.rb +3 -3
- data/test/unit/cli/arguments_test.rb +1 -1
- data/test/unit/cli/command/base_test.rb +1 -1
- data/test/unit/cli/command/options/base_list_test.rb +2 -2
- data/test/unit/cli/command/options/base_object_test.rb +1 -1
- data/test/unit/cli/command/options/base_test.rb +1 -1
- data/test/unit/cli/command_parser_test.rb +2 -2
- data/test/unit/cli/trace_helper_test.rb +1 -1
- data/test/unit/cli/yardopts_helper_test.rb +3 -4
- data/test/unit/code_object/converter_test.rb +1 -1
- data/test/unit/code_object/provider/yard/docstring_test.rb +28 -106
- data/test/unit/code_object/provider/yard/nodoc_helper_test.rb +5 -6
- data/test/unit/code_object/provider/yard/object/method_object_test.rb +10 -20
- data/test/unit/code_object/provider/yard_test.rb +4 -4
- data/test/unit/code_object/provider_test.rb +1 -1
- data/test/unit/code_object/proxy/method_object_test.rb +262 -382
- data/test/unit/code_object/proxy_test.rb +1 -1
- data/test/unit/codebase/objects_test.rb +2 -2
- data/test/unit/codebase/proxy_test.rb +1 -1
- data/test/unit/config/codebase_test.rb +1 -1
- data/test/unit/evaluation/role/base_test.rb +2 -2
- data/test/unit/utils/ui_test.rb +4 -4
- data/test/unit/utils/weighted_list_test.rb +4 -7
- metadata +4 -14
- data/.rubocop.yml +0 -15
- data/.rubocop_todo.yml +0 -94
- data/lib/inch/code_object/provider/yard/object/class_variable_object.rb +0 -12
- data/lib/inch/code_object/proxy/class_variable_object.rb +0 -8
- data/lib/inch/evaluation/proxy/class_variable_object.rb +0 -19
- data/lib/inch/evaluation/role/class_variable.rb +0 -55
- data/test/fixtures/simple/lib/broken_ruby_2_0_features.rb +0 -7
- data/test/fixtures/simple/lib/directives.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b627b3f3280cb1d20ff03e3a90decafe62cae3e
|
4
|
+
data.tar.gz: 5489c5a9d46a46e20d924aef08063bd4a2663998
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 748f0227ada481c78e398ba26e9c30397293acdefa22244c4b2482accaac8893f0eb10076ce4eb1c2484c91cc8253acd7619b5071e2e9c8189eb1b8676905603
|
7
|
+
data.tar.gz: 4e82d4927c776c8c825187821af1d6e4d5abfdbd56d7c5c4f73dbe093d50d85b901d24fc8934bae81dc1c6fd22b7ceac8bc39aa0c52569bc7cb9c32be3a2bfa8
|
data/CHANGELOG.md
CHANGED
@@ -1,20 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
|
4
|
-
## 0.
|
5
|
-
|
6
|
-
- Fix a bug related to "CLI classes must be required seperately from now on"
|
7
|
-
Note to self: read own CHANGELOG more carefully in the future
|
8
|
-
|
9
|
-
## 0.4.7
|
4
|
+
## 0.5.0 (pre)
|
10
5
|
|
11
6
|
- CLI classes must be required seperately from now on
|
12
7
|
- external data read by NoDocHelper is encoded as UTF-8
|
13
|
-
|
14
|
-
- Docs are now evaluated for class variables as well
|
15
|
-
- TomDoc support has been improved
|
16
|
-
- Method parameter name recognition has been improved for RDoc style comments
|
17
|
-
- Compliance with the Ruby Style Guide has been improved (thanks @yous)
|
8
|
+
|
18
9
|
|
19
10
|
## 0.4.6
|
20
11
|
|
data/Gemfile
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in inch.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
group :test
|
7
|
-
gem "simplecov", require: false
|
8
|
-
gem "rubocop", require: false
|
9
|
-
end
|
6
|
+
gem 'simplecov', :require => false, :group => :test
|
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-
|
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)
|
2
2
|
|
3
3
|
`inch` gives you hints where to improve your docs. One Inch at a time.
|
4
4
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
require
|
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
|
17
|
+
task :default => :test
|
data/bin/inch
CHANGED
@@ -12,12 +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)),
|
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
|
21
|
-
require
|
20
|
+
require 'inch'
|
21
|
+
require 'inch/cli'
|
22
22
|
|
23
23
|
Inch::CLI::CommandParser.run(*ARGV)
|
data/config/defaults.rb
CHANGED
data/inch.gemspec
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
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 =
|
12
|
-
spec.description =
|
11
|
+
spec.summary = %q{Documentation measurement tool for Ruby}
|
12
|
+
spec.description = %q{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(
|
18
|
-
spec.test_files = spec.files.grep(
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(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
|
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
|
data/lib/inch.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require
|
1
|
+
require 'inch/version'
|
2
2
|
|
3
3
|
module Inch
|
4
4
|
end
|
5
5
|
|
6
|
-
require
|
6
|
+
require 'forwardable'
|
7
7
|
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
8
|
+
require 'inch/api'
|
9
|
+
require 'inch/core_ext'
|
10
|
+
require 'inch/codebase'
|
11
|
+
require 'inch/code_object'
|
12
|
+
require 'inch/evaluation'
|
13
13
|
|
14
|
-
require
|
15
|
-
require File.join(File.dirname(__FILE__),
|
14
|
+
require 'inch/config'
|
15
|
+
require File.join(File.dirname(__FILE__), '..', 'config', 'defaults.rb')
|
data/lib/inch/api.rb
CHANGED
@@ -23,14 +23,14 @@ module Inch
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
require
|
27
|
-
require
|
28
|
-
require
|
26
|
+
require 'inch/api/options/base'
|
27
|
+
require 'inch/api/options/filter'
|
28
|
+
require 'inch/api/options/suggest'
|
29
29
|
|
30
|
-
require
|
31
|
-
require
|
32
|
-
require
|
33
|
-
require
|
34
|
-
require
|
35
|
-
require
|
36
|
-
require
|
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'
|
data/lib/inch/api/compare.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
require
|
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
|
-
|
10
|
+
raise "@before and @after are identical ruby objects. this is bad."
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -23,6 +23,7 @@ module Inch
|
|
23
23
|
@after.grade
|
24
24
|
end
|
25
25
|
|
26
|
+
|
26
27
|
def added?
|
27
28
|
@before.nil? && !@after.nil?
|
28
29
|
end
|
data/lib/inch/api/diff.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'inch/utils/shell_helper'
|
2
2
|
|
3
3
|
module Inch
|
4
4
|
module API
|
@@ -20,17 +20,17 @@ module Inch
|
|
20
20
|
@work_dir = dir
|
21
21
|
@codebase_old = codebase_for(before_rev)
|
22
22
|
@codebase_new = if after_rev.nil?
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
|
30
30
|
private
|
31
31
|
|
32
32
|
def codebase_for(revision)
|
33
|
-
if
|
33
|
+
if cached = codebase_from_cache(revision)
|
34
34
|
cached
|
35
35
|
else
|
36
36
|
codebase = codebase_from_copy(work_dir, revision)
|
@@ -42,7 +42,9 @@ module Inch
|
|
42
42
|
|
43
43
|
def codebase_from_cache(revision)
|
44
44
|
filename = Codebase::Serializer.filename(revision)
|
45
|
-
|
45
|
+
if File.exist?(filename)
|
46
|
+
Codebase::Serializer.load(filename)
|
47
|
+
end
|
46
48
|
end
|
47
49
|
|
48
50
|
def codebase_from_copy(original_dir, revision)
|
@@ -63,6 +65,7 @@ module Inch
|
|
63
65
|
def git_reset(dir, revision = nil)
|
64
66
|
git dir, "reset --hard #{revision}"
|
65
67
|
end
|
68
|
+
|
66
69
|
end
|
67
70
|
end
|
68
71
|
end
|
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
|
11
|
+
codebase.objects.filter! Options::Filter(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
|
21
|
+
if object = codebase.objects.find(object_name)
|
22
22
|
object
|
23
23
|
else
|
24
24
|
codebase.objects.starting_with(object_name)
|
@@ -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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
1
|
+
require 'inch/evaluation/proxy/base'
|
2
2
|
|
3
3
|
module Inch
|
4
4
|
module API
|
@@ -27,6 +27,10 @@ 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
|
30
34
|
end
|
31
35
|
end
|
32
36
|
end
|
data/lib/inch/api/stats.rb
CHANGED
data/lib/inch/api/suggest.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require 'inch/utils/weighted_list'
|
2
2
|
|
3
3
|
module Inch
|
4
4
|
module API
|
5
5
|
class Suggest < Filter
|
6
6
|
def initialize(codebase, options)
|
7
7
|
super
|
8
|
-
@options = Options::Suggest
|
8
|
+
@options = Options::Suggest(options)
|
9
9
|
end
|
10
10
|
|
11
11
|
def files
|
@@ -19,6 +19,7 @@ module Inch
|
|
19
19
|
filter_objects_to_display
|
20
20
|
end
|
21
21
|
|
22
|
+
|
22
23
|
# @return [Array] all the objects that match +@options+
|
23
24
|
def all_objects
|
24
25
|
relevant_objects
|
@@ -51,13 +52,15 @@ module Inch
|
|
51
52
|
|
52
53
|
list = Codebase::Objects.sort_by_priority(weighted_list.to_a.flatten)
|
53
54
|
|
54
|
-
|
55
|
+
if list.size > object_count
|
56
|
+
list = list[0...object_count]
|
57
|
+
end
|
55
58
|
list
|
56
59
|
end
|
57
60
|
|
58
61
|
def files_sorted_by_importance
|
59
62
|
list = all_filenames(relevant_objects).uniq.map do |filename|
|
60
|
-
Evaluation::File.for(filename, relevant_objects)
|
63
|
+
f = Evaluation::File.for(filename, relevant_objects)
|
61
64
|
end
|
62
65
|
|
63
66
|
priority_list = list.select do |f|
|
@@ -65,8 +68,7 @@ module Inch
|
|
65
68
|
relevant_priorities.include?(f.priority)
|
66
69
|
end
|
67
70
|
|
68
|
-
Codebase::Objects.sort_by_priority(
|
69
|
-
priority_list.empty? ? list : priority_list)
|
71
|
+
Codebase::Objects.sort_by_priority(priority_list.empty? ? list : priority_list)
|
70
72
|
end
|
71
73
|
|
72
74
|
def all_filenames(objects)
|
@@ -85,7 +87,7 @@ module Inch
|
|
85
87
|
end
|
86
88
|
|
87
89
|
def grade_list(grade_symbol)
|
88
|
-
grade_lists.
|
90
|
+
grade_lists.detect { |r| r.grade.to_sym == grade_symbol }
|
89
91
|
end
|
90
92
|
|
91
93
|
def select_by_priority(list, min_priority)
|
@@ -97,8 +99,7 @@ module Inch
|
|
97
99
|
end
|
98
100
|
|
99
101
|
def relevant_objects
|
100
|
-
@relevant_objects ||= select_by_priority(codebase.objects,
|
101
|
-
@options.object_min_priority)
|
102
|
+
@relevant_objects ||= select_by_priority(codebase.objects, @options.object_min_priority)
|
102
103
|
end
|
103
104
|
|
104
105
|
def relevant_priorities
|
data/lib/inch/cli.rb
CHANGED
@@ -11,7 +11,7 @@ module Inch
|
|
11
11
|
# @return [Fixnum]
|
12
12
|
def get_term_columns(default = 80)
|
13
13
|
str = `stty size`
|
14
|
-
rows_cols = str.split(
|
14
|
+
rows_cols = str.split(' ').map(&:to_i)
|
15
15
|
rows_cols[1] || default
|
16
16
|
rescue
|
17
17
|
default
|
@@ -21,9 +21,9 @@ module Inch
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
require
|
25
|
-
require
|
26
|
-
require
|
27
|
-
require
|
24
|
+
require 'inch/cli/arguments'
|
25
|
+
require 'inch/cli/sparkline_helper'
|
26
|
+
require 'inch/cli/trace_helper'
|
27
|
+
require 'inch/cli/yardopts_helper'
|
28
28
|
|
29
|
-
require
|
29
|
+
require 'inch/cli/command'
|
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
|
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
|
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
|