Astro-SIMBAD-Client

 view release on metacpan or  search on metacpan

inc/My/Module/Meta.pm  view on Meta::CPAN

    return +{
	directory => [ qw{ eg inc t xt } ],
    };
}

sub provides {
    my $provides;
    local $@ = undef;

    eval {
	require CPAN::Meta;
	require ExtUtils::Manifest;
	require Module::Metadata;

	my $manifest;
	{
	    local $SIG{__WARN__} = sub {};
	    $manifest = ExtUtils::Manifest::maniread();
	}
	keys %{ $manifest || {} }
	    or return;

	# Skeleton so we can use should_index_file() and
	# should_index_package().
	my $meta = CPAN::Meta->new( {
		name	=> 'Euler',
		version	=> 2.71828,
		no_index	=> no_index(),
	    },
	);

	# The Module::Metadata docs say not to use
	# package_versions_from_directory() directly, but the 'files =>'
	# version of provides() is broken, and has been known to be so
	# since 2014, so it's not getting fixed any time soon. So:

	foreach my $fn ( sort keys %{ $manifest } ) {
	    $fn =~ m/ [.] pm \z /smx
		or next;
	    my $pvd = Module::Metadata->package_versions_from_directory(
		undef, [ $fn ] );
	    foreach my $pkg ( keys %{ $pvd } ) {
		$meta->should_index_package( $pkg )
		    and $meta->should_index_file( $pvd->{$pkg}{file} )
		    and $provides->{$pkg} = $pvd->{$pkg};
	    }
	}

	1;
    } or return;

    return ( provides => $provides );
}

sub requires {
    my ( undef, @extra ) = @_;		# Invocant not used.
##  if ( ! $self->distribution() ) {
##  }
    return +{
	'Carp'			=> 0,
	'HTTP::Request::Common'	=> 0,
	'LWP::Protocol'	=> 0,	# Comes with LWP, but ...
	'LWP::UserAgent' => 0,
##	'SOAP::Lite' => 0,
	'Scalar::Util' => 1.01,	# Not in Perl 5.6
	'URI::Escape' => 0,
	# 'XML::DoubleEncodedEntities' => 1.0,
	constant	=> 0,
	strict		=> 0,
	warnings	=> 0,
	@extra,
    };
}

sub requires_perl {
    return 5.008;	# SOAP::Lite dependencies
}

sub script_files {
    return [
	'script/simbadc',
    ];
}

sub version_from {
    return 'lib/Astro/SIMBAD/Client.pm';
}

1;

__END__

=head1 NAME

My::Module::Meta - Information needed to build Astro::SIMBAD::Client

=head1 SYNOPSIS

 use lib qw{ inc };
 use My::Module::Meta;
 my $meta = My::Module::Meta->new();
 use YAML;
 print "Required modules:\n", Dump(
     $meta->requires() );

=head1 DETAILS

This module centralizes information needed to build
C<Astro::SIMBAD::Client>. It is private to the C<Astro-SIMBAD-Client>
package, and may be changed or retracted without notice.

=head1 METHODS

This class supports the following public methods:

=head2 new

 my $meta = My::Module::Meta->new();

This method instantiates the class.



( run in 1.009 second using v1.01-cache-2.11-cpan-39bf76dae61 )