From 984bf944d638974646bdf69131e6406f749956ae Mon Sep 17 00:00:00 2001 From: Seth Holloway Date: Tue, 27 May 2014 12:10:59 -0500 Subject: [PATCH 1/6] Enable coveralls support, maybe --- .travis.yml | 7 +++++++ Build.PL | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .travis.yml create mode 100644 Build.PL diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c9b60e1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: perl + perl: + - 5.16.3 + before_install: + cpanm -n Devel::Cover::Report::Coveralls + script: + perl Build.PL && ./Build build && cover -test -report coveralls diff --git a/Build.PL b/Build.PL new file mode 100644 index 0000000..4110f83 --- /dev/null +++ b/Build.PL @@ -0,0 +1,12 @@ +use strict; +use warnings; +use Module::Build; + +my $builder = Module::Build->new( + module_name => 'ToopherAPI', + license => 'perl', + dist_abstract => 'ToopherAPI - Toopher API wrapper in Perl', + dist_author => 'Toopher ', +); + +$builder->create_build_script(); From d0b53044acfe6c98eeac8d0777e0c62e9bcb88c0 Mon Sep 17 00:00:00 2001 From: Seth Holloway Date: Tue, 27 May 2014 13:03:19 -0500 Subject: [PATCH 2/6] Cleanup a bit --- t/01sanity.t | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/t/01sanity.t b/t/01sanity.t index 8647fdd..222a078 100644 --- a/t/01sanity.t +++ b/t/01sanity.t @@ -13,7 +13,8 @@ my $ua = eval { use HTTP::Response; use URI; use URL::Encode qw ( url_params_mixed ); - sub new { + sub new + { my ($class) = @_; my $self = { '_response' => new HTTP::Response(200), @@ -44,8 +45,6 @@ my $ua = eval { }->new($code, $message); - - my $api = new ToopherAPI(key => 'foo', secret => 'bar', ua => $ua); subtest 'test version UA string' => sub { @@ -99,7 +98,6 @@ subtest 'authenticate with otp' => sub { is($ua->request->{'post_data'}->{'otp'}, '123456'); }; - subtest 'authentication status' => sub { $ua->response->content('{"id":"1", "pending":false, "granted":true, "automated":false, "reason":"its a test", "terminal":{"id":"1", "name":"test terminal"}}'); my $auth_request = $api->get_authentication_status('1'); @@ -210,5 +208,3 @@ subtest 'unauthorized pairing raises correct error' => sub { }; done_testing(); - -# vim: ts=2:sw=2:expandtab:autoindent From f52bf459566ef229822748068ab63aeabbc98519 Mon Sep 17 00:00:00 2001 From: Seth Holloway Date: Tue, 27 May 2014 13:12:05 -0500 Subject: [PATCH 3/6] Fix indentation in Travis config --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c9b60e1..22f64b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: perl - perl: - - 5.16.3 - before_install: - cpanm -n Devel::Cover::Report::Coveralls - script: - perl Build.PL && ./Build build && cover -test -report coveralls +perl: + - 5.16.3 +before_install: + cpanm -n Devel::Cover::Report::Coveralls +script: + perl Build.PL && ./Build build && cover -test -report coveralls From 30df9950cfb54b72b82cc01b77dd7452bd711459 Mon Sep 17 00:00:00 2001 From: Seth Holloway Date: Tue, 27 May 2014 13:19:18 -0500 Subject: [PATCH 4/6] Use a Perl that might actually exist --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 22f64b3..78a661c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: perl perl: - - 5.16.3 + - "5.16" before_install: cpanm -n Devel::Cover::Report::Coveralls script: From cd15e6d284d86ebc8f3541b47f0d598963a2dcf2 Mon Sep 17 00:00:00 2001 From: Seth Holloway Date: Tue, 27 May 2014 14:02:09 -0500 Subject: [PATCH 5/6] Add dependencies to build --- Build.PL | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Build.PL b/Build.PL index 4110f83..473624e 100644 --- a/Build.PL +++ b/Build.PL @@ -7,6 +7,22 @@ my $builder = Module::Build->new( license => 'perl', dist_abstract => 'ToopherAPI - Toopher API wrapper in Perl', dist_author => 'Toopher ', + dist_version => '1.0.0', + build_requires => { + 'Test::More' => 0, + 'Test::Exception' => 0, + 'HTTP::Request::Common' => 0, + 'JSON' => 0, + 'LWP::UserAgent' => 0, + 'LWP::Protocol::https' => 0, + 'Net::OAuth::ConsumerRequest' => 0, + 'Class::Struct' => 0, + 'URI::Escape' => 0, + 'Try::Tiny' => 0, + 'HTTP::Response' => 0, + 'URI' => 0, + 'URL::Encode' => 0 + }, ); $builder->create_build_script(); From a8c5325056ee8bd2196c3cd63a98f540b47b5bf0 Mon Sep 17 00:00:00 2001 From: Seth Holloway Date: Tue, 27 May 2014 15:08:08 -0500 Subject: [PATCH 6/6] Move dependency out of Travis into Build --- .travis.yml | 2 -- Build.PL | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78a661c..7224150 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: perl perl: - "5.16" -before_install: - cpanm -n Devel::Cover::Report::Coveralls script: perl Build.PL && ./Build build && cover -test -report coveralls diff --git a/Build.PL b/Build.PL index 473624e..14cc487 100644 --- a/Build.PL +++ b/Build.PL @@ -11,6 +11,7 @@ my $builder = Module::Build->new( build_requires => { 'Test::More' => 0, 'Test::Exception' => 0, + 'Devel::Cover::Report::Coveralls' => 0, 'HTTP::Request::Common' => 0, 'JSON' => 0, 'LWP::UserAgent' => 0,