inch 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +15 -0
- data/.rubocop_todo.yml +113 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +5 -2
- data/README.md +2 -2
- data/Rakefile +2 -2
- data/bin/inch +3 -2
- data/config/defaults.rb +7 -0
- data/inch.gemspec +7 -7
- data/lib/inch.rb +9 -10
- data/lib/inch/api.rb +10 -10
- data/lib/inch/api/compare.rb +2 -2
- data/lib/inch/api/compare/code_objects.rb +2 -3
- data/lib/inch/api/compare/codebases.rb +1 -1
- data/lib/inch/api/diff.rb +6 -9
- data/lib/inch/api/options/base.rb +4 -4
- data/lib/inch/api/options/suggest.rb +1 -1
- data/lib/inch/api/stats.rb +0 -1
- data/lib/inch/api/suggest.rb +8 -9
- data/lib/inch/cli.rb +6 -6
- data/lib/inch/cli/command.rb +15 -15
- data/lib/inch/cli/command/base.rb +2 -2
- data/lib/inch/cli/command/console.rb +5 -5
- data/lib/inch/cli/command/diff.rb +7 -8
- data/lib/inch/cli/command/inspect.rb +5 -4
- 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 +9 -5
- data/lib/inch/cli/command/options/console.rb +4 -3
- data/lib/inch/cli/command/options/diff.rb +6 -4
- data/lib/inch/cli/command/options/inspect.rb +2 -2
- data/lib/inch/cli/command/options/list.rb +4 -3
- data/lib/inch/cli/command/options/show.rb +2 -2
- data/lib/inch/cli/command/options/stats.rb +2 -1
- data/lib/inch/cli/command/options/suggest.rb +6 -3
- data/lib/inch/cli/command/output/base.rb +2 -4
- data/lib/inch/cli/command/output/console.rb +4 -5
- data/lib/inch/cli/command/output/diff.rb +6 -6
- data/lib/inch/cli/command/output/inspect.rb +6 -8
- data/lib/inch/cli/command/output/list.rb +0 -1
- data/lib/inch/cli/command/output/show.rb +4 -5
- data/lib/inch/cli/command/output/stats.rb +21 -21
- data/lib/inch/cli/command/output/suggest.rb +28 -26
- 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 +6 -5
- data/lib/inch/cli/sparkline_helper.rb +2 -2
- data/lib/inch/cli/trace_helper.rb +1 -1
- data/lib/inch/cli/yardopts_helper.rb +4 -3
- data/lib/inch/code_object.rb +3 -3
- data/lib/inch/code_object/converter.rb +6 -8
- data/lib/inch/code_object/provider.rb +1 -1
- data/lib/inch/code_object/provider/yard.rb +10 -12
- data/lib/inch/code_object/provider/yard/docstring.rb +53 -21
- data/lib/inch/code_object/provider/yard/nodoc_helper.rb +3 -3
- data/lib/inch/code_object/provider/yard/object.rb +11 -9
- data/lib/inch/code_object/provider/yard/object/base.rb +33 -9
- data/lib/inch/code_object/provider/yard/object/class_variable_object.rb +12 -0
- data/lib/inch/code_object/provider/yard/object/method_object.rb +36 -11
- data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +2 -2
- data/lib/inch/code_object/provider/yard/object/method_signature.rb +11 -8
- data/lib/inch/code_object/provider/yard/object/namespace_object.rb +1 -4
- data/lib/inch/code_object/provider/yard/parser.rb +2 -2
- data/lib/inch/code_object/proxy.rb +10 -9
- data/lib/inch/code_object/proxy/base.rb +8 -8
- data/lib/inch/code_object/proxy/class_variable_object.rb +8 -0
- data/lib/inch/code_object/proxy/method_object.rb +3 -2
- data/lib/inch/code_object/proxy/method_parameter_object.rb +1 -1
- data/lib/inch/codebase.rb +4 -5
- data/lib/inch/codebase/objects_filter.rb +2 -4
- data/lib/inch/codebase/serializer.rb +3 -3
- data/lib/inch/config.rb +2 -2
- data/lib/inch/config/base.rb +0 -1
- data/lib/inch/config/codebase.rb +3 -3
- data/lib/inch/core_ext.rb +1 -1
- data/lib/inch/core_ext/string.rb +1 -1
- data/lib/inch/evaluation.rb +16 -15
- data/lib/inch/evaluation/grade_list.rb +2 -2
- data/lib/inch/evaluation/object_schema.rb +1 -1
- data/lib/inch/evaluation/proxy.rb +8 -7
- data/lib/inch/evaluation/proxy/base.rb +12 -7
- data/lib/inch/evaluation/proxy/class_variable_object.rb +19 -0
- data/lib/inch/evaluation/proxy/constant_object.rb +1 -1
- data/lib/inch/evaluation/proxy/method_object.rb +12 -5
- 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/class_variable.rb +55 -0
- data/lib/inch/evaluation/role/method.rb +0 -1
- data/lib/inch/evaluation/role/method_parameter.rb +2 -1
- data/lib/inch/evaluation/role/object.rb +2 -2
- data/lib/inch/rake.rb +2 -2
- data/lib/inch/rake/suggest.rb +2 -2
- data/lib/inch/utils/shell_helper.rb +1 -1
- data/lib/inch/utils/ui.rb +5 -5
- data/lib/inch/utils/weighted_list.rb +2 -3
- data/lib/inch/version.rb +1 -1
- data/test/fixtures/simple/lib/broken.rb +35 -7
- data/test/fixtures/simple/lib/broken_ruby_2_0_features.rb +7 -0
- data/test/fixtures/simple/lib/directives.rb +8 -0
- data/test/fixtures/simple/lib/foo.rb +17 -0
- 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 +4 -5
- data/test/integration/cli/command/list_test.rb +3 -4
- 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 +7 -7
- data/test/integration/stats_options_test.rb +3 -3
- data/test/integration/visibility_options_test.rb +13 -13
- data/test/shared/base_list.rb +4 -3
- data/test/test_helper.rb +16 -5
- 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 +4 -3
- data/test/unit/code_object/converter_test.rb +1 -1
- data/test/unit/code_object/provider/yard/docstring_test.rb +105 -28
- data/test/unit/code_object/provider/yard/nodoc_helper_test.rb +5 -5
- data/test/unit/code_object/provider/yard/object/method_object_test.rb +20 -10
- 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 +366 -262
- 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 +1 -1
- data/test/unit/utils/ui_test.rb +4 -4
- data/test/unit/utils/weighted_list_test.rb +7 -4
- metadata +12 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) +
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../test_helper")
|
2
2
|
|
3
3
|
describe ::Inch::Codebase::Objects do
|
4
4
|
before do
|
@@ -18,7 +18,7 @@ describe ::Inch::Codebase::Objects do
|
|
18
18
|
|
19
19
|
it "should support iteration" do
|
20
20
|
sum = 0
|
21
|
-
@objects.each do
|
21
|
+
@objects.each do
|
22
22
|
sum += 1
|
23
23
|
end
|
24
24
|
assert_equal @objects.size, sum
|
data/test/unit/utils/ui_test.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) +
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../test_helper")
|
2
2
|
|
3
3
|
describe ::Inch::Utils::UI do
|
4
4
|
it "should trace" do
|
@@ -20,18 +20,18 @@ describe ::Inch::Utils::UI do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should trace debug if ENV variable is set" do
|
23
|
-
ENV[
|
23
|
+
ENV["DEBUG"] = "1"
|
24
24
|
out, err = capture_io do
|
25
25
|
@instance = ::Inch::Utils::UI.new
|
26
26
|
@instance.debug("Test")
|
27
27
|
end
|
28
|
-
ENV[
|
28
|
+
ENV["DEBUG"] = nil
|
29
29
|
refute out.empty?, "there should be no output"
|
30
30
|
assert err.empty?, "there should be no errors"
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should not trace debug if ENV variable is set" do
|
34
|
-
refute ENV[
|
34
|
+
refute ENV["DEBUG"]
|
35
35
|
out, err = capture_io do
|
36
36
|
@instance = ::Inch::Utils::UI.new
|
37
37
|
@instance.debug("Test")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) +
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../test_helper")
|
2
2
|
|
3
3
|
describe ::Inch::Utils::WeightedList do
|
4
4
|
before do
|
@@ -7,8 +7,11 @@ describe ::Inch::Utils::WeightedList do
|
|
7
7
|
|
8
8
|
def assert_weighted_list(list, counts, expected)
|
9
9
|
weighted_list = ::Inch::Utils::WeightedList.new(list, counts)
|
10
|
-
# assert_equal expected.map(&:size).inject(:+),
|
11
|
-
|
10
|
+
# assert_equal expected.map(&:size).inject(:+),
|
11
|
+
# weighted_list.to_a.map(&:size).inject(:+)
|
12
|
+
assert_equal expected, weighted_list.to_a,
|
13
|
+
"should be #{expected.map(&:size)}, was " \
|
14
|
+
"#{weighted_list.to_a.map(&:size)}"
|
12
15
|
end
|
13
16
|
|
14
17
|
def list_and_expected(counts, expected_counts)
|
@@ -19,7 +22,7 @@ describe ::Inch::Utils::WeightedList do
|
|
19
22
|
expected = expected_counts.map.with_index do |num, index|
|
20
23
|
(1..num).map { |i| :"#{elements[index]}#{i}" }
|
21
24
|
end
|
22
|
-
|
25
|
+
[list, expected]
|
23
26
|
end
|
24
27
|
|
25
28
|
it "should work if elements are exact" do
|
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.
|
4
|
+
version: 0.4.7
|
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-
|
11
|
+
date: 2014-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -117,6 +117,8 @@ extensions: []
|
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
119
|
- ".gitignore"
|
120
|
+
- ".rubocop.yml"
|
121
|
+
- ".rubocop_todo.yml"
|
120
122
|
- ".ruby-gemset"
|
121
123
|
- ".ruby-version"
|
122
124
|
- ".simplecov"
|
@@ -189,6 +191,7 @@ files:
|
|
189
191
|
- lib/inch/code_object/provider/yard/object.rb
|
190
192
|
- lib/inch/code_object/provider/yard/object/base.rb
|
191
193
|
- lib/inch/code_object/provider/yard/object/class_object.rb
|
194
|
+
- lib/inch/code_object/provider/yard/object/class_variable_object.rb
|
192
195
|
- lib/inch/code_object/provider/yard/object/constant_object.rb
|
193
196
|
- lib/inch/code_object/provider/yard/object/method_object.rb
|
194
197
|
- lib/inch/code_object/provider/yard/object/method_parameter_object.rb
|
@@ -200,6 +203,7 @@ files:
|
|
200
203
|
- lib/inch/code_object/proxy.rb
|
201
204
|
- lib/inch/code_object/proxy/base.rb
|
202
205
|
- lib/inch/code_object/proxy/class_object.rb
|
206
|
+
- lib/inch/code_object/proxy/class_variable_object.rb
|
203
207
|
- lib/inch/code_object/proxy/constant_object.rb
|
204
208
|
- lib/inch/code_object/proxy/method_object.rb
|
205
209
|
- lib/inch/code_object/proxy/method_parameter_object.rb
|
@@ -224,11 +228,13 @@ files:
|
|
224
228
|
- lib/inch/evaluation/proxy.rb
|
225
229
|
- lib/inch/evaluation/proxy/base.rb
|
226
230
|
- lib/inch/evaluation/proxy/class_object.rb
|
231
|
+
- lib/inch/evaluation/proxy/class_variable_object.rb
|
227
232
|
- lib/inch/evaluation/proxy/constant_object.rb
|
228
233
|
- lib/inch/evaluation/proxy/method_object.rb
|
229
234
|
- lib/inch/evaluation/proxy/module_object.rb
|
230
235
|
- lib/inch/evaluation/proxy/namespace_object.rb
|
231
236
|
- lib/inch/evaluation/role/base.rb
|
237
|
+
- lib/inch/evaluation/role/class_variable.rb
|
232
238
|
- lib/inch/evaluation/role/constant.rb
|
233
239
|
- lib/inch/evaluation/role/method.rb
|
234
240
|
- lib/inch/evaluation/role/method_parameter.rb
|
@@ -254,6 +260,8 @@ files:
|
|
254
260
|
- test/fixtures/really_good_pedantic/lib/foo.rb
|
255
261
|
- test/fixtures/simple/README
|
256
262
|
- test/fixtures/simple/lib/broken.rb
|
263
|
+
- test/fixtures/simple/lib/broken_ruby_2_0_features.rb
|
264
|
+
- test/fixtures/simple/lib/directives.rb
|
257
265
|
- test/fixtures/simple/lib/foo.rb
|
258
266
|
- test/fixtures/simple/lib/nodoc.rb
|
259
267
|
- test/fixtures/simple/lib/role_methods.rb
|
@@ -337,6 +345,8 @@ test_files:
|
|
337
345
|
- test/fixtures/really_good_pedantic/lib/foo.rb
|
338
346
|
- test/fixtures/simple/README
|
339
347
|
- test/fixtures/simple/lib/broken.rb
|
348
|
+
- test/fixtures/simple/lib/broken_ruby_2_0_features.rb
|
349
|
+
- test/fixtures/simple/lib/directives.rb
|
340
350
|
- test/fixtures/simple/lib/foo.rb
|
341
351
|
- test/fixtures/simple/lib/nodoc.rb
|
342
352
|
- test/fixtures/simple/lib/role_methods.rb
|