yard-sig 0.2.2 → 0.2.3

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: a5f0199099b90174466cf9c16956ad076ebef5c79a371eb28bd96e9f7ead2195
4
- data.tar.gz: 1760b6025f143dc79fdb34cf48f8f4cc2779047fbfe5203e74bf5a633e4b1eaa
3
+ metadata.gz: 7ab2bf52e54c80a38edafd9ddbd34e0c1238e26001b582e828cecbd44b7fde2a
4
+ data.tar.gz: 88be629986e49ae4d1d4fcb2a1555f2dcce9828664a9fbdc860ae4433d8240e2
5
5
  SHA512:
6
- metadata.gz: 18333b749e23f6da2ab2f6b946e8c1fce265fd1fa9c4ebbd6b108d93dd8e4226b0ef513b18e1ceafa151511a09f9e6161bc92a1067fd826fc68e4440da81de1a
7
- data.tar.gz: 5eb6cfcc8a229cd0550bd447db8c9397578ef51f67c178d739f22af3e008d7894ed3dc85bdeedb0f888da46d0fa0cc4dbdfe32a615cca3a4709a1d08201cd7b7
6
+ metadata.gz: 6f363d438620ae79fd852525a0ff3e8f3bd30adff94799d3a4e3a6aaae6e7e335d1a4357d212b1a5eae11021ab7953edf8b7c795356826300cedf2a81b0e7160
7
+ data.tar.gz: ccd484cc3b40d4335747946b799eb9d2796a75304a4435fa8128d1ee0b9d29505d2411cc1e91dce954a33b44895a20119e892d508c630dfa0279543f5845e2f6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.3] - 2024-02-07
4
+
5
+ - fix: fix invalid tags when specifying multiple types
6
+
3
7
  ## [0.2.2] - 2024-01-15
4
8
 
5
9
  - fix: support keyword arguments
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ [![Gem Version](https://badge.fury.io/rb/yard-sig.svg)](https://badge.fury.io/rb/yard-sig)
2
+ [![test](https://github.com/sinsoku/yard-sig/actions/workflows/test.yml/badge.svg)](https://github.com/sinsoku/yard-sig/actions/workflows/test.yml)
3
+
1
4
  # yard-sig
2
5
 
3
6
  A YARD plugin for writing documentations with [RBS syntax](https://github.com/ruby/rbs).
data/lib/yard-sig/sig.rb CHANGED
@@ -52,9 +52,9 @@ module YardSig
52
52
  name = type.name ? type.name.to_s : find_name_from_yard(kind, pos)
53
53
 
54
54
  if kind == :rest
55
- yard_types = "Array<#{yard_types}>"
55
+ yard_types = "Array<#{yard_types.join(", ")}>"
56
56
  elsif kind == :keyrest
57
- yard_types = "Hash{Symbol => #{yard_types}}"
57
+ yard_types = "Hash{Symbol => #{yard_types.join(", ")}}"
58
58
  end
59
59
 
60
60
  YARD::Tags::Tag.new(tag_name, "", yard_types, name)
@@ -82,29 +82,31 @@ module YardSig
82
82
  when RBS::Types::Bases::Void, RBS::Types::Bases::Any, RBS::Types::Bases::Bottom
83
83
  nil
84
84
  when RBS::Types::Bases::Top
85
- "Object"
85
+ ["Object"]
86
86
  when RBS::Types::Union
87
- type.types.map { |t| to_yard_type(t) }.join(", ")
87
+ type.types.map { |t| to_yard_type(t) }
88
88
  when RBS::Types::Tuple
89
89
  args = type.types.map { |t| to_yard_type(t) }.join(", ")
90
- "Array[#{args}]"
90
+ ["Array[#{args}]"]
91
91
  when RBS::Types::Bases::Bool
92
- "Boolean"
92
+ ["Boolean"]
93
93
  when RBS::Types::Bases::Instance
94
- @namespace.to_s
94
+ [@namespace.to_s]
95
95
  when RBS::Types::Optional
96
- "#{to_yard_type(type.type)}, nil"
96
+ [to_yard_type(type.type).join(", ").to_s, "nil"]
97
97
  when RBS::Types::ClassInstance
98
98
  args = type.args.map { |t| to_yard_type(t) }
99
99
  if args.empty?
100
- type.to_s
100
+ [type.to_s]
101
101
  elsif type.name.name == :Hash
102
- "#{type.name}{#{args[0]} => #{args[1]}}"
102
+ key = args[0].join(", ")
103
+ value = args[1].join(", ")
104
+ ["#{type.name}{#{key} => #{value}}"]
103
105
  else
104
- "#{type.name}<#{args.join(", ")}>"
106
+ ["#{type.name}<#{args.join(", ")}>"]
105
107
  end
106
108
  else
107
- type.to_s
109
+ [type.to_s]
108
110
  end
109
111
  end
110
112
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YardSig
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-sig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takumi Shotoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-15 00:00:00.000000000 Z
11
+ date: 2024-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbs
@@ -63,8 +63,8 @@ licenses:
63
63
  - MIT
64
64
  metadata:
65
65
  homepage_uri: https://github.com/sinsoku/yard-sig
66
- source_code_uri: https://github.com/sinsoku/yard-sig/blob/v0.2.2/CHANGELOG.md
67
- changelog_uri: https://github.com/sinsoku/yard-sig/tree/v0.2.2
66
+ source_code_uri: https://github.com/sinsoku/yard-sig/blob/v0.2.3/CHANGELOG.md
67
+ changelog_uri: https://github.com/sinsoku/yard-sig/tree/v0.2.3
68
68
  post_install_message:
69
69
  rdoc_options: []
70
70
  require_paths: