doc_type_checker 0.1.0 → 0.1.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 690eb99307ad3891f99d4a0119328de5f626f60e61e4a3de30b44199d20f6a7e
|
4
|
+
data.tar.gz: dc7b4b72daa1ada2e2cf2fc1525b25591838102d1718fb10dec6e8d04651a606
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98a53c34d507ca3dc02f98caf6715abf7ce1d0924183110277d37f088e7ec456cfc3be4223af4468658df760794759da84fd17242c420cfcc08c1a078da04536
|
7
|
+
data.tar.gz: 9ec1e8c89f9cc7306ac3672170a3f2184f84053ec530b3c44e4314cbd72bc9f0e2443115c7aa63859d6734d103a3555836e7a7505793dd2ed71bba737f783dee
|
@@ -20,6 +20,12 @@ module DocTypeChecker
|
|
20
20
|
@trace_point.strict = strict
|
21
21
|
end
|
22
22
|
|
23
|
+
# @param [Logger, NilClass] logger
|
24
|
+
# @return [Logger, NilClass]
|
25
|
+
def logger=(logger)
|
26
|
+
@trace_point.logger = logger
|
27
|
+
end
|
28
|
+
|
23
29
|
# @param [Array] arguments
|
24
30
|
# @return [TrueClass, FalseClass]
|
25
31
|
def yard_run_arguments=(arguments)
|
@@ -42,7 +42,7 @@ module DocTypeChecker
|
|
42
42
|
[tag.name.to_sym, TagType.new(tag)] if tag.tag_name == 'param'
|
43
43
|
end.to_h
|
44
44
|
unless @params.empty? || @params.keys == actual_params_definition(method_object)
|
45
|
-
raise ArgumentError, "params doesn't match actual arguments"
|
45
|
+
raise ArgumentError, "#{name}: params doesn't match actual arguments"
|
46
46
|
end
|
47
47
|
|
48
48
|
@params
|
@@ -11,7 +11,7 @@ module DocTypeChecker
|
|
11
11
|
def initialize(tag)
|
12
12
|
raise ArgumentError unless ALLOW_TAG_NAMES.include?(tag.tag_name)
|
13
13
|
|
14
|
-
@types = tag.types.to_a.
|
14
|
+
@types = tag.types.to_a.flat_map.filter_map { |type_comment| const_get(type_comment) }
|
15
15
|
end
|
16
16
|
|
17
17
|
# @param [Object] object
|
@@ -29,8 +29,11 @@ module DocTypeChecker
|
|
29
29
|
|
30
30
|
# @todo support definition Array<Integer>
|
31
31
|
# @param [String] type_comment
|
32
|
-
# @return [Class,
|
32
|
+
# @return [Class, NilClass]
|
33
33
|
def const_get(type_comment)
|
34
|
+
return if type_comment == 'void'
|
35
|
+
return [TrueClass, FalseClass] if type_comment == 'Boolean'
|
36
|
+
|
34
37
|
type_comment.match(/\A([\w:]+)(<.+>)?\z/) do
|
35
38
|
Object.const_get(Regexp.last_match(1))
|
36
39
|
end || (raise ArgumentError, "#{type_comment} isn't matched class")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doc_type_checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shoma07
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|