decode 0.24.4 → 0.24.5

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: 69a1cefaeaebe1d53746d8244acad208122dccd964ef8ded1c70b7f3e1ab856f
4
- data.tar.gz: f3ef222826e20af488964480baf64d72ee9b55a6ad849057f40eebe09934ca37
3
+ metadata.gz: 403ad9626fb4852046e983a7d5c71d1edf6d5d1ab922b8872c46f3b856303291
4
+ data.tar.gz: ec06989a5e4081c1c23e2f6ed39049faaf449c866370496de19a35a31c1a703a
5
5
  SHA512:
6
- metadata.gz: a2c97db6ff06407597b2c42513a0cb4827824abb41ec480a8e6fb1e2d3b8c4366e61c2d34f1f2f706d3cee33f6be6ff5464ef8e668e491534a9692954d14bba3
7
- data.tar.gz: f051d9ea291738263feee8091a40137ca4578316f762b6d93ef26dc03001f1a138d26a25878c39a7029eee4f59a742a2d59492a1b0ac55a77c8312d28de53a86
6
+ metadata.gz: bc8f774f1f9ed21c1d985dc7124fbf2c5c6ea37b3502575186fcbbe6b406d0e62a6914a2c6929d72ef0ec258603b14146c71ac04e2867c3f2ed597f766dededc
7
+ data.tar.gz: be3291575b35ee43dc03a33a3f8e28f99ed3a792ec156d2a297a0956e00ae569217c5d8afe80f3c5f1bce1b77cc186fe317fdceda19a98d43ec72663014bebab
checksums.yaml.gz.sig CHANGED
Binary file
@@ -6,6 +6,9 @@
6
6
  module Decode
7
7
  # Represents a location in a source file.
8
8
  class Location
9
+ # Initialize a new location.
10
+ # @parameter path [String] The path to the source file.
11
+ # @parameter line [Integer] The line number in the source file.
9
12
  def initialize(path, line)
10
13
  @path = path
11
14
  @line = line
@@ -164,7 +164,7 @@ module Decode
164
164
  # Handle rest parameter (*args):
165
165
  if node.parameters.respond_to?(:rest) && node.parameters.rest
166
166
  rest_param = node.parameters.rest
167
- name = rest_param.name || :args
167
+ name = rest_param.respond_to?(:name) && rest_param.name ? rest_param.name : :args
168
168
  base_type = doc_types[name.to_s] || ::RBS::Parser.parse_type("untyped")
169
169
 
170
170
  rest_positionals = ::RBS::Types::Function::Param.new(
@@ -192,7 +192,7 @@ module Decode
192
192
  # Handle keyword rest parameter (**kwargs):
193
193
  if node.parameters.respond_to?(:keyword_rest) && node.parameters.keyword_rest
194
194
  rest_param = node.parameters.keyword_rest
195
- if rest_param.name
195
+ if rest_param.respond_to?(:name) && rest_param.name
196
196
  name = rest_param.name
197
197
  base_type = doc_types[name.to_s] || ::RBS::Parser.parse_type("untyped")
198
198
 
@@ -321,7 +321,7 @@ module Decode
321
321
  # Handle rest parameter (*args):
322
322
  if node.parameters.respond_to?(:rest) && node.parameters.rest
323
323
  rest_param = node.parameters.rest
324
- name = rest_param.name || :args
324
+ name = rest_param.respond_to?(:name) && rest_param.name ? rest_param.name : :args
325
325
  base_type = doc_types[name.to_s] || ::RBS::Parser.parse_type("untyped")
326
326
  # Rest parameters should be `Array[T]`:
327
327
  array_type = ::RBS::Types::ClassInstance.new(
@@ -407,7 +407,7 @@ module Decode
407
407
  # Handle keyword rest parameter (**kwargs):
408
408
  if node.parameters.respond_to?(:keyword_rest) && node.parameters.keyword_rest
409
409
  rest_param = node.parameters.keyword_rest
410
- if rest_param.name
410
+ if rest_param.respond_to?(:name) && rest_param.name
411
411
  name = rest_param.name
412
412
  base_type = doc_types[name.to_s] || ::RBS::Parser.parse_type("untyped")
413
413
  # Keyword rest should be `Hash[Symbol, T]`:
@@ -8,6 +8,7 @@ require "console"
8
8
 
9
9
  module Decode
10
10
  module RBS
11
+ # Utilities for working with RBS types.
11
12
  module Type
12
13
  # Check if an RBS type represents a nullable/optional type
13
14
  # This method recursively traverses the type tree to find nil anywhere
data/lib/decode/trie.rb CHANGED
@@ -14,7 +14,7 @@ module Decode
14
14
  # Initialize an empty node.
15
15
  def initialize
16
16
  @children = {}
17
- @values = []
17
+ @values = nil
18
18
  end
19
19
 
20
20
  # Generate a string representation of this node.
@@ -5,5 +5,5 @@
5
5
 
6
6
  module Decode
7
7
  # @constant [String] The version of the gem.
8
- VERSION = "0.24.4"
8
+ VERSION = "0.24.5"
9
9
  end
data/sig/decode.rbs CHANGED
@@ -852,7 +852,8 @@ module Decode
852
852
 
853
853
  @line: Integer
854
854
 
855
- public def initialize: (untyped path, untyped line) -> void
855
+ # Initialize a new location.
856
+ public def initialize: (String path, Integer line) -> void
856
857
 
857
858
  # Generate a string representation of the location.
858
859
  public def to_s: () -> untyped
@@ -994,6 +995,7 @@ module Decode
994
995
  private def build_attributes_rbs: (Array attribute_definitions) -> Array
995
996
  end
996
997
 
998
+ # Utilities for working with RBS types.
997
999
  module Type
998
1000
  # Check if an RBS type represents a nullable/optional type
999
1001
  # This method recursively traverses the type tree to find nil anywhere
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.4
4
+ version: 0.24.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file