-
Notifications
You must be signed in to change notification settings - Fork 155
Closed
Description
Hello,
I have a custom Ruby app that I'd like to generate RBI files for. I do use active record and an app/models
directory structure, but I'm handling loading myself in what's most likely a non-standard way, so I don't think that tapioca is able to find the files within my structure to create RBI definitions for them. My folder structure looks roughly like the following:
├── Gemfile
├── Gemfile.lock
├── app
│ ├── models
│ ├── services
│ └── workers
├── bin
│ ├── server
│ └── tapioca
├── config
│ ├── environment.rb
│ ├── initializers
├── db
│ ├── migrate
│ ├── seeds.rb
├── sorbet
│ ├── config
│ ├── rbi
│ └── tapioca
I updated my sorbet/tapioca/require.rb
file to attempt to require each file in my app/models
folder individually so tapioca could find them, but that doesn't generate any definitions for them (there are no errors or warnings either):
app_root = File.expand_path("../..", File.dirname(__FILE__))
require "active_record"
# require ...other things ...
Dir[File.expand_path "#{app_root}/app/models/**/*.rb"].sort.each do |file|
require file
end
Dir[File.expand_path "#{app_root}/app/services/**/*.rb"].sort.each do |file|
require file
end
Dir[File.expand_path "#{app_root}/app/workers/**/*.rb"].sort.each do |file|
require file
end
I was wondering if you all had any ideas as to how I might generate those definitions based on the above. Thanks!
Metadata
Metadata
Assignees
Labels
No labels