Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
OrePAN2::Injector(3)  User Contributed Perl Documentation OrePAN2::Injector(3)

NAME
       OrePAN2::Injector - Inject a distribution to your DarkPAN

SYNOPSIS
	   use OrePAN2::Injector;

	   my $injector	= OrePAN2::Injector->new(directory => '/path/to/darkpan');

	   $injector->inject(
	       'http://cpan.metacpan.org/authors/id/M/MA/MAHITO/Acme-Hoge-0.03.tar.gz',
	       { author	=> 'MAHITO' },
	   );

DESCRIPTION
       OrePAN2::Injector allows	you to inject a	distribution into your
       DarkPAN.

METHODS
       "my $injector = OrePAN2::Injector-_new(%attr)"

       Constructor. Here %attr might be:

       o   directory

	   Your	DarkPAN	directory path.	This is	required.

       o   author

	   Default author of distributions.  If	you omit this, then "DUMMY"
	   will	be used.

	   BETA: As of OrePAN2 0.37, the author	attribute accepts a code
	   reference, so that you can calculate	author whenever	injecting
	   distributions:

	       my $author_cb = sub {
		   my $source =	shift;
		   $source =~ m{authors/id/./../([^/]+)} ? $1 :	"DUMMY";
	       };

	       my $injector = OrePAN2::Injector->new(
		   directory =>	'/path/to/darkpan',
		   author => $author_cb,
	       );

	       $injector->inject(
		   'http://cpan.metacpan.org/authors/id/M/MA/MAHITO/Acme-Hoge-0.03.tar.gz'
	       );
	       #=> Acme-Hoge-0.03 will be indexed with author MAHITO

	   Note	that the code reference	$author_cb will	be executed under the
	   following circumstances:

	       * the first argument is the $source argument to the inject method
	       * the working directory of it is	the top	level of the distribution in question

       "$injector-_inject($source, \%option)"

       Inject $source to your DarkPAN. Here $source is one of the following:

       o   local archive file

	   eg: /path/to/Text-TestBase-0.10.tar.gz

       o   HTTP	url

	   eg:
	   http://cpan.metacpan.org/authors/id/T/TO/TOKUHIROM/Text-TestBase-0.10.tar.gz

       o   git repository

	   eg: git://github.com/tokuhirom/Text-TestBase.git@master

	   Note	that you need to set up	git repository as a installable	git
	   repo, that is, you need to put a META.json in your repository.

	   If you are using Minilla or Milla, your repository is already ready
	   to install.

	   Supports the	following URL types:

	       git+file://path/to/repo.git
	       git://github.com/plack/Plack.git@1.0000	      #	tag
	       git://github.com/plack/Plack.git@devel	      #	branch

	   They	are compatible with cpanm.

       o   module name

	   eg: Data::Dumper

       "\%option" might	be:

       o   author

	   Author of the distribution. This overrides "new"'s author
	   attribute.

SEE ALSO
       orepan2-inject

LICENSE
       Copyright (C) tokuhirom.

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

AUTHOR
       tokuhirom <tokuhirom@gmail.com>

perl v5.32.1			  2015-07-14		  OrePAN2::Injector(3)

NAME | SYNOPSIS | DESCRIPTION | METHODS | SEE ALSO | LICENSE | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=OrePAN2::Injector&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help