AWS-CloudFront
view release on metacpan or search on metacpan
12345678910111213141516171819---
#YAML:1.0
name: AWS-CloudFront
version: 0.003
abstract: Lightweight interface to Amazon CloudFront CDN
author:
- John Drago <jdrago_999
@yahoo
.com>
license: perl
distribution_type: module
test_requires:
Test::More: 0
requires:
AWS::S3: 0.023
Carp: 0
LWP::UserAgent: 0
Digest::HMAC_SHA1: 0
MIME::Base64: 0
URI::Escape: 0
VSO: 0.003
Data::Validate::Domain: 0.10
Makefile.PL view on Meta::CPAN
1234567891011121314151617181920212223242526use
strict;
use
warnings;
use
inc::Module::Install;
use
5.008005;
name
'AWS-CloudFront'
;
perl_version
'5.008001'
;
license
'perl'
;
all_from
'lib/AWS/CloudFront.pm'
;
test_requires
'Test::More'
=>
'0'
;
requires
'VSO'
=>
'0.022'
;
requires
'AWS::S3'
=>
'0.024'
;
requires
'Carp'
=>
'0'
;
requires
'HTTP::Date'
=>
'0'
;
requires
'MIME::Base64'
=>
'0'
;
requires
'URI::Escape'
=>
'0'
;
requires
'URI::QueryParam'
=>
'0'
;
requires
'URI::Escape'
=>
'0'
;
requires
'Digest::HMAC_SHA1'
=>
'0'
;
requires
'Data::Validate::Domain'
=>
'0.10'
;
requires
'LWP::Protocol::https'
=>
'6.02'
;
tests_recursive();
WriteAll();
inc/Module/Install/Makefile.pm view on Meta::CPAN
181920212223242526272829303132333435363738sub
prompt {
shift
;
# Infinite loop protection
my
@c
=
caller
();
if
( ++
$seen
{
"$c[1]|$c[2]|$_[0]"
} > 3 ) {
die
"Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"
;
}
# In automated testing, always use defaults
if
(
$ENV
{AUTOMATED_TESTING} and !
$ENV
{PERL_MM_USE_DEFAULT} ) {
local
$ENV
{PERL_MM_USE_DEFAULT} = 1;
goto
&ExtUtils::MakeMaker::prompt
;
}
else
{
goto
&ExtUtils::MakeMaker::prompt
;
}
}
sub
makemaker_args {
my
$self
=
shift
;
inc/Module/Install/Makefile.pm view on Meta::CPAN
828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
my
$self
=
shift
;
my
$libs
=
ref
$_
[0] ?
shift
: [
shift
];
$self
->makemaker_args(
LIBS
=>
$libs
);
}
sub
inc {
my
$self
=
shift
;
$self
->makemaker_args(
INC
=>
shift
);
}
my
%test_dir
= ();
sub
_wanted_t {
/\.t$/ and -f
$_
and
$test_dir
{
$File::Find::dir
} = 1;
}
sub
tests_recursive {
my
$self
=
shift
;
if
(
$self
->tests ) {
die
"tests_recursive will not work if tests are already defined"
;
}
my
$dir
=
shift
||
't'
;
unless
( -d
$dir
) {
die
"tests_recursive dir '$dir' does not exist"
;
}
%test_dir
= ();
File::Find::find( \
&_wanted_t
,
$dir
);
$self
->tests(
join
' '
,
map
{
"$_/*.t"
}
sort
keys
%test_dir
);
}
sub
write
{
my
$self
=
shift
;
die
"&Makefile->write() takes no arguments\n"
if
@_
;
# Make sure we have a new enough
# MakeMaker can complain about module versions that include
inc/Module/Install/Makefile.pm view on Meta::CPAN
123124125126127128129130131132133134135136137138139140141142143144# for details.
$self
->configure_requires(
'ExtUtils::MakeMaker'
=>
$ExtUtils::MakeMaker::VERSION
=~ /^(\d+\.\d+)/ );
# Generate the
my
$args
=
$self
->makemaker_args;
$args
->{DISTNAME} =
$self
->name;
$args
->{NAME} =
$self
->module_name ||
$self
->name;
$args
->{VERSION} =
$self
->version;
$args
->{NAME} =~ s/-/::/g;
if
(
$self
->tests ) {
$args
->{test} = {
TESTS
=>
$self
->tests };
}
if
($] >= 5.005) {
$args
->{ABSTRACT} =
$self
->abstract;
$args
->{AUTHOR} =
$self
->author;
}
if
(
eval
(
$ExtUtils::MakeMaker::VERSION
) >= 6.10 ) {
$args
->{NO_META} = 1;
}
if
(
eval
(
$ExtUtils::MakeMaker::VERSION
) > 6.17 and
$self
->sign ) {
$args
->{SIGN} = 1;
inc/Module/Install/Makefile.pm view on Meta::CPAN
201202203204205206207208209210211212213214215216217218219220221
.
$self
->preamble
:
''
;
my
$postamble
=
"# Postamble by $top_class $top_version\n"
. (
$self
->postamble ||
''
);
local
*MAKEFILE
;
open
MAKEFILE,
"< $makefile_name"
or
die
"fix_up_makefile: Couldn't open $makefile_name: $!"
;
my
$makefile
=
do
{
local
$/; <MAKEFILE> };
close
MAKEFILE or
die
$!;
$makefile
=~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1
'inc'
, /;
$makefile
=~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
$makefile
=~ s/(
"-I\$\(INST_LIB\)"
)/
"-Iinc"
$1/g;
$makefile
=~ s/^(FULLPERL = .*)/$1
"-Iinc"
/m;
$makefile
=~ s/^(PERL = .*)/$1
"-Iinc"
/m;
# Module::Install will never be used to build the Core Perl
# Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
# PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
$makefile
=~ s/^PERL_LIB = .+/PERL_LIB =/m;
#$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
inc/Module/Install/Metadata.pm view on Meta::CPAN
111213141516171819202122232425262728293031
@ISA
=
qw{Module::Install::Base}
;
}
my
@scalar_keys
=
qw{
name
module_name
abstract
author
version
distribution_type
tests
installdirs
}
;
my
@tuple_keys
= qw{
configure_requires
build_requires
requires
recommends
bundles
resources
inc/Module/Install/Metadata.pm view on Meta::CPAN
136137138139140141142143144145146147148149150151152153154155156
die
(
"Unsupported reserved lowercase resource '$name'"
);
}
$self
->{
values
}{resources} ||= [];
push
@{
$self
->{
values
}{resources} }, [
$name
,
$value
];
}
$self
->{
values
}{resources};
}
# Aliases for build_requires that will have alternative
# meanings in some future version of META.yml.
sub
test_requires {
shift
->build_requires(
@_
) }
sub
install_requires {
shift
->build_requires(
@_
) }
# Aliases for installdirs options
sub
install_as_core {
$_
[0]->installdirs(
'perl'
) }
sub
install_as_cpan {
$_
[0]->installdirs(
'site'
) }
sub
install_as_site {
$_
[0]->installdirs(
'site'
) }
sub
install_as_vendor {
$_
[0]->installdirs(
'vendor'
) }
sub
sign {
my
$self
=
shift
;
t/010-basic/010-basic.t view on Meta::CPAN
1234567891011121314151617181920#!/usr/bin/perl -w
use
strict;
use_ok(
'AWS::CloudFront'
);
unless
(
$ENV
{AWS_ACCESS_KEY_ID} &&
$ENV
{AWS_SECRET_ACCESS_KEY} )
{
warn
'$ENV{AWS_ACCESS_KEY_ID} && $ENV{AWS_SECRET_ACCESS_KEY} must both be defined to run these tests.'
,
"\n"
;
exit
(0);
}
# end unless()
my
$cf
= AWS::CloudFront->new(
access_key_id
=>
$ENV
{AWS_ACCESS_KEY_ID},
secret_access_key
=>
$ENV
{AWS_SECRET_ACCESS_KEY},
);
ok(
$cf
,
'got a new cloudfront object'
);
t/010-basic/010-basic.t view on Meta::CPAN
3132333435363738394041424344454647484950515253545556my
@dists
=
$cf
->distributions();
foreach
my
$dist
(
@dists
)
{
is
$dist
->Id,
$cf
->distribution(
Id
=>
$dist
->Id)->Id,
'Ids match up'
;
}
# end foreach()
my
$dist
=
$cf
->add_distribution(
Origin
=> AWS::CloudFront::S3Origin->new(
DNSName
=>
'aws-s3-test-12344.s3.amazonaws.com'
,
),
);
warn
"New Dist ID: "
.
$dist
->Id;
my
$ident
=
$dist
->create_origin_access_identity(
Comment
=>
'testing only'
);
use
Data::Dumper;
warn
Dumper(
$ident
);
while
( 1 )
{
warn
"Checking status of "
,
$dist
->Id,
"\n"
;
last
if
$cf
->distribution(
Id
=>
$dist
->Id)->Status eq
'Deployed'
;
sleep
(2);
}
# end while()
( run in 0.284 second using v1.01-cache-2.11-cpan-eab888a1d7d )