rbs_activesupport 1.4.1 → 1.4.2

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: 4ae53360ab164472d4e7ec85deda07504d139bfb1ae654bdaac8589f0f9d191a
4
- data.tar.gz: 32da6fa5ac99c059b2625c82b72c6e354e1980a549bff337094cd8bc15ac0e94
3
+ metadata.gz: ddd9bc606628feb9ac3300697d3f0c1ff82f8e1f53b01731bd3bdab771ada81b
4
+ data.tar.gz: 3d88f52a450782c345d38ba07ece5f48d6c26719d77a4e53dd038c257441203c
5
5
  SHA512:
6
- metadata.gz: 35a5f3ede5ab15f4524766710314749425225fad5ab8f6f88c1394ebd82f8df858814b6dd401ca768d7b1183db46ae9e9d3eaa2242c79b5a670152e339c5f1b6
7
- data.tar.gz: 53d1b808b66ae6e3c5ae421e61267bfc2d2ce86e3c7ad02be163c94a70d4611af0c148ed6a825460dd4f4c7bb2923bcb12871cd3fa087377dd1facd5a123a7a8
6
+ metadata.gz: 4c78e09a673e6af25bbbf2d945448f0dcc19a3fa9d602187df8b807a77f8cc52f597b0e8c007d7cddc82284144b59dc31a05ccfb6a12b4fd400f26393171d214
7
+ data.tar.gz: af0892f0476bb5229ae60028c729ecbc15f4f1cd35706bf465cbc3a69df33803aa3c4de50f497d7b2d0e0197e6249b5a6062d4ab4f3290dd595dfb03a8d3d7f5
@@ -2,8 +2,16 @@
2
2
  "rbs-helper.signature-directory": "sig/",
3
3
  "cSpell.words": [
4
4
  "cattr",
5
+ "classmethods",
5
6
  "Cyclomatic",
6
- "mattr"
7
+ "DEFN",
8
+ "FCALL",
9
+ "mattr",
10
+ "mkpath",
11
+ "rmtree",
12
+ "tasklib",
13
+ "VCALL",
14
+ "ZLIST"
7
15
  ],
8
16
  "rbs-helper.rbs-inline-on-save": true,
9
17
  "rbs-helper.rbs-inline-options": "--opt-out --output=sig/"
@@ -35,8 +35,13 @@ module RbsActivesupport
35
35
  when :LIT, :STR
36
36
  node.children.first
37
37
  when :HASH
38
- elem = node.children.first.children.compact.map { |e| eval_node(e) }
39
- Hash[*elem]
38
+ children = node.children.first&.children
39
+ if children
40
+ items = children.compact.map { |i| eval_node(i) }
41
+ Hash[*items]
42
+ else
43
+ {}
44
+ end
40
45
  when :ZLIST
41
46
  []
42
47
  when :LIST
@@ -53,6 +58,8 @@ module RbsActivesupport
53
58
  eval_node(node.children.first) + RBS::Namespace.new(path: [node.children.last], absolute: false)
54
59
  when :COLON3
55
60
  RBS::Namespace.new(path: node.children, absolute: true)
61
+ when :CALL, :ITER
62
+ node
56
63
  else
57
64
  p node # for debug
58
65
  raise
@@ -86,6 +86,12 @@ module RbsActivesupport
86
86
  # @rbs context: RBS::Namespace?
87
87
  def build_include(namespace, method_call, context) #: Array[t]
88
88
  module_paths = eval_include_args(method_call.args)
89
+ module_paths.delete_if do |module_path|
90
+ unless module_path.is_a?(RBS::Namespace)
91
+ puts "ERROR: #{namespace}:#{method_call.name}: Failed to recognize an included module: #{module_path}"
92
+ true
93
+ end
94
+ end
89
95
  module_paths.flat_map do |module_path|
90
96
  include = Include.new(context || namespace, module_path, { private: method_call.private? })
91
97
  ([include] +
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbsActivesupport
4
- VERSION = "1.4.1" #: String
4
+ VERSION = "1.4.2" #: String
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs_activesupport
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takeshi KOMIYA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-21 00:00:00.000000000 Z
11
+ date: 2024-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport