sorbet_view 0.19.0 → 0.20.0

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: a4a6dcbfa73d97af80ddfc038337a094df6adcfe3be2cdb95997e2eb6304993e
4
- data.tar.gz: 5d96c0eabf3534f72abebb91738f22546f157266368d7f92cf6faf6ac38ce44e
3
+ metadata.gz: 629b241dc8d1b11aa89e99921b68a88f017e084568c2f6456c1503c9fdb43a54
4
+ data.tar.gz: f56310e5c9a89e55bed12d91919b0dcbb08ed71d3c5e01bc62da62f790b22eda
5
5
  SHA512:
6
- metadata.gz: b6781e594f6fbcb73e9b7a62c9931c97c5f8cbf5375530dff6a6e4a35c7fce73e2333d586aa81e079c32d92b19c59b5b493abe27b0e638ca24e6bc9654d7987d
7
- data.tar.gz: 7a026a08b7eb1ebddbb586799095a9de5c39159e26886bc3b0ad2c11ce8382b28bc57c79ef7768c0b929cd3c4083c49663fa11a0b7d81aeb8777b0ce3c3ebd4a
6
+ metadata.gz: b322eb9643bcdba5bc0f7f1cd29d5978b96710017af9d070aa1821aeb17a5e06965f6b8c3f21eeeab04b97b4ce92be311e935e44ba0d27d0a7e6902ecedfa3cf
7
+ data.tar.gz: 13ac66bd93104f462c664b3fd89a75b89fb692dfec59a55b118b49a4fe0ad3d0ae7b45096b74259367165becd59669f63ba0c6b7afa657888526dd4ef7059dba
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module SorbetView
5
- VERSION = '0.19.0'
5
+ VERSION = '0.20.0'
6
6
  end
@@ -136,8 +136,7 @@ module Tapioca
136
136
  # Extract instance variables and their types from srb-lens for a controller action
137
137
  sig { params(controller: T.untyped, action_name: String).returns(T::Hash[String, String]) }
138
138
  def extract_ivars_from_srb_lens(controller, action_name)
139
- methods = @project.find_methods("#{controller.name}##{action_name}")
140
- method_info = methods&.first
139
+ method_info = find_method_info(controller, action_name)
141
140
  return {} unless method_info
142
141
 
143
142
  ivars = method_info.ivars
@@ -284,7 +283,8 @@ module Tapioca
284
283
 
285
284
  layout_name = controller._layout if controller.respond_to?(:_layout)
286
285
  if layout_name.is_a?(String) && !layout_name.empty?
287
- base_class_name = "SorbetView::Generated::Layouts::#{camelize(layout_name)}"
286
+ layout_parts = layout_name.split('/').map { |p| camelize(p) }
287
+ base_class_name = "SorbetView::Generated::Layouts::#{layout_parts.join('::')}"
288
288
  format_suffixes = find_template_format_suffixes('layouts', layout_name)
289
289
  class_names = format_suffixes.empty? ? [base_class_name] : format_suffixes.map { |fs| "#{base_class_name}::#{fs}" }
290
290
 
@@ -418,10 +418,15 @@ module Tapioca
418
418
  end
419
419
  end
420
420
 
421
+ # srb-lens matches class names by suffix, so a query for "FoosController#show" also
422
+ # matches "Admin::FoosController#show". Prefer the method whose FQN equals the query
423
+ # exactly; fall back to the first match, which is still needed for actions inherited
424
+ # from a parent controller (their FQN is the parent's and never equals the query).
421
425
  sig { params(controller: T.untyped, method_name: String).returns(T.untyped) }
422
426
  def find_method_info(controller, method_name)
423
- methods = @project.find_methods("#{controller.name}##{method_name}")
424
- methods&.first
427
+ query = "#{controller.name}##{method_name}"
428
+ methods = @project.find_methods(query)
429
+ methods&.find { |m| m.fqn == query } || methods&.first
425
430
  end
426
431
 
427
432
  sig { params(method_info: T.untyped).returns(T::Array[RBI::Param]) }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazuma
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-05-14 00:00:00.000000000 Z
10
+ date: 2026-07-09 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: herb