inch 0.5.0.rc5 → 0.5.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -6
- data/.rubocop_todo.yml +40 -34
- data/Gemfile +3 -3
- data/Rakefile +10 -6
- data/bin/inch +5 -5
- data/config/base.rb +4 -4
- data/config/nodejs.rb +44 -1
- data/config/ruby.rb +1 -1
- data/inch.gemspec +17 -17
- data/lib/inch.rb +13 -13
- data/lib/inch/api.rb +10 -10
- data/lib/inch/api/compare.rb +2 -2
- data/lib/inch/api/compare/code_objects.rb +1 -1
- data/lib/inch/api/diff.rb +1 -1
- data/lib/inch/api/options/suggest.rb +1 -1
- data/lib/inch/api/suggest.rb +1 -1
- data/lib/inch/cli.rb +6 -6
- data/lib/inch/cli/command.rb +15 -15
- data/lib/inch/cli/command/base.rb +5 -3
- data/lib/inch/cli/command/base_list.rb +0 -1
- data/lib/inch/cli/command/console.rb +5 -5
- data/lib/inch/cli/command/diff.rb +6 -6
- data/lib/inch/cli/command/inspect.rb +5 -5
- data/lib/inch/cli/command/list.rb +4 -4
- data/lib/inch/cli/command/options/base.rb +17 -15
- data/lib/inch/cli/command/options/base_list.rb +17 -17
- data/lib/inch/cli/command/options/base_object.rb +1 -1
- data/lib/inch/cli/command/options/console.rb +13 -13
- data/lib/inch/cli/command/options/diff.rb +19 -19
- data/lib/inch/cli/command/options/inspect.rb +5 -5
- data/lib/inch/cli/command/options/list.rb +7 -7
- data/lib/inch/cli/command/options/show.rb +5 -5
- data/lib/inch/cli/command/options/stats.rb +2 -2
- data/lib/inch/cli/command/options/suggest.rb +12 -12
- data/lib/inch/cli/command/output/base.rb +1 -1
- data/lib/inch/cli/command/output/diff.rb +9 -9
- data/lib/inch/cli/command/output/inspect.rb +13 -13
- data/lib/inch/cli/command/output/list.rb +1 -1
- data/lib/inch/cli/command/output/show.rb +4 -4
- data/lib/inch/cli/command/output/stats.rb +14 -14
- data/lib/inch/cli/command/output/suggest.rb +14 -14
- 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 +4 -4
- data/lib/inch/cli/command_parser.rb +4 -4
- data/lib/inch/cli/sparkline_helper.rb +1 -1
- data/lib/inch/cli/trace_helper.rb +1 -1
- data/lib/inch/cli/yardopts_helper.rb +1 -1
- data/lib/inch/code_object.rb +3 -3
- data/lib/inch/code_object/provider.rb +3 -3
- data/lib/inch/code_object/proxy.rb +3 -4
- data/lib/inch/codebase.rb +5 -5
- data/lib/inch/codebase/object.rb +2 -1
- data/lib/inch/codebase/serializer.rb +2 -2
- data/lib/inch/config.rb +6 -6
- data/lib/inch/config/codebase.rb +5 -5
- data/lib/inch/core_ext.rb +1 -1
- data/lib/inch/core_ext/string.rb +1 -1
- data/lib/inch/evaluation.rb +8 -8
- data/lib/inch/evaluation/proxy.rb +2 -3
- data/lib/inch/evaluation/role.rb +1 -1
- data/lib/inch/language/elixir/code_object/base.rb +6 -4
- data/lib/inch/language/elixir/evaluation/base.rb +2 -1
- data/lib/inch/language/elixir/evaluation/function_object.rb +1 -1
- data/lib/inch/language/elixir/import.rb +14 -14
- data/lib/inch/language/elixir/provider/reader.rb +1 -1
- data/lib/inch/language/elixir/provider/reader/docstring.rb +13 -0
- data/lib/inch/language/elixir/provider/reader/object.rb +5 -5
- data/lib/inch/language/elixir/provider/reader/object/base.rb +13 -5
- data/lib/inch/language/elixir/provider/reader/object/function_object.rb +1 -1
- data/lib/inch/language/elixir/provider/reader/parser.rb +21 -7
- data/lib/inch/language/elixir/roles/base.rb +3 -3
- data/lib/inch/language/elixir/roles/function.rb +2 -1
- data/lib/inch/language/elixir/roles/object.rb +1 -1
- data/lib/inch/language/nodejs/code_object/base.rb +199 -0
- data/lib/inch/language/nodejs/code_object/function_object.rb +74 -0
- data/lib/inch/language/nodejs/code_object/member_object.rb +11 -0
- data/lib/inch/language/nodejs/code_object/module_object.rb +23 -0
- data/lib/inch/language/nodejs/evaluation/base.rb +29 -0
- data/lib/inch/language/nodejs/evaluation/function_object.rb +31 -0
- data/lib/inch/language/nodejs/evaluation/member_object.rb +11 -0
- data/lib/inch/language/nodejs/evaluation/module_object.rb +27 -0
- data/lib/inch/language/nodejs/import.rb +17 -1
- data/lib/inch/language/nodejs/provider/jsdoc.rb +1 -1
- data/lib/inch/language/nodejs/provider/jsdoc/docstring.rb +13 -0
- data/lib/inch/language/nodejs/provider/jsdoc/object.rb +16 -8
- data/lib/inch/language/nodejs/provider/jsdoc/object/base.rb +82 -45
- data/lib/inch/language/nodejs/provider/jsdoc/object/function_object.rb +18 -0
- data/lib/inch/language/nodejs/provider/jsdoc/object/member_object.rb +15 -0
- data/lib/inch/language/nodejs/provider/jsdoc/object/module_object.rb +22 -0
- data/lib/inch/language/nodejs/provider/jsdoc/parser.rb +9 -10
- data/lib/inch/language/nodejs/roles/base.rb +32 -0
- data/lib/inch/language/nodejs/roles/function.rb +113 -0
- data/lib/inch/language/nodejs/roles/member.rb +13 -0
- data/lib/inch/language/nodejs/roles/module.rb +64 -0
- data/lib/inch/language/nodejs/roles/object.rb +76 -0
- data/lib/inch/language/ruby/code_object/base.rb +6 -4
- data/lib/inch/language/ruby/evaluation/base.rb +2 -1
- data/lib/inch/language/ruby/evaluation/method_object.rb +2 -1
- data/lib/inch/language/ruby/import.rb +24 -24
- data/lib/inch/language/ruby/provider/yard.rb +10 -10
- data/lib/inch/language/ruby/provider/yard/nodoc_helper.rb +2 -2
- data/lib/inch/language/ruby/provider/yard/object.rb +9 -9
- data/lib/inch/language/ruby/provider/yard/object/base.rb +25 -28
- data/lib/inch/language/ruby/provider/yard/object/method_object.rb +4 -3
- data/lib/inch/language/ruby/provider/yard/object/method_parameter_object.rb +4 -3
- data/lib/inch/language/ruby/provider/yard/object/method_signature.rb +2 -2
- data/lib/inch/language/ruby/provider/yard/object/namespace_object.rb +2 -1
- data/lib/inch/language/ruby/provider/yard/parser.rb +2 -2
- data/lib/inch/language/ruby/roles/base.rb +1 -1
- data/lib/inch/language/ruby/roles/method.rb +2 -1
- data/lib/inch/language/ruby/roles/method_parameter.rb +1 -1
- data/lib/inch/language/ruby/roles/missing.rb +2 -2
- data/lib/inch/language/ruby/roles/object.rb +6 -6
- data/lib/inch/rake.rb +2 -2
- data/lib/inch/rake/suggest.rb +5 -5
- data/lib/inch/utils/code_location.rb +12 -0
- data/lib/inch/utils/read_write_methods.rb +2 -2
- data/lib/inch/utils/ui.rb +8 -8
- data/lib/inch/version.rb +1 -1
- data/test/fixtures/elixir/simple/all.json +321 -0
- data/test/integration/api/compare/codebases.rb +6 -6
- data/test/integration/cli/command/console_test.rb +13 -13
- data/test/integration/cli/command/diff_test.rb +12 -14
- data/test/integration/cli/command/inspect_test.rb +30 -30
- data/test/integration/cli/command/list_test.rb +34 -34
- data/test/integration/cli/command/show_test.rb +26 -26
- data/test/integration/cli/command/stats_test.rb +23 -23
- data/test/integration/cli/command/suggest_test.rb +58 -49
- data/test/integration/stats_options_test.rb +9 -9
- data/test/integration/visibility_options_test.rb +49 -45
- data/test/shared/base_list.rb +41 -41
- data/test/test_helper.rb +18 -10
- data/test/unit/api/filter_test.rb +9 -9
- data/test/unit/api/get_test.rb +6 -6
- data/test/unit/api/list_test.rb +3 -3
- data/test/unit/api/options/base_test.rb +6 -6
- data/test/unit/api/stats_test.rb +3 -3
- data/test/unit/api/suggest_test.rb +4 -4
- data/test/unit/cli/arguments_test.rb +25 -25
- data/test/unit/cli/command/base_test.rb +3 -3
- data/test/unit/cli/command/options/base_list_test.rb +14 -14
- data/test/unit/cli/command/options/base_object_test.rb +6 -6
- data/test/unit/cli/command/options/base_test.rb +3 -3
- data/test/unit/cli/command_parser_test.rb +29 -29
- data/test/unit/cli/trace_helper_test.rb +2 -2
- data/test/unit/cli/yardopts_helper_test.rb +35 -35
- data/test/unit/code_object/converter_test.rb +3 -3
- data/test/unit/code_object/provider_test.rb +2 -2
- data/test/unit/code_object/proxy_test.rb +11 -11
- data/test/unit/codebase/objects_test.rb +8 -8
- data/test/unit/codebase/proxy_test.rb +5 -5
- data/test/unit/config/codebase_test.rb +3 -3
- data/test/unit/config_test.rb +4 -4
- data/test/unit/evaluation/role_test.rb +8 -8
- data/test/unit/language/elixir/code_object/function_object_test.rb +35 -0
- data/test/unit/language/ruby/code_object/method_object_test.rb +128 -126
- data/test/unit/language/ruby/provider/yard/docstring_test.rb +27 -23
- data/test/unit/language/ruby/provider/yard/nodoc_helper_test.rb +21 -20
- data/test/unit/language/ruby/provider/yard/object/method_object_test.rb +20 -17
- data/test/unit/language/ruby/provider/yard_test.rb +4 -4
- data/test/unit/utils/buffered_ui_test.rb +20 -20
- data/test/unit/utils/ui_test.rb +20 -20
- data/test/unit/utils/weighted_list_test.rb +7 -7
- metadata +25 -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::Utils::WeightedList do
|
4
4
|
before do
|
@@ -25,32 +25,32 @@ describe ::Inch::Utils::WeightedList do
|
|
25
25
|
[list, expected]
|
26
26
|
end
|
27
27
|
|
28
|
-
it
|
28
|
+
it 'should work if elements are exact' do
|
29
29
|
@list, @expected = list_and_expected([4, 8, 8], [4, 8, 8])
|
30
30
|
assert_weighted_list(@list, @counts, @expected)
|
31
31
|
end
|
32
32
|
|
33
|
-
it
|
33
|
+
it 'should work if more than enough elements are present' do
|
34
34
|
@list, @expected = list_and_expected([10, 10, 10], [4, 8, 8])
|
35
35
|
assert_weighted_list(@list, @counts, @expected)
|
36
36
|
end
|
37
37
|
|
38
|
-
it
|
38
|
+
it 'should work if not enough Bs are present' do
|
39
39
|
@list, @expected = list_and_expected([2, 12, 15], [2, 8, 10])
|
40
40
|
assert_weighted_list(@list, @counts, @expected)
|
41
41
|
end
|
42
42
|
|
43
|
-
it
|
43
|
+
it 'should work if not enough Cs are present' do
|
44
44
|
@list, @expected = list_and_expected([15, 4, 15], [4, 4, 12])
|
45
45
|
assert_weighted_list(@list, @counts, @expected)
|
46
46
|
end
|
47
47
|
|
48
|
-
it
|
48
|
+
it 'should work if not enough Us are present' do
|
49
49
|
@list, @expected = list_and_expected([15, 15, 4], [4, 12, 4])
|
50
50
|
assert_weighted_list(@list, @counts, @expected)
|
51
51
|
end
|
52
52
|
|
53
|
-
it
|
53
|
+
it 'should work if not enough Bs AND Cs and Us are present' do
|
54
54
|
@list, @expected = list_and_expected([2, 2, 15], [2, 2, 15])
|
55
55
|
assert_weighted_list(@list, @counts, @expected)
|
56
56
|
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.5.0.
|
4
|
+
version: 0.5.0.rc6
|
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-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -219,6 +219,7 @@ files:
|
|
219
219
|
- lib/inch/language/elixir/evaluation/type_object.rb
|
220
220
|
- lib/inch/language/elixir/import.rb
|
221
221
|
- lib/inch/language/elixir/provider/reader.rb
|
222
|
+
- lib/inch/language/elixir/provider/reader/docstring.rb
|
222
223
|
- lib/inch/language/elixir/provider/reader/object.rb
|
223
224
|
- lib/inch/language/elixir/provider/reader/object/base.rb
|
224
225
|
- lib/inch/language/elixir/provider/reader/object/function_object.rb
|
@@ -230,11 +231,28 @@ files:
|
|
230
231
|
- lib/inch/language/elixir/roles/module.rb
|
231
232
|
- lib/inch/language/elixir/roles/object.rb
|
232
233
|
- lib/inch/language/elixir/roles/type.rb
|
234
|
+
- lib/inch/language/nodejs/code_object/base.rb
|
235
|
+
- lib/inch/language/nodejs/code_object/function_object.rb
|
236
|
+
- lib/inch/language/nodejs/code_object/member_object.rb
|
237
|
+
- lib/inch/language/nodejs/code_object/module_object.rb
|
238
|
+
- lib/inch/language/nodejs/evaluation/base.rb
|
239
|
+
- lib/inch/language/nodejs/evaluation/function_object.rb
|
240
|
+
- lib/inch/language/nodejs/evaluation/member_object.rb
|
241
|
+
- lib/inch/language/nodejs/evaluation/module_object.rb
|
233
242
|
- lib/inch/language/nodejs/import.rb
|
234
243
|
- lib/inch/language/nodejs/provider/jsdoc.rb
|
244
|
+
- lib/inch/language/nodejs/provider/jsdoc/docstring.rb
|
235
245
|
- lib/inch/language/nodejs/provider/jsdoc/object.rb
|
236
246
|
- lib/inch/language/nodejs/provider/jsdoc/object/base.rb
|
247
|
+
- lib/inch/language/nodejs/provider/jsdoc/object/function_object.rb
|
248
|
+
- lib/inch/language/nodejs/provider/jsdoc/object/member_object.rb
|
249
|
+
- lib/inch/language/nodejs/provider/jsdoc/object/module_object.rb
|
237
250
|
- lib/inch/language/nodejs/provider/jsdoc/parser.rb
|
251
|
+
- lib/inch/language/nodejs/roles/base.rb
|
252
|
+
- lib/inch/language/nodejs/roles/function.rb
|
253
|
+
- lib/inch/language/nodejs/roles/member.rb
|
254
|
+
- lib/inch/language/nodejs/roles/module.rb
|
255
|
+
- lib/inch/language/nodejs/roles/object.rb
|
238
256
|
- lib/inch/language/ruby/code_object/base.rb
|
239
257
|
- lib/inch/language/ruby/code_object/class_object.rb
|
240
258
|
- lib/inch/language/ruby/code_object/class_variable_object.rb
|
@@ -277,11 +295,13 @@ files:
|
|
277
295
|
- lib/inch/rake.rb
|
278
296
|
- lib/inch/rake/suggest.rb
|
279
297
|
- lib/inch/utils/buffered_ui.rb
|
298
|
+
- lib/inch/utils/code_location.rb
|
280
299
|
- lib/inch/utils/read_write_methods.rb
|
281
300
|
- lib/inch/utils/shell_helper.rb
|
282
301
|
- lib/inch/utils/ui.rb
|
283
302
|
- lib/inch/utils/weighted_list.rb
|
284
303
|
- lib/inch/version.rb
|
304
|
+
- test/fixtures/elixir/simple/all.json
|
285
305
|
- test/fixtures/ruby/code_examples/lib/foo.rb
|
286
306
|
- test/fixtures/ruby/diff1/lib/diff1.rb
|
287
307
|
- test/fixtures/ruby/diff2/lib/diff2.rb
|
@@ -337,6 +357,7 @@ files:
|
|
337
357
|
- test/unit/config/codebase_test.rb
|
338
358
|
- test/unit/config_test.rb
|
339
359
|
- test/unit/evaluation/role_test.rb
|
360
|
+
- test/unit/language/elixir/code_object/function_object_test.rb
|
340
361
|
- test/unit/language/ruby/code_object/method_object_test.rb
|
341
362
|
- test/unit/language/ruby/provider/yard/docstring_test.rb
|
342
363
|
- test/unit/language/ruby/provider/yard/nodoc_helper_test.rb
|
@@ -370,6 +391,7 @@ signing_key:
|
|
370
391
|
specification_version: 4
|
371
392
|
summary: Documentation measurement tool for Ruby
|
372
393
|
test_files:
|
394
|
+
- test/fixtures/elixir/simple/all.json
|
373
395
|
- test/fixtures/ruby/code_examples/lib/foo.rb
|
374
396
|
- test/fixtures/ruby/diff1/lib/diff1.rb
|
375
397
|
- test/fixtures/ruby/diff2/lib/diff2.rb
|
@@ -425,6 +447,7 @@ test_files:
|
|
425
447
|
- test/unit/config/codebase_test.rb
|
426
448
|
- test/unit/config_test.rb
|
427
449
|
- test/unit/evaluation/role_test.rb
|
450
|
+
- test/unit/language/elixir/code_object/function_object_test.rb
|
428
451
|
- test/unit/language/ruby/code_object/method_object_test.rb
|
429
452
|
- test/unit/language/ruby/provider/yard/docstring_test.rb
|
430
453
|
- test/unit/language/ruby/provider/yard/nodoc_helper_test.rb
|