about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrancois Perrad <francois.perrad@gadz.org>2010-10-26 14:04:50 +0200
committerFrancois Perrad <francois.perrad@gadz.org>2010-10-26 14:04:50 +0200
commitf2f876e6bbfbf4c53f720dd9691e96c6d7eeff02 (patch)
tree1f89ff8fd9777b7ebf7de39d1e127b129d5616b1
parentspore2dot: conditional generation of method/path (diff)
downloadapi-description-f2f876e6bbfbf4c53f720dd9691e96c6d7eeff02.tar.gz
spore2dot: refactor without read_from_json()
-rw-r--r--utils/spore2dot.pl10
1 files changed, 2 insertions, 8 deletions
diff --git a/utils/spore2dot.pl b/utils/spore2dot.pl
index c59d79a..57588e9 100644
--- a/utils/spore2dot.pl
+++ b/utils/spore2dot.pl
@@ -11,7 +11,8 @@ pod2usage(1) unless scalar(@ARGV) > 0;
 
 my @specs;
 foreach (@ARGV) {
-    push @specs, read_from_json($_);
+    my $content < io $_;
+    push @specs, JSON::decode_json($content);
 }
 
 print << 'DOT';
@@ -73,13 +74,6 @@ foreach my $spec (@specs) {
 }
 print "}\n";
 
-sub read_from_json {
-    my ($fname) = @_;
-
-    my $content < io $fname;
-    return JSON::decode_json($content);
-}
-
 __END__
 
 =head1 NAME