script/xcs2rng.pl untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 34 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2 #
3 # This file is part of Convert-TBX-RNG
4 #
5 # This software is copyright (c) 2013 by Alan K. Melby.
6 #
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 #
10 use strict;
11 use warnings;
12 # PODNAME: xcs2rng.pl
13 #TODO: test this
14 our $VERSION = '0.04'; # VERSION
15 # ABSTRACT: Create an RNG from an XCS file
16 #
17  
18 use Convert::TBX::RNG qw(generate_rng);
19 use TBX::XCS;
20 use TBX::XCS::JSON qw(xcs_from_json);
21 use File::Slurp;
22  
23 my $rng;
24 if($ARGV[0] eq '--json'){
25 my $json = read_file($ARGV[1]);
26 my $xcs = xcs_from_json($json);
27 $rng = generate_rng(xcs => $xcs);
28 }else{
29 $rng = generate_rng(xcs_file => $ARGV[0]);
30 }
31  
32 print $$rng;
33  
34 __END__