inch 0.5.0.rc5 → 0.5.0.rc6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,5 +1,5 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
1
|
+
require 'inch/cli/command/options/show'
|
|
2
|
+
require 'inch/cli/command/output/show'
|
|
3
3
|
|
|
4
4
|
module Inch
|
|
5
5
|
module CLI
|
|
@@ -8,11 +8,11 @@ module Inch
|
|
|
8
8
|
register_command_as :show
|
|
9
9
|
|
|
10
10
|
def description
|
|
11
|
-
|
|
11
|
+
'Shows an object with its results'
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def usage
|
|
15
|
-
|
|
15
|
+
'Usage: inch show [paths] OBJECT_NAME [[OBJECT_NAME2] ...] [options]'
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def run(*args)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
1
|
+
require 'inch/cli/command/options/stats'
|
|
2
|
+
require 'inch/cli/command/output/stats'
|
|
3
3
|
|
|
4
4
|
module Inch
|
|
5
5
|
module CLI
|
|
@@ -8,11 +8,11 @@ module Inch
|
|
|
8
8
|
register_command_as :stats
|
|
9
9
|
|
|
10
10
|
def description
|
|
11
|
-
|
|
11
|
+
'Show statistics'
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def usage
|
|
15
|
-
|
|
15
|
+
'Usage: inch stats [paths] [options]'
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def run(*args)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
1
|
+
require 'inch/cli/command/options/suggest'
|
|
2
|
+
require 'inch/cli/command/output/suggest'
|
|
3
3
|
|
|
4
4
|
module Inch
|
|
5
5
|
module CLI
|
|
@@ -8,11 +8,11 @@ module Inch
|
|
|
8
8
|
register_command_as :suggest, true
|
|
9
9
|
|
|
10
10
|
def description
|
|
11
|
-
|
|
11
|
+
'Suggests some objects to be documented (better)'
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def usage
|
|
15
|
-
|
|
15
|
+
'Usage: inch suggest [paths] [options]'
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
# Runs the commandline utility, parsing arguments and displaying a
|
|
@@ -56,7 +56,7 @@ module Inch
|
|
|
56
56
|
# argument.
|
|
57
57
|
# @return [Command::Base]
|
|
58
58
|
def run(*args)
|
|
59
|
-
if [
|
|
59
|
+
if ['--help', '-h'].include?(args.join)
|
|
60
60
|
list_commands
|
|
61
61
|
else
|
|
62
62
|
run_command(*args)
|
|
@@ -70,12 +70,12 @@ module Inch
|
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def list_commands
|
|
73
|
-
ui.trace
|
|
73
|
+
ui.trace 'Usage: inch <command> [options]'
|
|
74
74
|
ui.trace
|
|
75
|
-
ui.trace
|
|
75
|
+
ui.trace 'Commands:'
|
|
76
76
|
commands.keys.sort_by { |k| k.to_s }.each do |command_name|
|
|
77
77
|
command = commands[command_name].new
|
|
78
|
-
ui.trace format(
|
|
78
|
+
ui.trace format(' %-8s %s', command_name, command.description)
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
data/lib/inch/code_object.rb
CHANGED
|
@@ -12,11 +12,11 @@ module Inch
|
|
|
12
12
|
# converted into CodeObject::Proxy objects that form the codebase:
|
|
13
13
|
#
|
|
14
14
|
# ::YARD::CodeObject
|
|
15
|
-
#
|
|
15
|
+
# |
|
|
16
16
|
# ::Inch::CodeObject::Provider::YARD::Object::Base
|
|
17
|
-
#
|
|
17
|
+
# |
|
|
18
18
|
# (Hash)
|
|
19
|
-
#
|
|
19
|
+
# |
|
|
20
20
|
# ::Inch::CodeObject::Proxy
|
|
21
21
|
#
|
|
22
22
|
#
|
|
@@ -37,7 +37,7 @@ module Inch
|
|
|
37
37
|
|
|
38
38
|
# @return [Symbol] the programming language of the code object
|
|
39
39
|
def language
|
|
40
|
-
|
|
40
|
+
fail NotImplementedError
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
# Used to persist the code object
|
|
@@ -54,17 +54,16 @@ module Inch
|
|
|
54
54
|
"#<#{self.class}: #{fullname}>"
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
private
|
|
58
|
-
|
|
59
57
|
# Returns a Proxy class for the given +code_object+
|
|
60
58
|
#
|
|
61
59
|
# @param language [String,Symbol]
|
|
62
60
|
# @param code_object [YARD::CodeObject]
|
|
63
61
|
# @return [Class]
|
|
64
62
|
def self.class_for(language, code_object)
|
|
65
|
-
class_name = code_object.class.to_s.split(
|
|
63
|
+
class_name = code_object.class.to_s.split('::').last
|
|
66
64
|
Config.namespace(language, :CodeObject).const_get(class_name)
|
|
67
65
|
end
|
|
66
|
+
private_class_method :class_for
|
|
68
67
|
end
|
|
69
68
|
end
|
|
70
69
|
end
|
data/lib/inch/codebase.rb
CHANGED
|
@@ -14,8 +14,8 @@ module Inch
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
require
|
|
18
|
-
require
|
|
19
|
-
require
|
|
20
|
-
require
|
|
21
|
-
require
|
|
17
|
+
require 'inch/codebase/proxy'
|
|
18
|
+
require 'inch/codebase/object'
|
|
19
|
+
require 'inch/codebase/objects'
|
|
20
|
+
require 'inch/codebase/objects_filter'
|
|
21
|
+
require 'inch/codebase/serializer'
|
data/lib/inch/codebase/object.rb
CHANGED
|
@@ -29,7 +29,8 @@ module Inch
|
|
|
29
29
|
# @param object_lookup [Codebase::Objects]
|
|
30
30
|
def initialize(language, code_object, object_lookup)
|
|
31
31
|
@language = language
|
|
32
|
-
@code_object = CodeObject::Proxy.for(language, code_object,
|
|
32
|
+
@code_object = CodeObject::Proxy.for(language, code_object,
|
|
33
|
+
object_lookup)
|
|
33
34
|
end
|
|
34
35
|
|
|
35
36
|
def evaluation
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Inch
|
|
2
2
|
module Codebase
|
|
3
3
|
class Serializer
|
|
4
|
-
INCH_DB_DIR = File.join(
|
|
4
|
+
INCH_DB_DIR = File.join('.inch', 'db')
|
|
5
5
|
|
|
6
6
|
def self.filename(revision)
|
|
7
7
|
File.join(INCH_DB_DIR, revision)
|
|
@@ -10,7 +10,7 @@ module Inch
|
|
|
10
10
|
def self.save(codebase, filename)
|
|
11
11
|
content = Marshal.dump(codebase)
|
|
12
12
|
FileUtils.mkdir_p(File.dirname(filename))
|
|
13
|
-
File.open(filename,
|
|
13
|
+
File.open(filename, 'wb') { |file| file.write(content) }
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def self.load(filename)
|
data/lib/inch/config.rb
CHANGED
|
@@ -5,12 +5,12 @@ module Inch
|
|
|
5
5
|
class Config
|
|
6
6
|
class << self
|
|
7
7
|
def instance(language = :ruby)
|
|
8
|
-
if block = @blocks[language.to_s]
|
|
8
|
+
if (block = @blocks[language.to_s])
|
|
9
9
|
config = Config::Base.new(language)
|
|
10
10
|
config = config.update(&block)
|
|
11
11
|
config
|
|
12
12
|
else
|
|
13
|
-
|
|
13
|
+
fail "Language not registered: #{language}"
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -41,7 +41,7 @@ module Inch
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def namespace(language, submodule = nil)
|
|
44
|
-
name = language.to_s.split('_').
|
|
44
|
+
name = language.to_s.split('_').map { |w| w.capitalize }.join
|
|
45
45
|
const = ::Inch::Language.const_get(name)
|
|
46
46
|
const = const.const_get(submodule) unless submodule.nil?
|
|
47
47
|
const
|
|
@@ -50,6 +50,6 @@ module Inch
|
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
require
|
|
54
|
-
require
|
|
55
|
-
require
|
|
53
|
+
require 'inch/config/base'
|
|
54
|
+
require 'inch/config/evaluation'
|
|
55
|
+
require 'inch/config/codebase'
|
data/lib/inch/config/codebase.rb
CHANGED
|
@@ -7,7 +7,7 @@ module Inch
|
|
|
7
7
|
attr_accessor :excluded_files
|
|
8
8
|
attr_accessor :read_dump_file
|
|
9
9
|
|
|
10
|
-
YAML_FILE =
|
|
10
|
+
YAML_FILE = '.inch.yml'
|
|
11
11
|
|
|
12
12
|
def initialize(language = :ruby, included = nil, excluded = nil)
|
|
13
13
|
@language = language
|
|
@@ -39,8 +39,8 @@ module Inch
|
|
|
39
39
|
def update_via_yaml(dir)
|
|
40
40
|
if (yaml = self.class.yaml(dir))
|
|
41
41
|
Dir.chdir(dir) do
|
|
42
|
-
update_language yaml[
|
|
43
|
-
update_files yaml[
|
|
42
|
+
update_language yaml['language']
|
|
43
|
+
update_files yaml['files']
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
end
|
|
@@ -77,8 +77,8 @@ module Inch
|
|
|
77
77
|
|
|
78
78
|
def update_files(files)
|
|
79
79
|
return if files.nil?
|
|
80
|
-
@included_files = expand_files(files[
|
|
81
|
-
@excluded_files = expand_files(files[
|
|
80
|
+
@included_files = expand_files(files['included']) if files['included']
|
|
81
|
+
@excluded_files = expand_files(files['excluded']) if files['excluded']
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
def update_language(language)
|
data/lib/inch/core_ext.rb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'inch/core_ext/string'
|
data/lib/inch/core_ext/string.rb
CHANGED
data/lib/inch/evaluation.rb
CHANGED
|
@@ -9,19 +9,19 @@ module Inch
|
|
|
9
9
|
private
|
|
10
10
|
|
|
11
11
|
def self.class_for(language, code_object)
|
|
12
|
-
class_name = code_object.class.to_s.split(
|
|
12
|
+
class_name = code_object.class.to_s.split('::').last
|
|
13
13
|
language_namespace = Evaluation::Ruby
|
|
14
14
|
language_namespace.const_get(class_name)
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
require
|
|
19
|
+
require 'inch/utils/read_write_methods'
|
|
20
20
|
|
|
21
|
-
require
|
|
22
|
-
require
|
|
23
|
-
require
|
|
24
|
-
require
|
|
21
|
+
require 'inch/evaluation/file'
|
|
22
|
+
require 'inch/evaluation/grade'
|
|
23
|
+
require 'inch/evaluation/grade_list'
|
|
24
|
+
require 'inch/evaluation/priority_range'
|
|
25
25
|
|
|
26
|
-
require
|
|
27
|
-
require
|
|
26
|
+
require 'inch/evaluation/proxy'
|
|
27
|
+
require 'inch/evaluation/role'
|
|
@@ -140,12 +140,11 @@ module Inch
|
|
|
140
140
|
@roles.reduce(0) { |sum, r| sum + r.priority.to_i }
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
-
private
|
|
144
|
-
|
|
145
143
|
def self.class_for(language, code_object)
|
|
146
|
-
class_name = code_object.class.to_s.split(
|
|
144
|
+
class_name = code_object.class.to_s.split('::').last
|
|
147
145
|
Config.namespace(language, :Evaluation).const_get(class_name)
|
|
148
146
|
end
|
|
147
|
+
private_class_method :class_for
|
|
149
148
|
end
|
|
150
149
|
end
|
|
151
150
|
end
|
data/lib/inch/evaluation/role.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'forwardable'
|
|
2
2
|
|
|
3
3
|
module Inch
|
|
4
4
|
module Language
|
|
@@ -14,7 +14,8 @@ module Inch
|
|
|
14
14
|
:elixir
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
# @return [Boolean] if the current object is an alias for something
|
|
17
|
+
# @return [Boolean] if the current object is an alias for something
|
|
18
|
+
# else
|
|
18
19
|
def alias?
|
|
19
20
|
!aliased_object.nil?
|
|
20
21
|
end
|
|
@@ -133,7 +134,8 @@ module Inch
|
|
|
133
134
|
self[:original_docstring]
|
|
134
135
|
end
|
|
135
136
|
|
|
136
|
-
# @return [Boolean] +true+ if the object was tagged not to be
|
|
137
|
+
# @return [Boolean] +true+ if the object was tagged not to be
|
|
138
|
+
# documented
|
|
137
139
|
def nodoc?
|
|
138
140
|
self[:nodoc?]
|
|
139
141
|
end
|
|
@@ -174,7 +176,7 @@ module Inch
|
|
|
174
176
|
end
|
|
175
177
|
|
|
176
178
|
def type
|
|
177
|
-
self.class.to_s.gsub(/Object$/,
|
|
179
|
+
self.class.to_s.gsub(/Object$/, '')
|
|
178
180
|
end
|
|
179
181
|
|
|
180
182
|
# @return [Boolean] +true+ if the object has no documentation at all
|
|
@@ -18,7 +18,8 @@ module Inch
|
|
|
18
18
|
Role::Object::WithCodeExample => score_for(:code_example_single),
|
|
19
19
|
Role::Object::WithMultipleCodeExamples =>
|
|
20
20
|
score_for(:code_example_multi),
|
|
21
|
-
Role::Object::WithoutCodeExample =>
|
|
21
|
+
Role::Object::WithoutCodeExample =>
|
|
22
|
+
score_for(:code_example_single)
|
|
22
23
|
}
|
|
23
24
|
end
|
|
24
25
|
end
|
|
@@ -5,20 +5,20 @@ module Inch
|
|
|
5
5
|
end
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
require
|
|
8
|
+
require 'inch/language/elixir/provider/reader'
|
|
9
9
|
|
|
10
|
-
require
|
|
11
|
-
require
|
|
12
|
-
require
|
|
13
|
-
require
|
|
10
|
+
require 'inch/language/elixir/code_object/base'
|
|
11
|
+
require 'inch/language/elixir/code_object/module_object'
|
|
12
|
+
require 'inch/language/elixir/code_object/function_object'
|
|
13
|
+
require 'inch/language/elixir/code_object/type_object'
|
|
14
14
|
|
|
15
|
-
require
|
|
16
|
-
require
|
|
17
|
-
require
|
|
18
|
-
require
|
|
15
|
+
require 'inch/language/elixir/evaluation/base'
|
|
16
|
+
require 'inch/language/elixir/evaluation/module_object'
|
|
17
|
+
require 'inch/language/elixir/evaluation/function_object'
|
|
18
|
+
require 'inch/language/elixir/evaluation/type_object'
|
|
19
19
|
|
|
20
|
-
require
|
|
21
|
-
require
|
|
22
|
-
require
|
|
23
|
-
require
|
|
24
|
-
require
|
|
20
|
+
require 'inch/language/elixir/roles/base'
|
|
21
|
+
require 'inch/language/elixir/roles/object'
|
|
22
|
+
require 'inch/language/elixir/roles/module'
|
|
23
|
+
require 'inch/language/elixir/roles/function'
|
|
24
|
+
require 'inch/language/elixir/roles/type'
|