doc_type_checker 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0c5eff8a5f546b4d4a0483fb329bc28bf01eff351b41c25afd3cbf710d8febd
4
- data.tar.gz: 248fa2619df37cfc9d56ff1fa1e096999ac9b736b4ba200f084533e4bbd05538
3
+ metadata.gz: 690eb99307ad3891f99d4a0119328de5f626f60e61e4a3de30b44199d20f6a7e
4
+ data.tar.gz: dc7b4b72daa1ada2e2cf2fc1525b25591838102d1718fb10dec6e8d04651a606
5
5
  SHA512:
6
- metadata.gz: 4411c9653ff3cda9bb5f67c74ab7888d1c9f3b8f6c37df67d81c5a5b3f37aa226e1b20f50eb7db7490fa30ef300c84cd9a3fc6b6576f6a5682915433b3e1651b
7
- data.tar.gz: fa1d6e926586ec46a532bb9a81d6a89a2d775acd9d5c9336b4c0a3c63872e50687c5db48f5741fa5535bf306d46a81c4e39a9c1e35a149f86509eb4905274fa5
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.map { |type_comment| const_get(type_comment) }
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, Module]
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")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DocTypeChecker
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
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.0
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-22 00:00:00.000000000 Z
11
+ date: 2020-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard