Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.2", "3.3", "3.4", "head"]
ruby: ["3.2", "3.3", "3.4", "4.0","head"]
rails: ["8.0", "current", "main"]
rubygems: ["3.6.2"]
exclude:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.4
4.0.0
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ group :development, :test do
gem "sqlite3"
gem "mutex_m"
gem "smart_properties"
gem "json_api_client"
# Needed for Ruby 4.0 compatibility
# Can be removed once https://github.com/JsonApiClient/json_api_client/pull/416 is merged
gem "json_api_client", github: "paracycle/json_api_client", branch: "uk-bump-versions"
gem "frozen_record"
gem "sprockets"
gem "state_machines"
Expand Down
60 changes: 38 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
GIT
remote: https://github.com/paracycle/json_api_client.git
revision: 9564f34d250e852b90d24505ab6fe3214f936eef
branch: uk-bump-versions
specs:
json_api_client (1.23.0)
activemodel (>= 6.0.0)
activesupport (>= 6.0.0)
addressable (~> 2.2)
faraday (>= 1.10, < 3.0)
faraday-gzip (>= 1.0, < 4.0)
rack (>= 0.2)

PATH
remote: .
specs:
Expand All @@ -11,6 +24,7 @@ PATH
sorbet-static-and-runtime (>= 0.5.11087)
spoom (>= 1.7.9)
thor (>= 1.2.0)
tsort
yard-sorbet

GEM
Expand Down Expand Up @@ -133,8 +147,8 @@ GEM
erubi (1.13.1)
faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.2)
faraday-gzip (2.0.1)
faraday (>= 1.0)
faraday-gzip (3.1.0)
faraday (>= 2.0, < 3)
zlib (~> 3.0)
faraday-net_http (3.1.0)
net-http
Expand All @@ -143,6 +157,9 @@ GEM
activemodel
globalid (1.2.1)
activesupport (>= 6.1)
google-protobuf (4.33.2)
bigdecimal
rake (>= 13)
google-protobuf (4.33.2-aarch64-linux-gnu)
bigdecimal
rake (>= 13)
Expand Down Expand Up @@ -177,13 +194,6 @@ GEM
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.18.0)
json_api_client (1.23.0)
activemodel (>= 6.0.0)
activesupport (>= 6.0.0)
addressable (~> 2.2)
faraday (>= 1.10, < 3.0)
faraday-gzip (>= 1.0, < 3.0)
rack (>= 0.2)
kramdown (2.5.1)
rexml (>= 3.3.9)
kredis (1.8.0)
Expand All @@ -203,6 +213,7 @@ GEM
net-smtp
marcel (1.0.4)
mini_mime (1.1.5)
mini_portile2 (2.8.9)
minitest (5.27.0)
minitest-hooks (1.5.3)
minitest (> 5.3)
Expand All @@ -225,6 +236,9 @@ GEM
net-protocol
netrc (0.11.0)
nio4r (2.7.4)
nokogiri (1.18.10)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.18.10-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.10-aarch64-linux-musl)
Expand Down Expand Up @@ -349,15 +363,15 @@ GEM
rack (>= 3.2.0)
redis-client (>= 0.26.0)
smart_properties (1.17.0)
sorbet (0.6.12869)
sorbet-static (= 0.6.12869)
sorbet-runtime (0.6.12869)
sorbet-static (0.6.12869-aarch64-linux)
sorbet-static (0.6.12869-universal-darwin)
sorbet-static (0.6.12869-x86_64-linux)
sorbet-static-and-runtime (0.6.12869)
sorbet (= 0.6.12869)
sorbet-runtime (= 0.6.12869)
sorbet (0.6.12873)
sorbet-static (= 0.6.12873)
sorbet-runtime (0.6.12873)
sorbet-static (0.6.12873-aarch64-linux)
sorbet-static (0.6.12873-universal-darwin)
sorbet-static (0.6.12873-x86_64-linux)
sorbet-static-and-runtime (0.6.12873)
sorbet (= 0.6.12873)
sorbet-runtime (= 0.6.12873)
spoom (1.7.11)
erubi (>= 1.10.0)
prism (>= 0.28.0)
Expand All @@ -370,6 +384,8 @@ GEM
concurrent-ruby (~> 1.0)
logger
rack (>= 2.2.4, < 4)
sqlite3 (2.5.0)
mini_portile2 (~> 2.8.0)
sqlite3 (2.5.0-aarch64-linux-gnu)
sqlite3 (2.5.0-aarch64-linux-musl)
sqlite3 (2.5.0-arm64-darwin)
Expand All @@ -385,7 +401,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
unicode-emoji (4.2.0)
uri (1.1.1)
useragent (0.16.11)
webmock (3.26.1)
Expand All @@ -402,7 +418,7 @@ GEM
sorbet-runtime
yard
zeitwerk (2.7.4)
zlib (3.1.0)
zlib (3.2.2)

PLATFORMS
aarch64-linux
Expand All @@ -428,7 +444,7 @@ DEPENDENCIES
graphql
identity_cache
irb
json_api_client
json_api_client!
kramdown (~> 2.5)
kredis
minitest (< 6.0)
Expand All @@ -454,4 +470,4 @@ DEPENDENCIES
xpath

BUNDLED WITH
2.6.2
4.0.3
29 changes: 27 additions & 2 deletions lib/tapioca/runtime/trackers/constant_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module ConstantDefinition
])
end

(@class_files[key] ||= Set.new) << loc
ConstantDefinition.register(key, loc)
end

@creturn_tracepoint = TracePoint.trace(:c_return) do |tp|
Expand All @@ -46,7 +46,7 @@ module ConstantDefinition
next unless Module === key

loc = build_source_location(tp, caller_locations)
(@class_files[key] ||= Set.new) << loc
ConstantDefinition.register(key, loc)
end

class << self
Expand All @@ -67,6 +67,22 @@ def build_source_location(tp, locations)
SourceLocation.from_loc([file || "", lineno])
end

def register(constant, loc)
return unless loc

(@class_files[constant] ||= Set.new) << loc
end

def register_cname(cname, namespace, locations)
return if namespace.autoload?(cname)

key = Reflection.constantize(cname, namespace: namespace, inherit: true)
return unless Module === key

loc = Reflection.resolve_loc(locations)
ConstantDefinition.register(key, loc)
end

# Returns the files in which this class or module was opened. Doesn't know
# about situations where the class was opened prior to +require+ing,
# or where metaprogramming was used via +eval+, etc.
Expand All @@ -84,3 +100,12 @@ def locations_for(klass)
end
end
end

class Module
prepend(::Module.new do
def const_added(cname)
::Tapioca::Runtime::Trackers::ConstantDefinition.register_cname(cname, self, Kernel.caller_locations)
super(cname)
end
end)
end
3 changes: 3 additions & 0 deletions sorbet/config
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
--enable-experimental-requires-ancestor
--enable-experimental-rbs-comments
--suppress-payload-superclass-redefinition-for=Reline::ANSI
--suppress-payload-superclass-redefinition-for=RDoc::Markup::BlankLine
--suppress-payload-superclass-redefinition-for=RDoc::Markup::HardBreak
--suppress-payload-superclass-redefinition-for=RDoc::Markup::Heading
7 changes: 0 additions & 7 deletions sorbet/rbi/gems/[email protected]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion sorbet/rbi/gems/[email protected]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 0 additions & 74 deletions sorbet/rbi/gems/[email protected]

This file was deleted.

Loading
Loading