Skip to content

Commit f4856f2

Browse files
committed
work around broken open :p (pipe) feature in rakudo
1 parent 59eff62 commit f4856f2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Perl6/TypeGraph/Viz.pm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ class Perl6::TypeGraph::Viz {
9191
}
9292

9393
method to-file ($file, :$format = 'svg', :$size) {
94-
my $pipe = open "dot -T$format -o$file", :w, :p;
95-
$pipe.print: self.as-dot(:$size);
96-
close $pipe;
94+
my $tmpfile = IO::Spec.tmpdir ~ '/p6-doc-graphviz-' ~ (^100_000).pick;
95+
spurt $tmpfile, self.as-dot(:$size);
96+
run 'dot', "-T$format", "-o$file", $tmpfile;
97+
unlink $tmpfile;
9798
}
9899
}

0 commit comments

Comments
 (0)