inch 0.5.0.rc3 → 0.5.0.rc4
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 +94 -0
- data/CHANGELOG.md +26 -2
- data/Gemfile +5 -2
- data/README.md +3 -3
- data/Rakefile +6 -2
- data/bin/inch +3 -3
- data/config/{example.yml → .inch.yml.sample} +1 -0
- data/config/base.rb +53 -0
- data/config/elixir.rb +43 -0
- data/config/nodejs.rb +10 -0
- data/config/{defaults.rb → ruby.rb} +5 -54
- data/inch.gemspec +7 -7
- data/lib/inch.rb +14 -9
- 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 +13 -16
- data/lib/inch/api/filter.rb +1 -1
- data/lib/inch/api/get.rb +2 -2
- data/lib/inch/api/options/base.rb +4 -4
- data/lib/inch/api/options/filter.rb +0 -4
- data/lib/inch/api/options/suggest.rb +2 -6
- data/lib/inch/api/stats.rb +0 -1
- data/lib/inch/api/suggest.rb +9 -10
- 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 +30 -9
- data/lib/inch/cli/command/base_list.rb +2 -2
- data/lib/inch/cli/command/console.rb +5 -5
- data/lib/inch/cli/command/diff.rb +9 -9
- 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 +17 -16
- 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 +8 -6
- data/lib/inch/cli/command/options/inspect.rb +2 -2
- data/lib/inch/cli/command/options/list.rb +3 -2
- 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 +4 -6
- data/lib/inch/cli/command/output/console.rb +6 -7
- 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 +31 -28
- 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 +6 -6
- 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 +11 -11
- data/lib/inch/code_object/proxy.rb +61 -30
- data/lib/inch/codebase.rb +7 -8
- data/lib/inch/codebase/object.rb +60 -0
- data/lib/inch/codebase/objects.rb +8 -10
- data/lib/inch/codebase/objects_filter.rb +7 -5
- data/lib/inch/codebase/proxy.rb +4 -4
- data/lib/inch/codebase/serializer.rb +3 -3
- data/lib/inch/config.rb +42 -11
- data/lib/inch/config/base.rb +8 -29
- data/lib/inch/config/codebase.rb +32 -7
- data/lib/inch/config/evaluation.rb +61 -0
- data/lib/inch/core_ext.rb +1 -1
- data/lib/inch/core_ext/string.rb +1 -1
- data/lib/inch/evaluation.rb +13 -21
- data/lib/inch/evaluation/file.rb +4 -2
- data/lib/inch/evaluation/grade_list.rb +4 -4
- data/lib/inch/evaluation/priority_range.rb +3 -0
- data/lib/inch/evaluation/proxy.rb +139 -14
- data/lib/inch/evaluation/role.rb +99 -0
- data/lib/inch/language.rb +3 -0
- data/lib/inch/language/elixir/code_object/base.rb +197 -0
- data/lib/inch/language/elixir/code_object/function_object.rb +74 -0
- data/lib/inch/language/elixir/code_object/module_object.rb +23 -0
- data/lib/inch/language/elixir/code_object/type_object.rb +11 -0
- data/lib/inch/language/elixir/evaluation/base.rb +28 -0
- data/lib/inch/language/elixir/evaluation/function_object.rb +31 -0
- data/lib/inch/language/elixir/evaluation/module_object.rb +27 -0
- data/lib/inch/language/elixir/evaluation/type_object.rb +11 -0
- data/lib/inch/language/elixir/import.rb +24 -0
- data/lib/inch/language/elixir/provider/reader.rb +19 -0
- data/lib/inch/language/elixir/provider/reader/object.rb +63 -0
- data/lib/inch/language/elixir/provider/reader/object/base.rb +191 -0
- data/lib/inch/language/elixir/provider/reader/object/function_object.rb +26 -0
- data/lib/inch/language/elixir/provider/reader/object/module_object.rb +22 -0
- data/lib/inch/language/elixir/provider/reader/object/type_object.rb +15 -0
- data/lib/inch/language/elixir/provider/reader/parser.rb +55 -0
- data/lib/inch/language/elixir/roles/base.rb +32 -0
- data/lib/inch/language/elixir/roles/function.rb +112 -0
- data/lib/inch/language/elixir/roles/module.rb +64 -0
- data/lib/inch/language/elixir/roles/object.rb +76 -0
- data/lib/inch/language/elixir/roles/type.rb +13 -0
- data/lib/inch/language/nodejs/import.rb +8 -0
- data/lib/inch/language/nodejs/provider/jsdoc.rb +19 -0
- data/lib/inch/language/nodejs/provider/jsdoc/object.rb +55 -0
- data/lib/inch/language/nodejs/provider/jsdoc/object/base.rb +191 -0
- data/lib/inch/language/nodejs/provider/jsdoc/parser.rb +59 -0
- data/lib/inch/language/ruby/code_object/base.rb +197 -0
- data/lib/inch/language/ruby/code_object/class_object.rb +10 -0
- data/lib/inch/language/ruby/code_object/class_variable_object.rb +10 -0
- data/lib/inch/language/ruby/code_object/constant_object.rb +10 -0
- data/lib/inch/language/ruby/code_object/method_object.rb +85 -0
- data/lib/inch/language/ruby/code_object/method_parameter_object.rb +64 -0
- data/lib/inch/language/ruby/code_object/module_object.rb +10 -0
- data/lib/inch/language/ruby/code_object/namespace_object.rb +35 -0
- data/lib/inch/language/ruby/evaluation/base.rb +45 -0
- data/lib/inch/language/ruby/evaluation/class_object.rb +10 -0
- data/lib/inch/language/ruby/evaluation/class_variable_object.rb +21 -0
- data/lib/inch/language/ruby/evaluation/constant_object.rb +21 -0
- data/lib/inch/language/ruby/evaluation/method_object.rb +74 -0
- data/lib/inch/language/ruby/evaluation/module_object.rb +10 -0
- data/lib/inch/language/ruby/evaluation/namespace_object.rb +30 -0
- data/lib/inch/language/ruby/import.rb +34 -0
- data/lib/inch/language/ruby/provider/yard.rb +58 -0
- data/lib/inch/language/ruby/provider/yard/docstring.rb +162 -0
- data/lib/inch/language/ruby/provider/yard/nodoc_helper.rb +97 -0
- data/lib/inch/language/ruby/provider/yard/object.rb +63 -0
- data/lib/inch/language/ruby/provider/yard/object/base.rb +325 -0
- data/lib/inch/language/ruby/provider/yard/object/class_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/object/class_variable_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/object/constant_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/object/method_object.rb +170 -0
- data/lib/inch/language/ruby/provider/yard/object/method_parameter_object.rb +94 -0
- data/lib/inch/language/ruby/provider/yard/object/method_signature.rb +120 -0
- data/lib/inch/language/ruby/provider/yard/object/module_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/object/namespace_object.rb +46 -0
- data/lib/inch/language/ruby/provider/yard/object/root_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/parser.rb +71 -0
- data/lib/inch/language/ruby/roles/base.rb +17 -0
- data/lib/inch/language/ruby/roles/class_variable.rb +53 -0
- data/lib/inch/language/ruby/roles/constant.rb +53 -0
- data/lib/inch/language/ruby/roles/method.rb +112 -0
- data/lib/inch/language/ruby/roles/method_parameter.rb +84 -0
- data/lib/inch/language/ruby/roles/missing.rb +24 -0
- data/lib/inch/language/ruby/roles/namespace.rb +89 -0
- data/lib/inch/language/ruby/roles/object.rb +120 -0
- data/lib/inch/rake.rb +2 -2
- data/lib/inch/rake/suggest.rb +7 -2
- data/lib/inch/utils/buffered_ui.rb +16 -0
- 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/{code_examples → ruby/code_examples}/lib/foo.rb +0 -0
- data/test/fixtures/{diff1 → ruby/diff1}/lib/diff1.rb +0 -0
- data/test/fixtures/{diff2 → ruby/diff2}/lib/diff2.rb +0 -0
- data/test/fixtures/{inch-yml → ruby/inch-yml}/.inch.yml +0 -0
- data/test/fixtures/{inch-yml → ruby/inch-yml}/foo/bar.rb +0 -0
- data/test/fixtures/{inch-yml → ruby/inch-yml}/foo/vendor/base.rb +0 -0
- data/test/fixtures/{parameters → ruby/parameters}/lib/foo.rb +0 -0
- data/test/fixtures/{readme → ruby/readme}/lib/foo.rb +0 -0
- data/test/fixtures/{really_good → ruby/really_good}/lib/foo.rb +0 -0
- data/test/fixtures/{really_good_pedantic → ruby/really_good_pedantic}/lib/foo.rb +0 -0
- data/test/fixtures/{simple → ruby/simple}/README +0 -0
- data/test/fixtures/{simple → ruby/simple}/lib/broken.rb +11 -19
- data/test/fixtures/ruby/simple/lib/broken_ruby_2_0_features.rb +7 -0
- data/test/fixtures/ruby/simple/lib/directives.rb +8 -0
- data/test/fixtures/{simple → ruby/simple}/lib/foo.rb +22 -1
- data/test/fixtures/{simple → ruby/simple}/lib/nodoc.rb +0 -0
- data/test/fixtures/{simple → ruby/simple}/lib/role_methods.rb +0 -0
- data/test/fixtures/{simple → ruby/simple}/lib/role_namespaces.rb +0 -0
- data/test/fixtures/{visibility → ruby/visibility}/lib/foo.rb +0 -0
- data/test/fixtures/{yardopts → ruby/yardopts}/.yardopts +0 -0
- data/test/fixtures/{yardopts → ruby/yardopts}/foo/bar.rb +0 -0
- data/test/integration/api/compare/codebases.rb +3 -3
- data/test/integration/cli/command/console_test.rb +6 -6
- data/test/integration/cli/command/diff_test.rb +62 -0
- data/test/integration/cli/command/inspect_test.rb +5 -6
- data/test/integration/cli/command/list_test.rb +4 -5
- data/test/integration/cli/command/show_test.rb +5 -5
- data/test/integration/cli/command/stats_test.rb +3 -3
- data/test/integration/cli/command/suggest_test.rb +13 -13
- data/test/integration/stats_options_test.rb +4 -4
- data/test/integration/visibility_options_test.rb +14 -14
- data/test/shared/base_list.rb +4 -3
- data/test/test_helper.rb +13 -13
- 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 +2 -2
- 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 +3 -3
- data/test/unit/cli/trace_helper_test.rb +1 -1
- data/test/unit/cli/yardopts_helper_test.rb +6 -5
- data/test/unit/code_object/converter_test.rb +1 -1
- data/test/unit/code_object/provider_test.rb +2 -2
- data/test/unit/code_object/proxy_test.rb +2 -2
- data/test/unit/codebase/objects_test.rb +2 -2
- data/test/unit/codebase/proxy_test.rb +7 -5
- data/test/unit/config/codebase_test.rb +4 -4
- data/test/unit/config_test.rb +28 -0
- data/test/unit/evaluation/{role/base_test.rb → role_test.rb} +7 -7
- data/test/unit/{code_object/proxy → language/ruby/code_object}/method_object_test.rb +66 -21
- data/test/unit/{code_object → language/ruby}/provider/yard/docstring_test.rb +74 -38
- data/test/unit/{code_object → language/ruby}/provider/yard/nodoc_helper_test.rb +9 -7
- data/test/unit/{code_object → language/ruby}/provider/yard/object/method_object_test.rb +21 -11
- data/test/unit/language/ruby/provider/yard_test.rb +25 -0
- data/test/unit/utils/buffered_ui_test.rb +48 -0
- data/test/unit/utils/ui_test.rb +7 -7
- data/test/unit/utils/weighted_list_test.rb +7 -4
- metadata +139 -93
- data/lib/inch/code_object/provider/yard.rb +0 -57
- data/lib/inch/code_object/provider/yard/docstring.rb +0 -133
- data/lib/inch/code_object/provider/yard/nodoc_helper.rb +0 -93
- data/lib/inch/code_object/provider/yard/object.rb +0 -60
- data/lib/inch/code_object/provider/yard/object/base.rb +0 -302
- data/lib/inch/code_object/provider/yard/object/class_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/object/class_variable_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/object/constant_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/object/method_object.rb +0 -153
- data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +0 -88
- data/lib/inch/code_object/provider/yard/object/method_signature.rb +0 -114
- data/lib/inch/code_object/provider/yard/object/module_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/object/namespace_object.rb +0 -47
- data/lib/inch/code_object/provider/yard/object/root_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/parser.rb +0 -62
- data/lib/inch/code_object/proxy/base.rb +0 -241
- data/lib/inch/code_object/proxy/class_object.rb +0 -8
- data/lib/inch/code_object/proxy/class_variable_object.rb +0 -8
- data/lib/inch/code_object/proxy/constant_object.rb +0 -8
- data/lib/inch/code_object/proxy/method_object.rb +0 -82
- data/lib/inch/code_object/proxy/method_parameter_object.rb +0 -60
- data/lib/inch/code_object/proxy/module_object.rb +0 -8
- data/lib/inch/code_object/proxy/namespace_object.rb +0 -33
- data/lib/inch/evaluation/object_schema.rb +0 -30
- data/lib/inch/evaluation/proxy/base.rb +0 -164
- data/lib/inch/evaluation/proxy/class_object.rb +0 -8
- data/lib/inch/evaluation/proxy/class_variable_object.rb +0 -19
- data/lib/inch/evaluation/proxy/constant_object.rb +0 -19
- data/lib/inch/evaluation/proxy/method_object.rb +0 -65
- data/lib/inch/evaluation/proxy/module_object.rb +0 -8
- data/lib/inch/evaluation/proxy/namespace_object.rb +0 -27
- data/lib/inch/evaluation/role/base.rb +0 -92
- data/lib/inch/evaluation/role/class_variable.rb +0 -55
- data/lib/inch/evaluation/role/constant.rb +0 -55
- data/lib/inch/evaluation/role/method.rb +0 -126
- data/lib/inch/evaluation/role/method_parameter.rb +0 -91
- data/lib/inch/evaluation/role/missing.rb +0 -20
- data/lib/inch/evaluation/role/namespace.rb +0 -85
- data/lib/inch/evaluation/role/object.rb +0 -143
- data/test/unit/code_object/provider/yard_test.rb +0 -25
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
|
@@ -6,7 +6,7 @@ describe ::Inch::Utils::UI do
|
|
6
6
|
@instance = ::Inch::Utils::UI.new
|
7
7
|
@instance.trace("Test")
|
8
8
|
end
|
9
|
-
refute out.empty?, "there should be
|
9
|
+
refute out.empty?, "there should be output"
|
10
10
|
assert err.empty?, "there should be no errors"
|
11
11
|
end
|
12
12
|
|
@@ -15,23 +15,23 @@ describe ::Inch::Utils::UI do
|
|
15
15
|
@instance = ::Inch::Utils::UI.new
|
16
16
|
@instance.header("Test", :red)
|
17
17
|
end
|
18
|
-
refute out.empty?, "there should be
|
18
|
+
refute out.empty?, "there should be output"
|
19
19
|
assert err.empty?, "there should be no errors"
|
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[
|
29
|
-
refute out.empty?, "there should be
|
28
|
+
ENV["DEBUG"] = nil
|
29
|
+
refute out.empty?, "there should be 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.5.0.
|
4
|
+
version: 0.5.0.rc4
|
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-08-
|
11
|
+
date: 2014-08-29 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"
|
@@ -128,8 +130,11 @@ files:
|
|
128
130
|
- Rakefile
|
129
131
|
- TODOS.md
|
130
132
|
- bin/inch
|
131
|
-
- config
|
132
|
-
- config/
|
133
|
+
- config/.inch.yml.sample
|
134
|
+
- config/base.rb
|
135
|
+
- config/elixir.rb
|
136
|
+
- config/nodejs.rb
|
137
|
+
- config/ruby.rb
|
133
138
|
- inch.gemspec
|
134
139
|
- lib/inch.rb
|
135
140
|
- lib/inch/api.rb
|
@@ -183,31 +188,9 @@ files:
|
|
183
188
|
- lib/inch/code_object.rb
|
184
189
|
- lib/inch/code_object/converter.rb
|
185
190
|
- lib/inch/code_object/provider.rb
|
186
|
-
- lib/inch/code_object/provider/yard.rb
|
187
|
-
- lib/inch/code_object/provider/yard/docstring.rb
|
188
|
-
- lib/inch/code_object/provider/yard/nodoc_helper.rb
|
189
|
-
- lib/inch/code_object/provider/yard/object.rb
|
190
|
-
- lib/inch/code_object/provider/yard/object/base.rb
|
191
|
-
- lib/inch/code_object/provider/yard/object/class_object.rb
|
192
|
-
- lib/inch/code_object/provider/yard/object/class_variable_object.rb
|
193
|
-
- lib/inch/code_object/provider/yard/object/constant_object.rb
|
194
|
-
- lib/inch/code_object/provider/yard/object/method_object.rb
|
195
|
-
- lib/inch/code_object/provider/yard/object/method_parameter_object.rb
|
196
|
-
- lib/inch/code_object/provider/yard/object/method_signature.rb
|
197
|
-
- lib/inch/code_object/provider/yard/object/module_object.rb
|
198
|
-
- lib/inch/code_object/provider/yard/object/namespace_object.rb
|
199
|
-
- lib/inch/code_object/provider/yard/object/root_object.rb
|
200
|
-
- lib/inch/code_object/provider/yard/parser.rb
|
201
191
|
- lib/inch/code_object/proxy.rb
|
202
|
-
- lib/inch/code_object/proxy/base.rb
|
203
|
-
- lib/inch/code_object/proxy/class_object.rb
|
204
|
-
- lib/inch/code_object/proxy/class_variable_object.rb
|
205
|
-
- lib/inch/code_object/proxy/constant_object.rb
|
206
|
-
- lib/inch/code_object/proxy/method_object.rb
|
207
|
-
- lib/inch/code_object/proxy/method_parameter_object.rb
|
208
|
-
- lib/inch/code_object/proxy/module_object.rb
|
209
|
-
- lib/inch/code_object/proxy/namespace_object.rb
|
210
192
|
- lib/inch/codebase.rb
|
193
|
+
- lib/inch/codebase/object.rb
|
211
194
|
- lib/inch/codebase/objects.rb
|
212
195
|
- lib/inch/codebase/objects_filter.rb
|
213
196
|
- lib/inch/codebase/proxy.rb
|
@@ -215,58 +198,114 @@ files:
|
|
215
198
|
- lib/inch/config.rb
|
216
199
|
- lib/inch/config/base.rb
|
217
200
|
- lib/inch/config/codebase.rb
|
201
|
+
- lib/inch/config/evaluation.rb
|
218
202
|
- lib/inch/core_ext.rb
|
219
203
|
- lib/inch/core_ext/string.rb
|
220
204
|
- lib/inch/evaluation.rb
|
221
205
|
- lib/inch/evaluation/file.rb
|
222
206
|
- lib/inch/evaluation/grade.rb
|
223
207
|
- lib/inch/evaluation/grade_list.rb
|
224
|
-
- lib/inch/evaluation/object_schema.rb
|
225
208
|
- lib/inch/evaluation/priority_range.rb
|
226
209
|
- lib/inch/evaluation/proxy.rb
|
227
|
-
- lib/inch/evaluation/
|
228
|
-
- lib/inch/
|
229
|
-
- lib/inch/
|
230
|
-
- lib/inch/
|
231
|
-
- lib/inch/
|
232
|
-
- lib/inch/
|
233
|
-
- lib/inch/evaluation/
|
234
|
-
- lib/inch/evaluation/
|
235
|
-
- lib/inch/evaluation/
|
236
|
-
- lib/inch/evaluation/
|
237
|
-
- lib/inch/
|
238
|
-
- lib/inch/
|
239
|
-
- lib/inch/
|
240
|
-
- lib/inch/
|
241
|
-
- lib/inch/
|
210
|
+
- lib/inch/evaluation/role.rb
|
211
|
+
- lib/inch/language.rb
|
212
|
+
- lib/inch/language/elixir/code_object/base.rb
|
213
|
+
- lib/inch/language/elixir/code_object/function_object.rb
|
214
|
+
- lib/inch/language/elixir/code_object/module_object.rb
|
215
|
+
- lib/inch/language/elixir/code_object/type_object.rb
|
216
|
+
- lib/inch/language/elixir/evaluation/base.rb
|
217
|
+
- lib/inch/language/elixir/evaluation/function_object.rb
|
218
|
+
- lib/inch/language/elixir/evaluation/module_object.rb
|
219
|
+
- lib/inch/language/elixir/evaluation/type_object.rb
|
220
|
+
- lib/inch/language/elixir/import.rb
|
221
|
+
- lib/inch/language/elixir/provider/reader.rb
|
222
|
+
- lib/inch/language/elixir/provider/reader/object.rb
|
223
|
+
- lib/inch/language/elixir/provider/reader/object/base.rb
|
224
|
+
- lib/inch/language/elixir/provider/reader/object/function_object.rb
|
225
|
+
- lib/inch/language/elixir/provider/reader/object/module_object.rb
|
226
|
+
- lib/inch/language/elixir/provider/reader/object/type_object.rb
|
227
|
+
- lib/inch/language/elixir/provider/reader/parser.rb
|
228
|
+
- lib/inch/language/elixir/roles/base.rb
|
229
|
+
- lib/inch/language/elixir/roles/function.rb
|
230
|
+
- lib/inch/language/elixir/roles/module.rb
|
231
|
+
- lib/inch/language/elixir/roles/object.rb
|
232
|
+
- lib/inch/language/elixir/roles/type.rb
|
233
|
+
- lib/inch/language/nodejs/import.rb
|
234
|
+
- lib/inch/language/nodejs/provider/jsdoc.rb
|
235
|
+
- lib/inch/language/nodejs/provider/jsdoc/object.rb
|
236
|
+
- lib/inch/language/nodejs/provider/jsdoc/object/base.rb
|
237
|
+
- lib/inch/language/nodejs/provider/jsdoc/parser.rb
|
238
|
+
- lib/inch/language/ruby/code_object/base.rb
|
239
|
+
- lib/inch/language/ruby/code_object/class_object.rb
|
240
|
+
- lib/inch/language/ruby/code_object/class_variable_object.rb
|
241
|
+
- lib/inch/language/ruby/code_object/constant_object.rb
|
242
|
+
- lib/inch/language/ruby/code_object/method_object.rb
|
243
|
+
- lib/inch/language/ruby/code_object/method_parameter_object.rb
|
244
|
+
- lib/inch/language/ruby/code_object/module_object.rb
|
245
|
+
- lib/inch/language/ruby/code_object/namespace_object.rb
|
246
|
+
- lib/inch/language/ruby/evaluation/base.rb
|
247
|
+
- lib/inch/language/ruby/evaluation/class_object.rb
|
248
|
+
- lib/inch/language/ruby/evaluation/class_variable_object.rb
|
249
|
+
- lib/inch/language/ruby/evaluation/constant_object.rb
|
250
|
+
- lib/inch/language/ruby/evaluation/method_object.rb
|
251
|
+
- lib/inch/language/ruby/evaluation/module_object.rb
|
252
|
+
- lib/inch/language/ruby/evaluation/namespace_object.rb
|
253
|
+
- lib/inch/language/ruby/import.rb
|
254
|
+
- lib/inch/language/ruby/provider/yard.rb
|
255
|
+
- lib/inch/language/ruby/provider/yard/docstring.rb
|
256
|
+
- lib/inch/language/ruby/provider/yard/nodoc_helper.rb
|
257
|
+
- lib/inch/language/ruby/provider/yard/object.rb
|
258
|
+
- lib/inch/language/ruby/provider/yard/object/base.rb
|
259
|
+
- lib/inch/language/ruby/provider/yard/object/class_object.rb
|
260
|
+
- lib/inch/language/ruby/provider/yard/object/class_variable_object.rb
|
261
|
+
- lib/inch/language/ruby/provider/yard/object/constant_object.rb
|
262
|
+
- lib/inch/language/ruby/provider/yard/object/method_object.rb
|
263
|
+
- lib/inch/language/ruby/provider/yard/object/method_parameter_object.rb
|
264
|
+
- lib/inch/language/ruby/provider/yard/object/method_signature.rb
|
265
|
+
- lib/inch/language/ruby/provider/yard/object/module_object.rb
|
266
|
+
- lib/inch/language/ruby/provider/yard/object/namespace_object.rb
|
267
|
+
- lib/inch/language/ruby/provider/yard/object/root_object.rb
|
268
|
+
- lib/inch/language/ruby/provider/yard/parser.rb
|
269
|
+
- lib/inch/language/ruby/roles/base.rb
|
270
|
+
- lib/inch/language/ruby/roles/class_variable.rb
|
271
|
+
- lib/inch/language/ruby/roles/constant.rb
|
272
|
+
- lib/inch/language/ruby/roles/method.rb
|
273
|
+
- lib/inch/language/ruby/roles/method_parameter.rb
|
274
|
+
- lib/inch/language/ruby/roles/missing.rb
|
275
|
+
- lib/inch/language/ruby/roles/namespace.rb
|
276
|
+
- lib/inch/language/ruby/roles/object.rb
|
242
277
|
- lib/inch/rake.rb
|
243
278
|
- lib/inch/rake/suggest.rb
|
279
|
+
- lib/inch/utils/buffered_ui.rb
|
244
280
|
- lib/inch/utils/read_write_methods.rb
|
245
281
|
- lib/inch/utils/shell_helper.rb
|
246
282
|
- lib/inch/utils/ui.rb
|
247
283
|
- lib/inch/utils/weighted_list.rb
|
248
284
|
- lib/inch/version.rb
|
249
|
-
- test/fixtures/code_examples/lib/foo.rb
|
250
|
-
- test/fixtures/diff1/lib/diff1.rb
|
251
|
-
- test/fixtures/diff2/lib/diff2.rb
|
252
|
-
- test/fixtures/inch-yml/.inch.yml
|
253
|
-
- test/fixtures/inch-yml/foo/bar.rb
|
254
|
-
- test/fixtures/inch-yml/foo/vendor/base.rb
|
255
|
-
- test/fixtures/parameters/lib/foo.rb
|
256
|
-
- test/fixtures/readme/lib/foo.rb
|
257
|
-
- test/fixtures/really_good/lib/foo.rb
|
258
|
-
- test/fixtures/really_good_pedantic/lib/foo.rb
|
259
|
-
- test/fixtures/simple/README
|
260
|
-
- test/fixtures/simple/lib/broken.rb
|
261
|
-
- test/fixtures/simple/lib/
|
262
|
-
- test/fixtures/simple/lib/
|
263
|
-
- test/fixtures/simple/lib/
|
264
|
-
- test/fixtures/simple/lib/
|
265
|
-
- test/fixtures/
|
266
|
-
- test/fixtures/
|
267
|
-
- test/fixtures/
|
285
|
+
- test/fixtures/ruby/code_examples/lib/foo.rb
|
286
|
+
- test/fixtures/ruby/diff1/lib/diff1.rb
|
287
|
+
- test/fixtures/ruby/diff2/lib/diff2.rb
|
288
|
+
- test/fixtures/ruby/inch-yml/.inch.yml
|
289
|
+
- test/fixtures/ruby/inch-yml/foo/bar.rb
|
290
|
+
- test/fixtures/ruby/inch-yml/foo/vendor/base.rb
|
291
|
+
- test/fixtures/ruby/parameters/lib/foo.rb
|
292
|
+
- test/fixtures/ruby/readme/lib/foo.rb
|
293
|
+
- test/fixtures/ruby/really_good/lib/foo.rb
|
294
|
+
- test/fixtures/ruby/really_good_pedantic/lib/foo.rb
|
295
|
+
- test/fixtures/ruby/simple/README
|
296
|
+
- test/fixtures/ruby/simple/lib/broken.rb
|
297
|
+
- test/fixtures/ruby/simple/lib/broken_ruby_2_0_features.rb
|
298
|
+
- test/fixtures/ruby/simple/lib/directives.rb
|
299
|
+
- test/fixtures/ruby/simple/lib/foo.rb
|
300
|
+
- test/fixtures/ruby/simple/lib/nodoc.rb
|
301
|
+
- test/fixtures/ruby/simple/lib/role_methods.rb
|
302
|
+
- test/fixtures/ruby/simple/lib/role_namespaces.rb
|
303
|
+
- test/fixtures/ruby/visibility/lib/foo.rb
|
304
|
+
- test/fixtures/ruby/yardopts/.yardopts
|
305
|
+
- test/fixtures/ruby/yardopts/foo/bar.rb
|
268
306
|
- test/integration/api/compare/codebases.rb
|
269
307
|
- test/integration/cli/command/console_test.rb
|
308
|
+
- test/integration/cli/command/diff_test.rb
|
270
309
|
- test/integration/cli/command/inspect_test.rb
|
271
310
|
- test/integration/cli/command/list_test.rb
|
272
311
|
- test/integration/cli/command/show_test.rb
|
@@ -291,17 +330,19 @@ files:
|
|
291
330
|
- test/unit/cli/trace_helper_test.rb
|
292
331
|
- test/unit/cli/yardopts_helper_test.rb
|
293
332
|
- test/unit/code_object/converter_test.rb
|
294
|
-
- test/unit/code_object/provider/yard/docstring_test.rb
|
295
|
-
- test/unit/code_object/provider/yard/nodoc_helper_test.rb
|
296
|
-
- test/unit/code_object/provider/yard/object/method_object_test.rb
|
297
|
-
- test/unit/code_object/provider/yard_test.rb
|
298
333
|
- test/unit/code_object/provider_test.rb
|
299
|
-
- test/unit/code_object/proxy/method_object_test.rb
|
300
334
|
- test/unit/code_object/proxy_test.rb
|
301
335
|
- test/unit/codebase/objects_test.rb
|
302
336
|
- test/unit/codebase/proxy_test.rb
|
303
337
|
- test/unit/config/codebase_test.rb
|
304
|
-
- test/unit/
|
338
|
+
- test/unit/config_test.rb
|
339
|
+
- test/unit/evaluation/role_test.rb
|
340
|
+
- test/unit/language/ruby/code_object/method_object_test.rb
|
341
|
+
- test/unit/language/ruby/provider/yard/docstring_test.rb
|
342
|
+
- test/unit/language/ruby/provider/yard/nodoc_helper_test.rb
|
343
|
+
- test/unit/language/ruby/provider/yard/object/method_object_test.rb
|
344
|
+
- test/unit/language/ruby/provider/yard_test.rb
|
345
|
+
- test/unit/utils/buffered_ui_test.rb
|
305
346
|
- test/unit/utils/ui_test.rb
|
306
347
|
- test/unit/utils/weighted_list_test.rb
|
307
348
|
homepage: http://trivelop.de/inch/
|
@@ -329,27 +370,30 @@ signing_key:
|
|
329
370
|
specification_version: 4
|
330
371
|
summary: Documentation measurement tool for Ruby
|
331
372
|
test_files:
|
332
|
-
- test/fixtures/code_examples/lib/foo.rb
|
333
|
-
- test/fixtures/diff1/lib/diff1.rb
|
334
|
-
- test/fixtures/diff2/lib/diff2.rb
|
335
|
-
- test/fixtures/inch-yml/.inch.yml
|
336
|
-
- test/fixtures/inch-yml/foo/bar.rb
|
337
|
-
- test/fixtures/inch-yml/foo/vendor/base.rb
|
338
|
-
- test/fixtures/parameters/lib/foo.rb
|
339
|
-
- test/fixtures/readme/lib/foo.rb
|
340
|
-
- test/fixtures/really_good/lib/foo.rb
|
341
|
-
- test/fixtures/really_good_pedantic/lib/foo.rb
|
342
|
-
- test/fixtures/simple/README
|
343
|
-
- test/fixtures/simple/lib/broken.rb
|
344
|
-
- test/fixtures/simple/lib/
|
345
|
-
- test/fixtures/simple/lib/
|
346
|
-
- test/fixtures/simple/lib/
|
347
|
-
- test/fixtures/simple/lib/
|
348
|
-
- test/fixtures/
|
349
|
-
- test/fixtures/
|
350
|
-
- test/fixtures/
|
373
|
+
- test/fixtures/ruby/code_examples/lib/foo.rb
|
374
|
+
- test/fixtures/ruby/diff1/lib/diff1.rb
|
375
|
+
- test/fixtures/ruby/diff2/lib/diff2.rb
|
376
|
+
- test/fixtures/ruby/inch-yml/.inch.yml
|
377
|
+
- test/fixtures/ruby/inch-yml/foo/bar.rb
|
378
|
+
- test/fixtures/ruby/inch-yml/foo/vendor/base.rb
|
379
|
+
- test/fixtures/ruby/parameters/lib/foo.rb
|
380
|
+
- test/fixtures/ruby/readme/lib/foo.rb
|
381
|
+
- test/fixtures/ruby/really_good/lib/foo.rb
|
382
|
+
- test/fixtures/ruby/really_good_pedantic/lib/foo.rb
|
383
|
+
- test/fixtures/ruby/simple/README
|
384
|
+
- test/fixtures/ruby/simple/lib/broken.rb
|
385
|
+
- test/fixtures/ruby/simple/lib/broken_ruby_2_0_features.rb
|
386
|
+
- test/fixtures/ruby/simple/lib/directives.rb
|
387
|
+
- test/fixtures/ruby/simple/lib/foo.rb
|
388
|
+
- test/fixtures/ruby/simple/lib/nodoc.rb
|
389
|
+
- test/fixtures/ruby/simple/lib/role_methods.rb
|
390
|
+
- test/fixtures/ruby/simple/lib/role_namespaces.rb
|
391
|
+
- test/fixtures/ruby/visibility/lib/foo.rb
|
392
|
+
- test/fixtures/ruby/yardopts/.yardopts
|
393
|
+
- test/fixtures/ruby/yardopts/foo/bar.rb
|
351
394
|
- test/integration/api/compare/codebases.rb
|
352
395
|
- test/integration/cli/command/console_test.rb
|
396
|
+
- test/integration/cli/command/diff_test.rb
|
353
397
|
- test/integration/cli/command/inspect_test.rb
|
354
398
|
- test/integration/cli/command/list_test.rb
|
355
399
|
- test/integration/cli/command/show_test.rb
|
@@ -374,17 +418,19 @@ test_files:
|
|
374
418
|
- test/unit/cli/trace_helper_test.rb
|
375
419
|
- test/unit/cli/yardopts_helper_test.rb
|
376
420
|
- test/unit/code_object/converter_test.rb
|
377
|
-
- test/unit/code_object/provider/yard/docstring_test.rb
|
378
|
-
- test/unit/code_object/provider/yard/nodoc_helper_test.rb
|
379
|
-
- test/unit/code_object/provider/yard/object/method_object_test.rb
|
380
|
-
- test/unit/code_object/provider/yard_test.rb
|
381
421
|
- test/unit/code_object/provider_test.rb
|
382
|
-
- test/unit/code_object/proxy/method_object_test.rb
|
383
422
|
- test/unit/code_object/proxy_test.rb
|
384
423
|
- test/unit/codebase/objects_test.rb
|
385
424
|
- test/unit/codebase/proxy_test.rb
|
386
425
|
- test/unit/config/codebase_test.rb
|
387
|
-
- test/unit/
|
426
|
+
- test/unit/config_test.rb
|
427
|
+
- test/unit/evaluation/role_test.rb
|
428
|
+
- test/unit/language/ruby/code_object/method_object_test.rb
|
429
|
+
- test/unit/language/ruby/provider/yard/docstring_test.rb
|
430
|
+
- test/unit/language/ruby/provider/yard/nodoc_helper_test.rb
|
431
|
+
- test/unit/language/ruby/provider/yard/object/method_object_test.rb
|
432
|
+
- test/unit/language/ruby/provider/yard_test.rb
|
433
|
+
- test/unit/utils/buffered_ui_test.rb
|
388
434
|
- test/unit/utils/ui_test.rb
|
389
435
|
- test/unit/utils/weighted_list_test.rb
|
390
436
|
has_rdoc:
|
@@ -1,57 +0,0 @@
|
|
1
|
-
module Inch
|
2
|
-
module CodeObject
|
3
|
-
module Provider
|
4
|
-
# Parses the source tree (using YARD)
|
5
|
-
module YARD
|
6
|
-
|
7
|
-
# Returns +true+ if the docstring was generated by YARD
|
8
|
-
#
|
9
|
-
# @param docstring [Docstring,String]
|
10
|
-
# @param method [MethodObject]
|
11
|
-
def self.implicit_docstring?(docstring, method)
|
12
|
-
name = method.name
|
13
|
-
if method.getter?
|
14
|
-
docstring.to_s == "Returns the value of attribute #{name}"
|
15
|
-
elsif method.setter?
|
16
|
-
basename = name.to_s.gsub(/(\=)$/, '')
|
17
|
-
docstring.to_s == "Sets the attribute #{basename}"
|
18
|
-
else
|
19
|
-
false
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# Returns +true+ if the tag was generated by YARD
|
24
|
-
#
|
25
|
-
# @param tag [::YARD::Tag]
|
26
|
-
# @param method [MethodObject]
|
27
|
-
def self.implicit_tag?(tag, method)
|
28
|
-
name = method.name
|
29
|
-
if method.getter?
|
30
|
-
tag.tag_name == 'return' &&
|
31
|
-
tag.text == "the current value of #{name}"
|
32
|
-
elsif method.setter?
|
33
|
-
tag.tag_name == 'return' &&
|
34
|
-
tag.text == 'the newly set value'
|
35
|
-
else
|
36
|
-
false
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.parse(dir, config = Inch::Config.codebase)
|
41
|
-
Parser.parse(dir, config)
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
require 'logger'
|
50
|
-
require 'yard'
|
51
|
-
|
52
|
-
log.level = ::Logger::UNKNOWN # basically disable YARD's logging
|
53
|
-
|
54
|
-
require 'inch/code_object/provider/yard/parser'
|
55
|
-
require 'inch/code_object/provider/yard/docstring'
|
56
|
-
require 'inch/code_object/provider/yard/nodoc_helper'
|
57
|
-
require 'inch/code_object/provider/yard/object'
|