App-Music-ChordPro

 view release on metacpan or  search on metacpan

lib/ChordPro/Config/Data.pm  view on Meta::CPAN

package ChordPro::Config::Data;

use JSON::XS qw();
use JSON::Relaxed::Parser qw();
use feature qw(state);
# Config version.
our $VERSION = 6.081;

sub config {
    state $pp = JSON::XS->new->utf8
	->boolean_values( $JSON::Boolean::false, $JSON::Boolean::true );

    $pp->decode( <<'EndOfJSON' );
{"a2crd":{"classifier":"pct_chords","infer-titles":true,"tabstop":"8"},"assets":{},"chord-formats":{"common":"%{root|%{}%{qual|%{}}%{ext|%{}}%{bass|/%{}}|%{name}}","nashville":"%{root|%{}%{qual|<sup>%{}</sup>}%{ext|<sup>%{}</sup>}%{bass|/<sub>%{}</su...
EndOfJSON
}

1;

script/cfgboot.pl  view on Meta::CPAN

use JSON::XS qw();
use JSON::Relaxed::Parser qw();
use feature qw(state);
EOD

print "# Config version.\nour \$VERSION = ", $data->{meta}->{_configversion}, ";\n\n";

print <<'EOD';
sub config {
    state $pp = JSON::XS->new->utf8
	->boolean_values( $JSON::Boolean::false, $JSON::Boolean::true );

    $pp->decode( <<'EndOfJSON' );
EOD

print ( $writer->encode($data), "\n" );

print <<EOD;
EndOfJSON
}

script/rrjson.pl  view on Meta::CPAN

    elsif ( $mode eq "rjson" ) {
	print $parser->encode( data => $data,
			       strict => 1,
			       indent => $indent,
			       maybe schema => $schema );
	print "\n" unless $pretty;
    }
    elsif ( $mode eq "json_xs" ) {
	require JSON::XS;
	print ( JSON::XS->new->canonical->utf8(0)->pretty($pretty)
		->boolean_values( $JSON::PP::false, $JSON::PP::true )
		->convert_blessed->encode($data) );
    }

    elsif ( $mode eq "toml" ) {
	require TOML::Tiny;
	my $parser = TOML::Tiny->new();
	print ( TOML::Tiny::to_toml($data) );
    }

    elsif ( $mode eq "yaml" ) {
	require YAML;
	$YAML::UseAliases = 0;
	$YAML::Stringify = 1;
	print ( YAML::Dump($data) );
    }

    else {			# default JSON
	require JSON::PP;
	print ( JSON::PP->new->canonical->utf8(0)->pretty($pretty)
		->boolean_values( $JSON::PP::false, $JSON::PP::true )
		->convert_blessed->encode($data) );
    }
}

################ Subroutines ################

package Data::Properties {

sub __data_internal {
    my ( $self, $orig ) = @_;



( run in 0.785 second using v1.01-cache-2.11-cpan-9ff20fc0ed8 )