lib/tapioca/gemfile.rb in tapioca-0.5.3 vs lib/tapioca/gemfile.rb in tapioca-0.5.4
- old
+ new
@@ -112,16 +112,17 @@
gem_ignored? || gem_in_app_dir?(gemfile_dir)
end
sig { returns(T::Array[Pathname]) }
def files
- spec = @spec
- if default_gem? && spec.is_a?(::Gem::Specification)
- spec.files.map do |file|
+ if default_gem?
+ # `Bundler::RemoteSpecification` delegates missing methods to
+ # `Gem::Specification`, so `files` actually always exists on spec.
+ T.unsafe(@spec).files.map do |file|
ruby_lib_dir.join(file)
end
else
- spec.full_require_paths.flat_map do |path|
+ @spec.full_require_paths.flat_map do |path|
Pathname.glob((Pathname.new(path) / "**/*.rb").to_s)
end
end
end