Ixchel
view release on metacpan or search on metacpan
lib/Ixchel.pm view on Meta::CPAN
my $rendered_template=$ixchel->action( action=>'template', opts=>{ t=>'extend_logsize' });
Now if we want to pass '--np' to not print it, we would do it like below.
my $rendered_template=$ixchel->action( action=>'template', opts=>{ t=>'extend_logsize', np=>1 });
If the following values are defined, the matching ENVs are set.
.proxy.ftp -> FTP_PROXY, ftp_proxy
.proxy.http -> HTTP_PROXY, http_proxy
.proxy.https -> HTTPS_PROXY, https_proxy
.perl.cpanm_home -> PERL_CPANM_HOME
Additionally any of the variables defined under .env will also be
set. So .env.TMPDIR will set $ENV{TMPDIR}.
=cut
sub action {
my ( $self, %opts ) = @_;
lib/Ixchel.pm view on Meta::CPAN
if ( defined( $opts{vars} ) ) {
$vars = $opts{vars};
}
# set the enviromental variables if needed
if ( defined( $self->{config}{proxy}{ftp} ) && $self->{config}{proxy}{ftp} ne '' ) {
$ENV{FTP_PROXY} = $self->{config}{proxy}{ftp};
$ENV{ftp_proxy} = $self->{config}{proxy}{ftp};
}
if ( defined( $self->{config}{proxy}{http} ) && $self->{config}{proxy}{http} ne '' ) {
$ENV{HTTP_PROXY} = $self->{config}{proxy}{http};
$ENV{http_proxy} = $self->{config}{proxy}{http};
}
if ( defined( $self->{config}{proxy}{https} ) && $self->{config}{proxy}{https} ne '' ) {
$ENV{HTTPS_PROXY} = $self->{config}{proxy}{https};
$ENV{https_proxy} = $self->{config}{proxy}{https};
}
if ( defined( $self->{config}{perl}{cpanm_home} ) && $self->{config}{perl}{cpanm_home} ne '' ) {
$ENV{PERL_CPANM_HOME} = $self->{config}{perl}{cpanm_home};
}
my @env_keys = keys( %{ $self->{config}{env} } );
lib/Ixchel/Actions/xeno_build.pm view on Meta::CPAN
$self->status_add(
type => $type,
status => 'Fetch "' . $fetch_name . '" DST Template Results: ' . $dst
);
} ## end if ($template_it)
my $return_code = 'undef';
my $return_extra = '';
eval {
my $ua = LWP::UserAgent->new( timeout => 10 );
if ( defined( $ENV{HTTP_PROXY} ) ) {
$ua->proxy( ['http'], $ENV{HTTP_PROXY} );
}
if ( defined( $ENV{HTTPS_PROXY} ) ) {
$ua->proxy( ['https'], $ENV{HTTPS_PROXY} );
}
if ( defined( $ENV{FTP_PROXY} ) ) {
$ua->proxy( ['ftp'], $ENV{FTP_PROXY} );
}
my $response = $ua->get($url);
lib/Ixchel/functions/file_get.pm view on Meta::CPAN
=head1 Functions
=head2 file_get
Any protocol understood via L<LWP> may be used.
If the $ENV variables below are set, they will be used for proxy info.
$ENV{FTP_PROXY}
$ENV{HTTP_PROXY}
$ENV{HTTPS_PROXY}
=cut
sub file_get {
my (%opts) = @_;
if ( !defined( $opts{url} ) ) {
die('url not specified');
}
my $content;
eval {
my $ua = LWP::UserAgent->new( timeout => 10 );
if ( defined( $ENV{HTTP_PROXY} ) ) {
$ua->proxy( ['http'], $ENV{HTTP_PROXY} );
}
if ( defined( $ENV{HTTPS_PROXY} ) ) {
$ua->proxy( ['https'], $ENV{HTTPS_PROXY} );
}
if ( defined( $ENV{FTP_PROXY} ) ) {
$ua->proxy( ['ftp'], $ENV{FTP_PROXY} );
}
my $response = $ua->get( $opts{url} );
lib/Ixchel/functions/github_fetch_release_asset.pm view on Meta::CPAN
Default :: 0
- umask :: The umask to use. Defaults to what ever sysopen uses.
- return :: Return the fetched item instead of writing it to a file.
Default :: 0
If the $ENV variables below are set, they will be used for proxy info.
$ENV{FTP_PROXY}
$ENV{HTTP_PROXY}
$ENV{HTTPS_PROXY}
Upon errors, this will die.
=cut
sub github_fetch_release_asset {
my (%opts) = @_;
if ( !defined( $opts{owner} ) ) {
lib/Ixchel/functions/github_fetch_release_asset.pm view on Meta::CPAN
my $fetch_it = 0;
if ( defined( $asset->{name} ) && $asset->{name} eq $opts{asset} ) {
$fetch_it = 1;
}
if ($fetch_it) {
my $asset_url = $asset->{browser_download_url};
my $content;
eval {
my $ua = LWP::UserAgent->new( timeout => 10 );
if ( defined( $ENV{HTTP_PROXY} ) ) {
$ua->proxy( ['http'], $ENV{HTTP_PROXY} );
}
if ( defined( $ENV{HTTPS_PROXY} ) ) {
$ua->proxy( ['https'], $ENV{HTTPS_PROXY} );
}
if ( defined( $ENV{FTP_PROXY} ) ) {
$ua->proxy( ['ftp'], $ENV{FTP_PROXY} );
}
my $response = $ua->get($asset_url);
lib/Ixchel/functions/github_releases.pm view on Meta::CPAN
The following are optional.
- raw :: Return the raw JSON and don't decode it.
Default :: 0
If the $ENV variables below are set, they will be used for proxy info,
but the ones above will take president over that and set the env vars.
$ENV{FTP_PROXY}
$ENV{HTTP_PROXY}
$ENV{HTTPS_PROXY}
Upon errors, this will die.
=cut
sub github_releases {
my (%opts) = @_;
if ( !defined( $opts{owner} ) ) {
lib/Ixchel/functions/github_releases.pm view on Meta::CPAN
}
if ( !defined( $opts{repo} ) ) {
die('repo not specified');
}
my $url = 'https://api.github.com/repos/' . $opts{owner} . '/' . $opts{repo} . '/releases';
my $content;
eval{
my $ua = LWP::UserAgent->new(timeout => 10);
if (defined($ENV{HTTP_PROXY})) {
$ua->proxy(['http'], $ENV{HTTP_PROXY});
}
if (defined($ENV{HTTPS_PROXY})) {
$ua->proxy(['https'], $ENV{HTTPS_PROXY});
}
if (defined($ENV{FTP_PROXY})) {
$ua->proxy(['ftp'], $ENV{FTP_PROXY});
}
my $response = $ua->get($url);
src_bin/ixchel view on Meta::CPAN
This is automatic for the action 'list_actions' and 'sys_info'
The option --config will be ignored if this is specified.
=head1 ENVIROMENTAL VARIABLES
If the following values are defined, the matching ENV is set.
.proxy.ftp -> FTP_PROXY
.proxy.http -> HTTP_PROXY
.proxy.https -> HTTPS_PROXY
.perl.cpanm_home -> PERL_CPANM_HOME
Additionally any of the variables defined under .env will also be
set. So .env.TMPDIR will set $ENV{TMPDIR}.
=cut
use strict;
use warnings;
( run in 3.193 seconds using v1.01-cache-2.11-cpan-71847e10f99 )