Skip to content

Commit

Permalink
Do not use gem's rbi/ with tapioca
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
  • Loading branch information
Morriar committed Jul 30, 2020
1 parent d05dd7f commit f768c2c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions gems/sorbet/lib/find-gem-rbis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,17 @@ def self.main
gemspecs = Bundler.load.specs.sort_by(&:name)

gem_source_paths = T.let([], T::Array[String])
gemspecs.each do |gemspec|
gem_source_paths << paths_within_gem_sources(gemspec)

# Tapioca (https://github.com/Shopify/tapioca) does not require gems `rbi/` folders
# to be passed to Sorbet as it copies the signatures at RBI generation time.
#
# To avoid conflicts between RBIs generated with tapioca and the one provided by the
# gem, we disable the `rbi/` caching and let Sorbet use the RBIs from `sorbet/rbi/gems`.

unless gemspecs.any? { |g| g.name == 'tapioca' }
gemspecs.each do |gemspec|
gem_source_paths << paths_within_gem_sources(gemspec)
end
end

File.write(output_file, gem_source_paths.compact.join("\n"))
Expand Down

0 comments on commit f768c2c

Please sign in to comment.