inch 0.4.0.rc2 → 0.4.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inch/api/compare/code_objects.rb +4 -4
- data/lib/inch/cli/command/diff.rb +2 -8
- data/lib/inch/cli/command/output/inspect.rb +3 -3
- data/lib/inch/cli/command/output/list.rb +1 -1
- data/lib/inch/cli/command/output/stats.rb +2 -2
- data/lib/inch/code_object/provider/yard/parser.rb +4 -5
- data/lib/inch/config/codebase.rb +3 -4
- data/lib/inch/evaluation/proxy/base.rb +2 -2
- data/lib/inch/evaluation/role/missing.rb +2 -2
- data/lib/inch/utils/shell_helper.rb +3 -5
- data/lib/inch/version.rb +1 -1
- data/test/unit/code_object/proxy/method_object_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: be1d3023cb43e15c6a141ed20de1543d20a8be64
|
4
|
+
data.tar.gz: 5c7c5638b7998464f36dcbae6016c5742d17e8d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02501af74e5e84a9fbf0b25c69e9c319b46c2d35e8a9507ed97488917748bc3c98c9cecda89a1f704e0fd37633189d55ddfdb63e5877e1c34c8af4b65bbfc140
|
7
|
+
data.tar.gz: f9c15371028b15ae3cb630d55cf0eff00e008296ca93f6cce4af98361430466760e5024712abd975b0341172c37d24f969b7a78b123a5c3975c4664dee96f4fe
|
@@ -29,11 +29,11 @@ module Inch
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def degraded?
|
32
|
-
changed? && @before.score
|
32
|
+
changed? && @before.score > @after.score
|
33
33
|
end
|
34
34
|
|
35
35
|
def improved?
|
36
|
-
changed? && @before.score
|
36
|
+
changed? && @before.score < @after.score
|
37
37
|
end
|
38
38
|
|
39
39
|
def present?
|
@@ -45,11 +45,11 @@ module Inch
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def unchanged?
|
48
|
-
present? && @before.score
|
48
|
+
present? && @before.score == @after.score
|
49
49
|
end
|
50
50
|
|
51
51
|
def scores
|
52
|
-
[@before.score
|
52
|
+
[@before.score, @after.score]
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
@@ -6,6 +6,8 @@ module Inch
|
|
6
6
|
module CLI
|
7
7
|
module Command
|
8
8
|
class Diff < Base
|
9
|
+
include Utils::ShellHelper
|
10
|
+
|
9
11
|
register_command_as :diff
|
10
12
|
|
11
13
|
def description
|
@@ -28,14 +30,6 @@ module Inch
|
|
28
30
|
|
29
31
|
private
|
30
32
|
|
31
|
-
def git(dir, command)
|
32
|
-
old_pwd = Dir.pwd
|
33
|
-
Dir.chdir dir
|
34
|
-
out = `git #{command}`
|
35
|
-
Dir.chdir old_pwd
|
36
|
-
out
|
37
|
-
end
|
38
|
-
|
39
33
|
# @return [Array<String>] the revisions passed in the command_line
|
40
34
|
def revisions
|
41
35
|
@revisions ||= @options.revisions.map do |rev|
|
@@ -40,7 +40,7 @@ module Inch
|
|
40
40
|
min = o.evaluation.min_score
|
41
41
|
max = o.evaluation.max_score
|
42
42
|
echo "Score (min: #{min}, max: #{max})".ljust(40) +
|
43
|
-
"#{o.score
|
43
|
+
"#{o.score}".rjust(5) + "#{o.priority.to_i}".rjust(4)
|
44
44
|
echo
|
45
45
|
end
|
46
46
|
|
@@ -97,9 +97,9 @@ module Inch
|
|
97
97
|
|
98
98
|
def colored_role_score(role)
|
99
99
|
if role.potential_score
|
100
|
-
"(#{role.potential_score
|
100
|
+
"(#{role.potential_score})".rjust(5).yellow.dark
|
101
101
|
else
|
102
|
-
value = role.score
|
102
|
+
value = role.score
|
103
103
|
colored_score value, value.abs.to_s.rjust(4)
|
104
104
|
end
|
105
105
|
end
|
@@ -20,11 +20,10 @@ module Inch
|
|
20
20
|
# @param config [Inch::Config::Codebase] configuration for codebase
|
21
21
|
# @return [void]
|
22
22
|
def parse(dir, config)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Dir.chdir old_dir
|
23
|
+
Dir.chdir(dir) do
|
24
|
+
parse_yard_objects(config.included_files, config.excluded_files)
|
25
|
+
inject_base_dir(dir)
|
26
|
+
end
|
28
27
|
end
|
29
28
|
|
30
29
|
# @return [Array<YARD::Object::Base>]
|
data/lib/inch/config/codebase.rb
CHANGED
@@ -56,7 +56,7 @@ module Inch
|
|
56
56
|
@__min_score = __min_score
|
57
57
|
end
|
58
58
|
|
59
|
-
# @return [
|
59
|
+
# @return [Fixnum] the final score for +object+
|
60
60
|
def score
|
61
61
|
@__score ||= __score
|
62
62
|
end
|
@@ -144,7 +144,7 @@ module Inch
|
|
144
144
|
|
145
145
|
# @return [Float]
|
146
146
|
def __score
|
147
|
-
value = @roles.inject(0) { |sum,r| sum + r.score.to_f }
|
147
|
+
value = @roles.inject(0) { |sum,r| sum + r.score.to_f }.to_i
|
148
148
|
if value < min_score
|
149
149
|
min_score
|
150
150
|
elsif value > max_score
|
data/lib/inch/version.rb
CHANGED
@@ -278,7 +278,7 @@ describe ::Inch::CodeObject::Proxy::MethodObject do
|
|
278
278
|
list << @objects.find("Overloading#mix")
|
279
279
|
list << @objects.find("Overloading#hooks")
|
280
280
|
list.each do |m|
|
281
|
-
assert_equal 100, m.score
|
281
|
+
assert_equal 100, m.score, "#{m.fullname} did not get 100"
|
282
282
|
end
|
283
283
|
end
|
284
284
|
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.0.
|
4
|
+
version: 0.4.0.rc3
|
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-03-
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|