Astro-satpass

 view release on metacpan or  search on metacpan

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

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 unused
##  if ( ! $self->distribution() ) {
##  }
    return +{
	'Carp'		=> 0,
	'Clone'		=> 0,
	'Data::Dumper'	=> 0,
	'Exporter'	=> 5.64,
	'IO::File'	=> 0,
	'POSIX'		=> 0,
	'Scalar::Util'	=> 1.22,	# For looks_like_number
	'Time::Local'	=> 0,
	base		=> 0,
	constant	=> 0,
	if		=> 0,
	strict		=> 0,
	warnings	=> 0,
	@extra,
    };
}

sub requires_perl {
    return 5.006002;
}

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

sub version_from {
    return 'lib/Astro/Coord/ECI.pm';
}

1;

__END__

=head1 NAME

My::Module::Meta - Information needed to build My::Module

=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<My::Module>. It
is private to the C<My::Module> package, and may be changed or
retracted without notice.

=head1 METHODS

This class supports the following public methods:

=head2 new

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

This method instantiates the class.

=head2 abstract

This method returns the distribution's abstract.



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