Permalink
Browse files

Deprecate Module::Build::YAML

  • Loading branch information...
1 parent 13bfbe0 commit 0e21de376880ed802a1c53e1a38f4555c9befb42 @xdg xdg committed Dec 10, 2010
Showing with 26 additions and 608 deletions.
  1. +6 −1 Build.PL
  2. +3 −0 Changes
  3. +6 −15 lib/Module/Build/Base.pm
  4. +11 −592 lib/Module/Build/YAML.pm
View
@@ -80,6 +80,7 @@ my $build = ModuleBuildBuilder->new(
'Perl::OSType' => 1, # needs 1.0 API
'version' => 0.87, # No longer requires M::B
'Module::Metadata' => 1,
+ 'YAML::Tiny' => 1.40,
},
recommends => {
'ExtUtils::Install' => 0.30,
@@ -131,7 +132,7 @@ my $build = ModuleBuildBuilder->new(
},
YAML_support => {
description => "Use YAML::Tiny to write META.yml files",
- requires => {'YAML::Tiny' => 1.38},
+ requires => {'YAML::Tiny' => 1.40},
},
manpage_support => {
description => "Create Unix man pages",
@@ -154,5 +155,9 @@ my $build = ModuleBuildBuilder->new(
);
$build->create_build_script;
+unless (-f "MYMETA.yml") { # fallback if we don't have YAML::Tiny
+ require File::Copy;
+ File::Copy::copy("META.yml", "MYMETA.yml");
+}
# vim:ts=2:sw=2:et:sta
View
@@ -16,6 +16,9 @@ Revision history for Perl extension Module::Build.
configure_requires is not supported. M::B::ModuleInfo remains as a
wrapper around Module::Metadata.
+ - Module::Build::YAML has been deprecated. Module::Build now depends
+ directly upon YAML::Tiny. M::B::YAML remains as a subclass wrapper.
+
0.36_19 - Tue Dec 7 13:43:42 EST 2010
Bug fixes:
@@ -4470,14 +4470,11 @@ sub read_metafile {
my ($metafile) = @_;
my $yaml;
- my $class = $self->_mb_feature('YAML_support')
- ? 'YAML::Tiny' : 'Module::Build::YAML' ;
-
- eval "require $class; 1" or die $@;
+ $self->_mb_feature('YAML_support') or return;
my $string = $self->_slurp($metafile, $] < 5.8 ? "" : ":utf8");
- my $meta = $class->read_string($string)
- or $self->log_warn( "Error parsing '$metafile': " . $class->errstr . "\n");
+ my $meta = $YAML::Tiny->read_string($string)
+ or $self->log_warn( "Error parsing '$metafile': " . YAML::Tiny->errstr . "\n");
return $meta->[0] || {};
}
@@ -4486,16 +4483,10 @@ sub read_metafile {
sub write_metafile {
my $self = shift;
my ($metafile, $node) = @_;
- my $yaml;
- if ($self->_mb_feature('YAML_support')) {
- # XXX this is probably redundant, but stick with it
- require YAML::Tiny;
- $yaml = YAML::Tiny->new($node);
- } else {
- require Module::Build::YAML;
- $yaml = Module::Build::YAML->new($node);
- }
+ return unless $self->_mb_feature('YAML_support');
+
+ my $yaml = YAML::Tiny->new($node);
my $string = $yaml->write_string;
return $self->_spew($metafile, $string, $] < 5.8 ? "" : ":utf8")
}
Oops, something went wrong.

0 comments on commit 0e21de3

Please sign in to comment.