'CPAN::Meta::YAML' =>
{
'MAINTAINER' => 'dagolden',
- 'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-YAML-0.003.tar.gz',
+ 'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-YAML-0.004.tar.gz',
'FILES' => q[cpan/CPAN-Meta-YAML],
'EXCLUDED' => [
't/04_scalar.t', # requires YAML.pm
package CPAN::Meta::YAML;
-BEGIN {
- $CPAN::Meta::YAML::VERSION = '0.003';
+{
+ $CPAN::Meta::YAML::VERSION = '0.004';
}
use strict;
$string =~ s/([\x00-\x1f])/\\$UNPRINTABLE[ord($1)]/g;
return qq|"$string"|;
}
- if ( $string =~ /(?:^\W|\s)/ or $QUOTE{$string} ) {
+ if ( $string =~ /(?:^\W|\s|:\z)/ or $QUOTE{$string} ) {
return "'$string'";
}
return $string;
# Use Scalar::Util if possible, otherwise emulate it
BEGIN {
+ local $@;
eval {
require Scalar::Util;
- *refaddr = *Scalar::Util::refaddr;
};
- eval <<'END_PERL' if $@;
-# Failed to load Scalar::Util
+ if ( $@ or $Scalar::Util::VERSION < 1.18 ) {
+ eval <<'END_PERL' if $@;
+# Scalar::Util failed to load or too old
sub refaddr {
my $pkg = ref($_[0]) or return undef;
if ( !! UNIVERSAL::can($_[0], 'can') ) {
$i;
}
END_PERL
-
+ } else {
+ *refaddr = *Scalar::Util::refaddr;
+ }
}
1;
=head1 VERSION
-version 0.003
+version 0.004
=head1 SYNOPSIS
L<YAML::Tiny>, L<YAML>, L<YAML::XS>
+=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders
+
+=head1 SUPPORT
+
+=head2 Bugs / Feature Requests
+
+Please report any bugs or feature requests by email to C<bug-cpan-meta-yaml at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Meta-YAML>. You will be automatically notified of any
+progress on the request by the system.
+
+=head2 Source Code
+
+This is open source software. The code repository is available for
+public review and contribution under the terms of the license.
+
+L<http://github.com/dagolden/cpan-meta-yaml>
+
+ git clone http://github.com/dagolden/cpan-meta-yaml
+
=head1 AUTHORS
=over 4
use File::Spec::Functions ':ALL';
use t::lib::Test;
-use Test::More tests(37, 0, 12);
+use Test::More tests(37, 0, 13);
use CPAN::Meta::YAML qw{
Load Dump
LoadFile DumpFile
- 'Off'
- 'OFF'
END_YAML
+
+
+
+
+
+######################################################################
+# Always quote for scalars ending with :
+
+is_deeply(
+ CPAN::Meta::YAML->new( [ 'A:' ] )->write_string,
+ "---\n- 'A:'\n",
+ 'Simple scalar ending in a colon is correctly quoted',
+);