NAME

Module::New::Context

SYNOPSIS

my $context = Module::New->context;
my $value = $context->config('foo');
my $distribution = $context->distname;  # Some-Distribution-Name
$context->module('Some::Module::Name');

DESCRIPTION

This is used to hold various information on a distribution/module.

METHODS

new

creates an object.

config

returns a ::Config object if there's no argument, and returns an appropriate config value with an argument. If you pass more arguments, you can update the configuration temporarily (if you want to keep the values permanently, use ->config->save(@_) instead).

license

takes a license name (and an optional hash reference for Software::License) and returns a Software::License object (perl license by default).

distname, dist_name

holds a distribution name you passed to the command.

distid, dist_id

holds a distribution id, which is the lowercased distribution name, replaced hyphens with underscores.

module

holds a main module name you passed to the command (or the one converted from a distribution name).

mainfile, main_file

holds a main module file path.

maindir, main_dir

holds a main module directory path.

moduleid, module_id

holds a main module id, which is the lowercased module name, replaced double colons with underscores.

modulepath, module_path

holds a main module directory path, without prepending "lib".

modulebase, module_base

holds a basename of the main module, without ".pm".

repository

holds a repository url.

AUTHOR

Kenichi Ishigaki, <ishigaki@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2007-2009 by Kenichi Ishigaki.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.