lib/tapioca/generator.rb in tapioca-0.2.2 vs lib/tapioca/generator.rb in tapioca-0.2.3

- old
+ new

@@ -117,12 +117,12 @@ puts end sig { returns(T::Hash[String, String]) } def existing_rbis - @existing_rbis ||= Dir.glob("*@*.rbi", T.unsafe(base: outdir)) - .map { |f| File.basename(f, ".*").split('@') } + @existing_rbis ||= Pathname.glob((Pathname.new(outdir) / "*@*.rbi").to_s) + .map { |f| f.basename(".*").to_s.split('@') } .to_h end sig { returns(T::Hash[String, String]) } def expected_rbis @@ -289,10 +289,10 @@ filename = outdir / gem.rbi_file_name File.write(filename.to_s, content) say("Done", :green) - outdir.glob("#{gem.name}@*.rbi") do |file| + Pathname.glob((outdir / "#{gem.name}@*.rbi").to_s) do |file| remove(file) unless file.basename.to_s == gem.rbi_file_name end end end end