SMS-Send-NANP-Twilio

 view release on metacpan or  search on metacpan

Changes

Revision history for Perl extension SMS::Send::NANP::Twilio

0.04 2018-03-02
  - Added DateTime as build time requirement - RT 124633 (ANDK@cpan.org)
    - Updated Makefile.PL
    - Updated perl-SMS-Send-NANP-Twilio.spec

0.03 2018-02-03
  - API BREAK
    - Changed sid property to API documented name MessagingServiceSid
    - Changed from property to API documented case From
  - Updated sms_send method
    - Added support for MediaUrl property
  - Added support for all optional properties in API documentation

META.yml

abstract:           SMS::Send driver for Twilio
author:
    - Michael Davis <mdavis@localdomain>
license:            unknown
distribution_type:  module
configure_requires:
    ExtUtils::MakeMaker:  0
build_requires:
    ExtUtils::MakeMaker:  0
requires:
    DateTime:             0
    JSON::XS:             0
    SMS::Send::Driver::WebService:  0.06
    URI:                  0
no_index:
    directory:
        - t
        - inc
generated_by:       ExtUtils::MakeMaker version 6.55_02
meta-spec:
    url:      http://module-build.sourceforge.net/META-spec-v1.4.html

Makefile.PL

use ExtUtils::MakeMaker;
WriteMakefile(
    NAME           => 'SMS::Send::NANP::Twilio',
    VERSION_FROM   => 'lib/SMS/Send/NANP/Twilio.pm',
    PREREQ_PM      => {
                        'URI'                           => 0,
                        'JSON::XS'                      => 0,
                        'DateTime'                      => 0, #tests
                        'SMS::Send::Driver::WebService' => 0.06,
                      },
    ABSTRACT_FROM  => 'lib/SMS/Send/NANP/Twilio.pm',
    AUTHOR         => 'Michael Davis <mdavis@localdomain>',
);

perl-SMS-Send-NANP-Twilio.spec

Version:        0.04
Release:        1%{?dist}
Summary:        SMS::Send driver for Twilio
License:        perl
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/SMS-Send-NANP-Twilio/
Source0:        http://www.cpan.org/modules/by-module/SMS/SMS-Send-NANP-Twilio-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(DateTime)
BuildRequires:  perl(JSON::XS)
BuildRequires:  perl(SMS::Send)
BuildRequires:  perl(SMS::Send::Driver::WebService) >= 0.06
BuildRequires:  perl(URI)
Requires:       perl(JSON::XS)
Requires:       perl(SMS::Send::Driver::WebService) >= 0.06
Requires:       perl(URI)
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description

t/002_send.t

# -*- perl -*-
use strict;
use warnings;
use DateTime;
use Data::Dumper qw{Dumper};
use Test::More tests => 4;

BEGIN { use_ok( 'SMS::Send::NANP::Twilio' ); }

my $to   = $ENV{'SMS_TEST_PHONE_NUMBER'};

SKIP: {
  skip 'ENV{SMS_TEST_PHONE_NUMBER} not configured', 3 unless $to;

  my $service = SMS::Send::NANP::Twilio->new;

  isa_ok ($service, 'SMS::Send::NANP::Twilio');
  isa_ok ($service, 'SMS::Send::Driver');

  my $text = sprintf("Message: Test 1, Time: %s", DateTime->now);
  my $status=$service->send_sms(to => $to, text => $text);
  diag(Dumper($service->{"__data"}));
  ok($status, 'status');
}

t/003_send_MediaUrl.t

# -*- perl -*-
use strict;
use warnings;
use DateTime;
use Data::Dumper qw{Dumper};
use Test::More tests => 4;

BEGIN { use_ok( 'SMS::Send::NANP::Twilio' ); }

my $to   = $ENV{'MMS_TEST_PHONE_NUMBER'};

SKIP: {
  skip 'ENV{MMS_TEST_PHONE_NUMBER} not configured', 3 unless $to;

  my $service = SMS::Send::NANP::Twilio->new;

  isa_ok ($service, 'SMS::Send::NANP::Twilio');
  isa_ok ($service, 'SMS::Send::Driver');

  my $text    = sprintf("Title: Map of Clifton, VA, Date: %s", DateTime->now);
  my $url     = 'https://maps.googleapis.com/maps/api/staticmap?size=1024x400&sensor=false&markers=Clifton,VA';
  my $status  = $service->send_sms(to => $to, text => $text, MediaUrl => $url);
  diag(Dumper($service->{"__data"}));
  ok($status, 'status');
}

t/004_send_api.t

# -*- perl -*-
use strict;
use warnings;
use DateTime;
use Data::Dumper qw{Dumper};
use Test::More tests => 4;

BEGIN { use_ok( 'SMS::Send' ); }
BEGIN { use_ok( 'SMS::Send::NANP::Twilio' ); }

my $to   = $ENV{'SMS_TEST_PHONE_NUMBER_API'};

SKIP: {
  skip 'ENV{SMS_TEST_PHONE_NUMBER_API} not configured', 2 unless $to;

  my $service = SMS::Send->new('NANP::Twilio');

  isa_ok ($service, 'SMS::Send');

  my $text = sprintf("Message: Test 2, Time: %s", DateTime->now);
  my $status=$service->send_sms(to => $to, text => $text);
  diag(Dumper($service->{"__data"})); #this is not set
  ok($status, 'status');
}

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.989 second using v1.00-cache-1.14-grep-ac7eaf9-cpan-6d591e31851 )