Dist-Zilla-Plugin-Twitter-0.026/0000775000175000017500000000000012413425715015033 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/lib/0000775000175000017500000000000012413425715015601 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/lib/Dist/0000775000175000017500000000000012413425715016504 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/lib/Dist/Zilla/0000775000175000017500000000000012413425715017557 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/lib/Dist/Zilla/Plugin/0000775000175000017500000000000012413425715021015 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/lib/Dist/Zilla/Plugin/Twitter.pm0000644000175000017500000002443112413425715023017 0ustar mikemikepackage Dist::Zilla::Plugin::Twitter; use 5.008; use strict; use warnings; use utf8; # ABSTRACT: Twitter when you release with Dist::Zilla our $VERSION = '0.026'; # VERSION use Dist::Zilla 4 (); use Moose 0.99; use Net::Twitter 4.00001 (); # API v1.1 support use WWW::Shorten::Simple (); # A useful interface to WWW::Shorten use WWW::Shorten 3.02 (); # For latest updates to dead services use WWW::Shorten::TinyURL (); # Our fallback use namespace::autoclean 0.09; use Try::Tiny; # extends, roles, attributes, etc. with 'Dist::Zilla::Role::AfterRelease'; with 'Dist::Zilla::Role::TextTemplate'; has 'tweet' => ( is => 'ro', isa => 'Str', default => 'Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} {{$URL}} !META{resources}{repository}{web}' ); has 'tweet_url' => ( is => 'ro', isa => 'Str', default => 'https://metacpan.org/release/{{$AUTHOR_UC}}/{{$DIST}}-{{$VERSION}}/', ); has 'url_shortener' => ( is => 'ro', isa => 'Str', default => 'TinyURL', ); has 'hash_tags' => ( is => 'ro', isa => 'Str', ); has 'config_file' => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { my $self = shift; require File::Spec; require Dist::Zilla::Util; return File::Spec->catfile( $self->config_dir, 'twitter.ini' ); } ); has 'config_dir' => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { require Dist::Zilla::Util; my $dir = Dist::Zilla::Util->_global_config_root(); return $dir->stringify; }, ); has 'consumer_tokens' => ( is => 'ro', isa => 'HashRef', lazy => 1, default => sub { return { grep tr/a-zA-Z/n-za-mN-ZA-M/, map $_, # rot13 pbafhzre_xrl => 'fdAdffgTXj6OiyoH0anN', pbafhzre_frperg => '3J25ATbGmgVf1vO0miwz3o7VjRoXC7Y9y5EfLGaUfTL', }; }, ); has 'twitter' => ( is => 'ro', isa => 'Net::Twitter', lazy => 1, default => sub { my $self = shift; my $nt = Net::Twitter->new( useragent_class => $ENV{DZ_TWITTER_USERAGENT} || 'LWP::UserAgent', traits => [qw/ API::RESTv1_1 OAuth /], ssl => 1, %{ $self->consumer_tokens }, ); try { require Config::INI::Reader; my $access = Config::INI::Reader->read_file( $self->config_file ); $nt->access_token( $access->{'api.twitter.com'}->{access_token} ); $nt->access_token_secret( $access->{'api.twitter.com'}->{access_secret} ); } catch { $self->log("Error: $_"); my $auth_url = $nt->get_authorization_url; $self->log(__PACKAGE__ . " isn't authorized to tweet on your behalf yet"); $self->log("Go to $auth_url to authorize this application"); my $pin = $self->zilla->chrome->prompt_str('Enter the PIN: '); chomp $pin; # Fetches tokens and sets them in the Net::Twitter object my @access_tokens = $nt->request_access_token(verifier => $pin); unless ( -d $self->config_dir ) { require File::Path; File::Path::make_path( $self->config_dir ); } require Config::INI::Writer; Config::INI::Writer->write_file( { 'api.twitter.com' => { access_token => $access_tokens[0], access_secret => $access_tokens[1], } }, $self->config_file ); try { chmod 0600, $self-> config_file; } catch { print "Couldn't make @{[ $self->config_file ]} private: $_"; }; }; return $nt; }, ); # methods sub after_release { my $self = shift; my $tgz = shift || 'unknowntarball'; my $zilla = $self->zilla; my $cpan_id = ''; for my $plugin ( @{ $zilla->plugins_with( -Releaser ) } ) { if ( my $user = eval { $plugin->user } || eval { $plugin->username } ) { $cpan_id = uc $user; last; } } confess "Can't determine your CPAN user id from a release plugin" unless length $cpan_id; my $path = substr($cpan_id,0,1)."/".substr($cpan_id,0,2)."/$cpan_id"; my $stash = { DIST => $zilla->name, ABSTRACT => $zilla->abstract, VERSION => $zilla->version, TRIAL => ( $zilla->is_trial ? '-TRIAL' : '' ), TARBALL => "$tgz", AUTHOR_UC => $cpan_id, AUTHOR_LC => lc $cpan_id, AUTHOR_PATH => $path, }; my $module = $zilla->name; $module =~ s/-/::/g; $stash->{MODULE} = $module; my $longurl = $self->fill_in_string($self->tweet_url, $stash); $stash->{URL} = $self->_shorten( $longurl ); my $msg = $self->fill_in_string( $self->tweet, $stash); $DB::single = 1; { no warnings qw/ uninitialized /; $msg =~ s/ (?[!@]?) META (? (?: \{ [^}]+ \} | \[ [0-9]+ \] ) +) / ( $+{modifier} eq '!' ? '$self->_shorten(' : '' ) . ( $+{modifier} eq '@' ? 'join($", @{' : '' ) . '$self->zilla->distmeta->' . $+{access} . ( $+{modifier} eq '@' ? '})' : '' ) . ( $+{modifier} eq '!' ? ')' : '' ) /xeeg; warn $@ if $@; } if (defined $self->hash_tags) { $msg .= " " . $self->hash_tags; } $msg =~ tr/ //s; # squeeze multiple consecutive spaces into just one try { $self->twitter->update($msg); $self->log($msg); } catch { $self->log("Couldn't tweet: $_"); $self->log("Tweet would have been: $msg"); }; return 1; } sub _shorten { my( $self, $url ) = @_; unless ( $self->url_shortener and $self->url_shortener !~ m/^(?:none|twitter|t\.co)$/ ) { $self->log('dist.ini specifies to not use a URL shortener; using full URL'); return $url; } foreach my $service (($self->url_shortener, 'TinyURL')) { # Fallback to TinyURL on errors my $shortener = WWW::Shorten::Simple->new($service); $self->log("Trying $service"); if ( my $short = eval { $shortener->shorten($url) } ) { return $short; } } return $url; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::Twitter - Twitter when you release with Dist::Zilla =head1 VERSION version 0.026 =head1 SYNOPSIS In your F: [Twitter] hash_tags = #foo url_shortener = TinyURL =head1 DESCRIPTION This plugin will use L to send a release notice to Twitter. By default, it will include a link to release on L. The default configuration is as follows: [Twitter] tweet_url = https://metacpan.org/release/{{$AUTHOR_UC}}/{{$DIST}}-{{$VERSION}}/ tweet = Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} {{$URL}} !META{resources}{repository}{web} url_shortener = TinyURL The C is shortened with L or whichever other service you choose (use 'none' to use the full URL, in which case Twitter will shorten it for you) and appended to the C message. =head2 VARIABLE INTERPOLATION The following variables are available for substitution in the URL and message templates: DIST # Foo-Bar MODULE # Foo::Bar ABSTRACT # Foo-Bar is a module that FooBars VERSION # 1.23 TRIAL # -TRIAL if is_trial, empty string otherwise. TARBALL # Foo-Bar-1.23.tar.gz AUTHOR_UC # JOHNDOE AUTHOR_LC # johndoe AUTHOR_PATH # J/JO/JOHNDOE URL # http://tinyurl.com/... =head3 DISTMETA INTERPOLATION Resources information available in the META.* files of the distribution can be accessed via C<>. You may mix-and-match C<{...}> to access hashref elements and C<[\d]> to access arrayref elements. You're responsible for making sure you are accessing the right part of the META data structure, and treating it as the right type of data. See L and the "$TYPE DATA" sections of L in particular. The C<< META{...} >> replacement may also have one of two modifiers, which are prefixed directly before C: =over 4 =item C - URL shortening Providing an exclamation point (C<< !META{...} >>) will URL-shorten the value you extract from the distmeta data structure. This will have no effect unless the value is a URL to begin with. =item C<@> - Arrayref stringification Providing an at-symbol (C<< @META{...} >>) will include all the elements of the arrayref you specify by joining them with C<$">. So, this is just like doing C<< "@{ $your_array_ref }" >>. =back So, for example, to use the GitHub home of the project instead of its metacpan page, one can do: [Twitter] tweet = Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} !META{resource}{repository}{web} url_shortener = TinyURL Or, to include the authors in your tweet: [Twitter] tweet = @META{author} released {{$MODULE}} {{$VERSION}}: {{$URL}} =head2 PAUSEID You must be using the C or C plugin for this plugin to determine your PAUSEID. =head2 HASHTAGS You can use the C option to append hash tags (or anything, really) to the end of the message generated from C. [Twitter] hash_tags = #perl #cpan #foo =for test_synopsis 1; __END__ =for Pod::Coverage after_release =head1 AVAILABILITY The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit L to find a CPAN site near you, or see L. =head1 SOURCE The development version is on github at L and may be cloned from L =head1 BUGS AND LIMITATIONS You can make new bug reports, and view existing ones, through the web interface at L. =head1 AUTHORS =over 4 =item * David Golden =item * Mike Doherty =back =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2014 by David Golden. This is free software, licensed under: The Apache License, Version 2.0, January 2004 =cut Dist-Zilla-Plugin-Twitter-0.026/corpus/0000775000175000017500000000000012413425715016346 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/fake-HOME/0000775000175000017500000000000012413425715020002 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/fake-HOME/dzil/0000775000175000017500000000000012413425715020744 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/fake-HOME/dzil/twitter.ini0000644000175000017500000000007612413425715023150 0ustar mikemike[api.twitter.com] access_token = token access_secret = secret Dist-Zilla-Plugin-Twitter-0.026/corpus/DZ-Test/0000775000175000017500000000000012413425715017600 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/DZ-Test/lib/0000775000175000017500000000000012413425715020346 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/DZ-Test/lib/DZ/0000775000175000017500000000000012413425715020663 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/DZ-Test/lib/DZ/Test.pm0000644000175000017500000000026012413425715022134 0ustar mikemikeuse strict; use warnings; package DZ::Test; # ABSTRACT: this is a sample package for testing Dist::Zilla; =head1 NAME Test - a test thing =cut sub main { return 1; } 1; Dist-Zilla-Plugin-Twitter-0.026/corpus/DZ-Test/dist.ini0000644000175000017500000000067112413425715021246 0ustar mikemikename = DZ-Test version = v1.2.2 author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample [MetaResources] homepage = http://example.com/~dude/project.asp repository.web = http://github.com/dude/project [@Filter] bundle = @FakeClassic remove = ConfirmRelease remove = FakeRelease [FakeUploader] [Twitter] hash_tags = #bar url_shortener = none tweet_url = http://p3rl.org/{{$MODULE}} Dist-Zilla-Plugin-Twitter-0.026/corpus/DZ-meta/0000775000175000017500000000000012413425715017607 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/DZ-meta/lib/0000775000175000017500000000000012413425715020355 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/DZ-meta/lib/DZ1.pm0000644000175000017500000000025212413425715021306 0ustar mikemikeuse strict; use warnings; package DZ1; # ABSTRACT: this is a sample package for testing Dist::Zilla; =head1 NAME DZ1 - a test thing =cut sub main { return 1; } 1; Dist-Zilla-Plugin-Twitter-0.026/corpus/DZ-meta/dist.ini0000644000175000017500000000063212413425715021252 0ustar mikemikename = DZ1 version = 0.001 author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample [Prereqs] My::Stuff = 1.00 [@Filter] bundle = @FakeClassic remove = ConfirmRelease remove = FakeRelease [FakeUploader] [Twitter] tweet = @META{author} released {{$MODULE}} {{$VERSION}}: {{$URL}} (META{license}[0]) META{prereqs}{runtime}{requires}{'My::Stuff'} hash_tags = #foo Dist-Zilla-Plugin-Twitter-0.026/corpus/DZ2/0000775000175000017500000000000012413425715016745 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/DZ2/lib/0000775000175000017500000000000012413425715017513 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/DZ2/lib/DZ2.pm0000644000175000017500000000025212413425715020445 0ustar mikemikeuse strict; use warnings; package DZ2; # ABSTRACT: this is a sample package for testing Dist::Zilla; =head1 NAME DZ2 - a test thing =cut sub main { return 1; } 1; Dist-Zilla-Plugin-Twitter-0.026/corpus/DZ2/dist.ini0000644000175000017500000000042212413425715020405 0ustar mikemikename = DZ2 version = 0.001 author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample [@Filter] bundle = @FakeClassic remove = ConfirmRelease remove = FakeRelease [FakeUploader] [Twitter] hash_tags = #foo url_shortener = TinyURL Dist-Zilla-Plugin-Twitter-0.026/corpus/DZ1/0000775000175000017500000000000012413425715016744 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/DZ1/lib/0000775000175000017500000000000012413425715017512 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/corpus/DZ1/lib/DZ1.pm0000644000175000017500000000025212413425715020443 0ustar mikemikeuse strict; use warnings; package DZ1; # ABSTRACT: this is a sample package for testing Dist::Zilla; =head1 NAME DZ1 - a test thing =cut sub main { return 1; } 1; Dist-Zilla-Plugin-Twitter-0.026/corpus/DZ1/dist.ini0000644000175000017500000000037212413425715020410 0ustar mikemikename = DZ1 version = 0.001 author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample [@Filter] bundle = @FakeClassic remove = ConfirmRelease remove = FakeRelease [FakeUploader] [Twitter] hash_tags = #foo Dist-Zilla-Plugin-Twitter-0.026/xt/0000775000175000017500000000000012413425715015466 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/xt/release/0000775000175000017500000000000012413425715017106 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/xt/release/minimum-version.t0000644000175000017500000000026712413425715022434 0ustar mikemike#!perl use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.10.1} ); Dist-Zilla-Plugin-Twitter-0.026/xt/release/pod-linkcheck.t0000644000175000017500000000053712413425715022011 0ustar mikemike#!perl use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_LINKCHECK ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::LinkCheck"; if ( $@ ) { plan skip_all => 'Test::Pod::LinkCheck required for testing POD'; } else { Test::Pod::LinkCheck->new->all_pod_ok; } Dist-Zilla-Plugin-Twitter-0.026/xt/release/dist-manifest.t0000644000175000017500000000023012413425715022033 0ustar mikemike#!perl use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing the manifest" if $@; manifest_ok(); Dist-Zilla-Plugin-Twitter-0.026/xt/release/pod-coverage.t0000644000175000017500000000033412413425715021644 0ustar mikemike#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Dist-Zilla-Plugin-Twitter-0.026/xt/release/cpan-changes.t0000644000175000017500000000026312413425715021621 0ustar mikemike#!perl use strict; use warnings; use Test::More 0.96 tests => 2; use_ok('Test::CPAN::Changes'); subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; done_testing(); Dist-Zilla-Plugin-Twitter-0.026/xt/release/test-version.t0000644000175000017500000000064312413425715021736 0ustar mikemikeuse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 0.002004 BEGIN { eval "use Test::Version; 1;" or die $@; } my @imports = ( 'version_all_ok' ); my $params = { is_strict => 0, has_version => 1, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; Dist-Zilla-Plugin-Twitter-0.026/xt/release/unused-vars.t0000644000175000017500000000036212413425715021546 0ustar mikemike#!perl use Test::More 0.96 tests => 1; eval { require Test::Vars }; SKIP: { skip 1 => 'Test::Vars required for testing for unused vars' if $@; Test::Vars->import; subtest 'unused vars' => sub { all_vars_ok(); }; }; Dist-Zilla-Plugin-Twitter-0.026/xt/release/portability.t0000644000175000017500000000027612413425715021640 0ustar mikemike#!perl use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); Dist-Zilla-Plugin-Twitter-0.026/xt/release/pod-syntax.t0000644000175000017500000000022012413425715021371 0ustar mikemike#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Dist-Zilla-Plugin-Twitter-0.026/xt/release/meta-json.t0000644000175000017500000000023312413425715021164 0ustar mikemike#!perl use Test::More; eval 'use Test::CPAN::Meta::JSON'; plan skip_all => 'Test::CPAN::Meta::JSON required for testing META.json' if $@; meta_json_ok(); Dist-Zilla-Plugin-Twitter-0.026/xt/release/kwalitee.t0000644000175000017500000000027512413425715021102 0ustar mikemike# this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.11 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; Dist-Zilla-Plugin-Twitter-0.026/xt/release/distmeta.t0000644000175000017500000000017212413425715021103 0ustar mikemike#!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); Dist-Zilla-Plugin-Twitter-0.026/xt/release/mojibake.t0000644000175000017500000000040612413425715021052 0ustar mikemike#!perl use strict; use warnings qw(all); use Test::More; ## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval) eval q(use Test::Mojibake); plan skip_all => q(Test::Mojibake required for source encoding testing) if $@; all_files_encoding_ok(); Dist-Zilla-Plugin-Twitter-0.026/xt/release/synopsis.t0000644000175000017500000000006012413425715021154 0ustar mikemike#!perl use Test::Synopsis; all_synopsis_ok(); Dist-Zilla-Plugin-Twitter-0.026/xt/author/0000775000175000017500000000000012413425715016770 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/xt/author/test-eol.t0000644000175000017500000000023712413425715020711 0ustar mikemikeuse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::EOL 0.12 use Test::EOL; all_perl_files_ok({ trailing_whitespace => 1 }); Dist-Zilla-Plugin-Twitter-0.026/xt/author/no-tabs.t0000644000175000017500000000077012413425715020522 0ustar mikemikeuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.09 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/Dist/Zilla/Plugin/Twitter.pm', 't/00-compile.t', 't/choose_shortener.t', 't/lib/Dist/Zilla/Plugin/FakeUploader.pm', 't/lib/LWP/TestUA.pm', 't/lib/Net/Netrc.pm', 't/lib/Test/DZil.pm', 't/lib/WWW/Shorten/TinyURL.pm', 't/meta.t', 't/module.t', 't/twitter.t' ); notabs_ok($_) foreach @files; done_testing; Dist-Zilla-Plugin-Twitter-0.026/xt/author/critic.t0000644000175000017500000000043512413425715020432 0ustar mikemike#!perl use strict; use warnings; use Test::More; use English qw(-no_match_vars); eval "use Test::Perl::Critic"; plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; all_critic_ok(); Dist-Zilla-Plugin-Twitter-0.026/README.PATCHING0000644000175000017500000000325712413425715017114 0ustar mikemikeREADME.PATCHING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. The distribution is managed with Dist::Zilla. This means than many of the usual files you might expect are not in the repository, but are generated at release time (e.g. Makefile.PL). However, you can run tests directly using the 'prove' tool: $ prove -l $ prove -lv t/some_test_file.t For most distributions, 'prove' is entirely sufficent for you to test any patches you have. You may need to satisfy some dependencies. See the included META.json file for a list. If you install App::mymeta_requires from CPAN, it's easy to satisfy any that you are missing by piping the output to your favorite CPAN client: $ mymeta-requires | cpanm $ cpan `mymeta-requires` Likewise, much of the documentation Pod is generated at release time. Depending on the distribution, some documentation may be written in a Pod dialect called WikiDoc. (See Pod::WikiDoc on CPAN.) If you would like to submit a documentation edit, please limit yourself to the documentation you see. If you see typos or documentation issues in the generated docs, please email or open a bug ticket instead of patching. Dist::Zilla is a very powerful authoring tool, but requires a number of author-specific plugins. If you would like to use it for contributing, install it from CPAN, then run one of the following commands, depending on your CPAN client: $ cpan `dzil authordeps` $ dzil authordeps | cpanm Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil xtest You can learn more about Dist::Zilla at http://dzil.org/ Dist-Zilla-Plugin-Twitter-0.026/MANIFEST.SKIP0000644000175000017500000000210112413425715016721 0ustar mikemike #!start included /home/mike/perl5/perlbrew/perls/perl-5.18.0/lib/5.18.0/ExtUtils/MANIFEST.SKIP # Avoid version control files. \bRCS\b \bCVS\b \bSCCS\b ,v$ \B\.svn\b \B\.git\b \B\.gitignore\b \b_darcs\b \B\.cvsignore$ # Avoid VMS specific MakeMaker generated files \bDescrip.MMS$ \bDESCRIP.MMS$ \bdescrip.mms$ # Avoid Makemaker generated and utility files. \bMANIFEST\.bak \bMakefile$ \bblib/ \bMakeMaker-\d \bpm_to_blib\.ts$ \bpm_to_blib$ \bblibdirs\.ts$ # 6.18 through 6.25 generated this # Avoid Module::Build generated and utility files. \bBuild$ \b_build/ \bBuild.bat$ \bBuild.COM$ \bBUILD.COM$ \bbuild.com$ # Avoid temp and backup files. ~$ \.old$ \#$ \b\.# \.bak$ \.tmp$ \.# \.rej$ # Avoid OS-specific files/dirs # Mac OSX metadata \B\.DS_Store # Mac OSX SMB mount metadata files \B\._ # Avoid Devel::Cover and Devel::CoverX::Covered files. \bcover_db\b \bcovered\b # Avoid MYMETA files ^MYMETA\. #!end included /home/mike/perl5/perlbrew/perls/perl-5.18.0/lib/5.18.0/ExtUtils/MANIFEST.SKIP # Avoid archives of this distribution \bDist-Zilla-Plugin-Twitter-[\d\.\_]+ Dist-Zilla-Plugin-Twitter-0.026/Makefile.PL0000644000175000017500000000530112413425715017002 0ustar mikemike # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.020. use strict; use warnings; use 5.009005; use ExtUtils::MakeMaker ; my %WriteMakefileArgs = ( "ABSTRACT" => "Twitter when you release with Dist::Zilla", "AUTHOR" => "David Golden , Mike Doherty ", "BUILD_REQUIRES" => { "Module::Build" => "0.28" }, "CONFIGURE_REQUIRES" => { "Module::Build" => "0.28" }, "DISTNAME" => "Dist-Zilla-Plugin-Twitter", "EXE_FILES" => [], "LICENSE" => "apache", "NAME" => "Dist::Zilla::Plugin::Twitter", "PREREQ_PM" => { "Config::INI::Reader" => 0, "Config::INI::Writer" => 0, "Dist::Zilla" => 4, "Dist::Zilla::Role::AfterRelease" => 0, "Dist::Zilla::Role::TextTemplate" => 0, "Dist::Zilla::Util" => 0, "File::Path" => 0, "File::Spec" => 0, "Moose" => "0.99", "Net::Twitter" => "4.00001", "Try::Tiny" => 0, "WWW::Shorten" => "3.02", "WWW::Shorten::Simple" => 0, "WWW::Shorten::TinyURL" => 0, "namespace::autoclean" => "0.09", "strict" => 0, "utf8" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Dist::Zilla::App::Tester" => 0, "Dist::Zilla::Role::Releaser" => 0, "Dist::Zilla::Tester" => 0, "File::Spec" => 0, "HTTP::Response" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "LWP::UserAgent" => 0, "Params::Util" => 0, "Sub::Exporter" => 0, "Test::More" => "0.88", "base" => 0, "lib" => 0 }, "VERSION" => "0.026", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Config::INI::Reader" => 0, "Config::INI::Writer" => 0, "Dist::Zilla" => 4, "Dist::Zilla::App::Tester" => 0, "Dist::Zilla::Role::AfterRelease" => 0, "Dist::Zilla::Role::Releaser" => 0, "Dist::Zilla::Role::TextTemplate" => 0, "Dist::Zilla::Tester" => 0, "Dist::Zilla::Util" => 0, "File::Path" => 0, "File::Spec" => 0, "HTTP::Response" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "LWP::UserAgent" => 0, "Module::Build" => "0.28", "Moose" => "0.99", "Net::Twitter" => "4.00001", "Params::Util" => 0, "Sub::Exporter" => 0, "Test::More" => "0.88", "Try::Tiny" => 0, "WWW::Shorten" => "3.02", "WWW::Shorten::Simple" => 0, "WWW::Shorten::TinyURL" => 0, "base" => 0, "lib" => 0, "namespace::autoclean" => "0.09", "strict" => 0, "utf8" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Dist-Zilla-Plugin-Twitter-0.026/README.mkdn0000644000175000017500000001034312413425715016642 0ustar mikemike# NAME Dist::Zilla::Plugin::Twitter - Twitter when you release with Dist::Zilla # VERSION version 0.026 # SYNOPSIS In your `dist.ini`: [Twitter] hash_tags = #foo url_shortener = TinyURL # DESCRIPTION This plugin will use [Net::Twitter](https://metacpan.org/pod/Net::Twitter) to send a release notice to Twitter. By default, it will include a link to release on [http://metacpan.org](http://metacpan.org). The default configuration is as follows: [Twitter] tweet_url = https://metacpan.org/release/{{$AUTHOR_UC}}/{{$DIST}}-{{$VERSION}}/ tweet = Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} {{$URL}} !META{resources}{repository}{web} url_shortener = TinyURL The `tweet_url` is shortened with [WWW::Shorten::TinyURL](https://metacpan.org/pod/WWW::Shorten::TinyURL) or whichever other service you choose (use 'none' to use the full URL, in which case Twitter will shorten it for you) and appended to the `tweet` message. ## VARIABLE INTERPOLATION The following variables are available for substitution in the URL and message templates: DIST # Foo-Bar MODULE # Foo::Bar ABSTRACT # Foo-Bar is a module that FooBars VERSION # 1.23 TRIAL # -TRIAL if is_trial, empty string otherwise. TARBALL # Foo-Bar-1.23.tar.gz AUTHOR_UC # JOHNDOE AUTHOR_LC # johndoe AUTHOR_PATH # J/JO/JOHNDOE URL # http://tinyurl.com/... ### DISTMETA INTERPOLATION Resources information available in the META.\* files of the distribution can be accessed via `. You may mix-and-match `{...}` to access hashref elements and `[\d]` to access arrayref elements. You're responsible for making sure you are accessing the right part of the META data structure, and treating it as the right type of data. See [CPAN::Meta::Spec](https://metacpan.org/pod/CPAN::Meta::Spec) and the "$TYPE DATA" sections of [CPAN::Meta](https://metacpan.org/pod/CPAN::Meta) in particular. The `META{...}` replacement may also have one of two modifiers, which are prefixed directly before `META`: - `!` - URL shortening Providing an exclamation point (`!META{...}`) will URL-shorten the value you extract from the distmeta data structure. This will have no effect unless the value is a URL to begin with. - `@` - Arrayref stringification Providing an at-symbol (`@META{...}`) will include all the elements of the arrayref you specify by joining them with `$"`. So, this is just like doing `"@{ $your_array_ref }"`. So, for example, to use the GitHub home of the project instead of its metacpan page, one can do: [Twitter] tweet = Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} !META{resource}{repository}{web} url_shortener = TinyURL Or, to include the authors in your tweet: [Twitter] tweet = @META{author} released {{$MODULE}} {{$VERSION}}: {{$URL}} ## PAUSEID You must be using the `UploadToCPAN` or `FakeRelease` plugin for this plugin to determine your PAUSEID. ## HASHTAGS You can use the `hash_tags` option to append hash tags (or anything, really) to the end of the message generated from `tweet`. [Twitter] hash_tags = #perl #cpan #foo # AVAILABILITY The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit [http://www.perl.com/CPAN/](http://www.perl.com/CPAN/) to find a CPAN site near you, or see [https://metacpan.org/module/Dist::Zilla::Plugin::Twitter/](https://metacpan.org/module/Dist::Zilla::Plugin::Twitter/). # SOURCE The development version is on github at [http://github.com/dagolden/dist-zilla-plugin-twitter](http://github.com/dagolden/dist-zilla-plugin-twitter) and may be cloned from [git://github.com/dagolden/dist-zilla-plugin-twitter.git](git://github.com/dagolden/dist-zilla-plugin-twitter.git) # BUGS AND LIMITATIONS You can make new bug reports, and view existing ones, through the web interface at [https://github.com/dagolden/dist-zilla-plugin-twitter/issues](https://github.com/dagolden/dist-zilla-plugin-twitter/issues). # AUTHORS - David Golden - Mike Doherty # COPYRIGHT AND LICENSE This software is Copyright (c) 2014 by David Golden. This is free software, licensed under: The Apache License, Version 2.0, January 2004 Dist-Zilla-Plugin-Twitter-0.026/META.json0000644000175000017500000000553512413425715016462 0ustar mikemike{ "abstract" : "Twitter when you release with Dist::Zilla", "author" : [ "David Golden ", "Mike Doherty " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.142690", "license" : [ "apache_2_0" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Dist-Zilla-Plugin-Twitter", "no_index" : { "directory" : [ "corpus", "inc", "examples" ] }, "prereqs" : { "build" : { "requires" : { "Module::Build" : "0.28" } }, "configure" : { "requires" : { "Module::Build" : "0.28" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::Kwalitee" : "1.21", "Test::More" : "0", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Synopsis" : "0" } }, "runtime" : { "requires" : { "Config::INI::Reader" : "0", "Config::INI::Writer" : "0", "Dist::Zilla" : "4", "Dist::Zilla::Role::AfterRelease" : "0", "Dist::Zilla::Role::TextTemplate" : "0", "Dist::Zilla::Util" : "0", "File::Path" : "0", "File::Spec" : "0", "Moose" : "0.99", "Net::Twitter" : "4.00001", "Try::Tiny" : "0", "WWW::Shorten" : "3.02", "WWW::Shorten::Simple" : "0", "WWW::Shorten::TinyURL" : "0", "namespace::autoclean" : "0.09", "perl" : "5.009005", "strict" : "0", "utf8" : "0", "warnings" : "0" } }, "test" : { "requires" : { "Dist::Zilla::App::Tester" : "0", "Dist::Zilla::Role::Releaser" : "0", "Dist::Zilla::Tester" : "0", "File::Spec" : "0", "HTTP::Response" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "LWP::UserAgent" : "0", "Params::Util" : "0", "Sub::Exporter" : "0", "Test::More" : "0.88", "base" : "0", "lib" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/dagolden/dist-zilla-plugin-twitter/issues" }, "repository" : { "type" : "git", "url" : "git://github.com/dagolden/dist-zilla-plugin-twitter.git", "web" : "https://github.com/dagolden/dist-zilla-plugin-twitter" } }, "version" : "0.026" } Dist-Zilla-Plugin-Twitter-0.026/Build.PL0000644000175000017500000000432612413425715016332 0ustar mikemike # This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v5.020. use strict; use warnings; use Module::Build 0.28; my %module_build_args = ( "build_requires" => { "Module::Build" => "0.28" }, "configure_requires" => { "Module::Build" => "0.28" }, "dist_abstract" => "Twitter when you release with Dist::Zilla", "dist_author" => [ "David Golden ", "Mike Doherty " ], "dist_name" => "Dist-Zilla-Plugin-Twitter", "dist_version" => "0.026", "license" => "apache", "module_name" => "Dist::Zilla::Plugin::Twitter", "recommends" => {}, "recursive_test_files" => 1, "requires" => { "Config::INI::Reader" => 0, "Config::INI::Writer" => 0, "Dist::Zilla" => 4, "Dist::Zilla::Role::AfterRelease" => 0, "Dist::Zilla::Role::TextTemplate" => 0, "Dist::Zilla::Util" => 0, "File::Path" => 0, "File::Spec" => 0, "Moose" => "0.99", "Net::Twitter" => "4.00001", "Try::Tiny" => 0, "WWW::Shorten" => "3.02", "WWW::Shorten::Simple" => 0, "WWW::Shorten::TinyURL" => 0, "namespace::autoclean" => "0.09", "perl" => "5.009005", "strict" => 0, "utf8" => 0, "warnings" => 0 }, "script_files" => [], "test_requires" => { "Dist::Zilla::App::Tester" => 0, "Dist::Zilla::Role::Releaser" => 0, "Dist::Zilla::Tester" => 0, "File::Spec" => 0, "HTTP::Response" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "LWP::UserAgent" => 0, "Params::Util" => 0, "Sub::Exporter" => 0, "Test::More" => "0.88", "base" => 0, "lib" => 0 } ); my %fallback_build_requires = ( "Dist::Zilla::App::Tester" => 0, "Dist::Zilla::Role::Releaser" => 0, "Dist::Zilla::Tester" => 0, "File::Spec" => 0, "HTTP::Response" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "LWP::UserAgent" => 0, "Module::Build" => "0.28", "Params::Util" => 0, "Sub::Exporter" => 0, "Test::More" => "0.88", "base" => 0, "lib" => 0 ); unless ( eval { Module::Build->VERSION(0.4004) } ) { delete $module_build_args{test_requires}; $module_build_args{build_requires} = \%fallback_build_requires; } my $build = Module::Build->new(%module_build_args); $build->create_build_script; Dist-Zilla-Plugin-Twitter-0.026/MANIFEST0000644000175000017500000000206112413425715016161 0ustar mikemike# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.020. Build.PL Changes INSTALL LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README README.PATCHING README.mkdn Todo corpus/DZ-Test/dist.ini corpus/DZ-Test/lib/DZ/Test.pm corpus/DZ-meta/dist.ini corpus/DZ-meta/lib/DZ1.pm corpus/DZ1/dist.ini corpus/DZ1/lib/DZ1.pm corpus/DZ2/dist.ini corpus/DZ2/lib/DZ2.pm corpus/fake-HOME/dzil/twitter.ini dist.ini lib/Dist/Zilla/Plugin/Twitter.pm t/00-compile.t t/choose_shortener.t t/lib/Dist/Zilla/Plugin/FakeUploader.pm t/lib/LWP/TestUA.pm t/lib/Net/Netrc.pm t/lib/Test/DZil.pm t/lib/WWW/Shorten/TinyURL.pm t/meta.t t/module.t t/twitter.t xt/author/critic.t xt/author/no-tabs.t xt/author/test-eol.t xt/release/cpan-changes.t xt/release/dist-manifest.t xt/release/distmeta.t xt/release/kwalitee.t xt/release/meta-json.t xt/release/minimum-version.t xt/release/mojibake.t xt/release/pod-coverage.t xt/release/pod-linkcheck.t xt/release/pod-syntax.t xt/release/portability.t xt/release/synopsis.t xt/release/test-version.t xt/release/unused-vars.t Dist-Zilla-Plugin-Twitter-0.026/META.yml0000644000175000017500000000262612413425715016310 0ustar mikemike--- abstract: 'Twitter when you release with Dist::Zilla' author: - 'David Golden ' - 'Mike Doherty ' build_requires: Dist::Zilla::App::Tester: '0' Dist::Zilla::Role::Releaser: '0' Dist::Zilla::Tester: '0' File::Spec: '0' HTTP::Response: '0' IO::Handle: '0' IPC::Open3: '0' LWP::UserAgent: '0' Module::Build: '0.28' Params::Util: '0' Sub::Exporter: '0' Test::More: '0.88' base: '0' lib: '0' configure_requires: Module::Build: '0.28' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.142690' license: apache meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Dist-Zilla-Plugin-Twitter no_index: directory: - corpus - inc - examples requires: Config::INI::Reader: '0' Config::INI::Writer: '0' Dist::Zilla: '4' Dist::Zilla::Role::AfterRelease: '0' Dist::Zilla::Role::TextTemplate: '0' Dist::Zilla::Util: '0' File::Path: '0' File::Spec: '0' Moose: '0.99' Net::Twitter: '4.00001' Try::Tiny: '0' WWW::Shorten: '3.02' WWW::Shorten::Simple: '0' WWW::Shorten::TinyURL: '0' namespace::autoclean: '0.09' perl: '5.009005' strict: '0' utf8: '0' warnings: '0' resources: bugtracker: https://github.com/dagolden/dist-zilla-plugin-twitter/issues repository: git://github.com/dagolden/dist-zilla-plugin-twitter.git version: '0.026' Dist-Zilla-Plugin-Twitter-0.026/t/0000775000175000017500000000000012413425715015276 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/choose_shortener.t0000644000175000017500000000177612413425715021045 0ustar mikemikeuse strict; use warnings; use lib 't/lib'; use LWP::TestUA; # mocked UA use Net::Netrc; # mocked version use Test::More 0.88; use File::Spec; use Dist::Zilla::App::Tester; use Test::DZil; ## SIMPLE TEST WITH DZIL::APP TESTER $ENV{DZIL_GLOBAL_CONFIG_ROOT} = File::Spec->rel2abs( File::Spec->catdir(qw(corpus fake-HOME dzil)) ); $ENV{DZ_TWITTER_USERAGENT} = 'LWP::TestUA'; my $result = test_dzil('corpus/DZ2', [ qw(release) ]); is($result->exit_code, 0, "dzil release would have exited 0"); my $dvname = 'DZ2-0.001'; my $url = "https://metacpan.org/release/AUTHORID/${dvname}/"; my $msg = "[Twitter] Released $dvname $url #foo"; ok( (grep { $_ eq $msg } @{ $result->log_messages }), "we logged the Twitter message", ) or diag "STDOUT:\n" . $result->output . "STDERR:\n" . $result->error; ok ( (grep { $_ eq '[Twitter] Trying TinyURL' } @{ $result->log_messages }), 'Log claims we tried to use WWW::Shorten::TinyURL', ) or diag "STDOUT:\n" . $result->output . "STDERR:\n" . $result->error; done_testing; Dist-Zilla-Plugin-Twitter-0.026/t/lib/0000775000175000017500000000000012413425715016044 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/lib/Dist/0000775000175000017500000000000012413425715016747 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/lib/Dist/Zilla/0000775000175000017500000000000012413425715020022 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/lib/Dist/Zilla/Plugin/0000775000175000017500000000000012413425715021260 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/lib/Dist/Zilla/Plugin/FakeUploader.pm0000644000175000017500000000155712413425715024166 0ustar mikemikepackage Dist::Zilla::Plugin::FakeUploader; # ABSTRACT: fake plugin to test release use Moose; with 'Dist::Zilla::Role::Releaser'; has user => ( is => 'ro', isa => 'Str', required => 1, default => 'AUTHORID', ); sub release { my $self = shift; $self->log('Fake release happening (nothing was really done)'); } no Moose; __PACKAGE__->meta->make_immutable; 1; __END__ =head1 DESCRIPTION This plugin is a C that does nothing. It is directed to plugin authors, who may need a dumb release plugin to test their shiny plugin implementing C and C. When this plugin does the release, it will just log a message and finish. If you set the environment variable C to a true value, the plugin will die instead of doing nothing. This can be usefulfor authors wanting to test reliably that release failed. Dist-Zilla-Plugin-Twitter-0.026/t/lib/WWW/0000775000175000017500000000000012413425715016530 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/lib/WWW/Shorten/0000775000175000017500000000000012413425715020152 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/lib/WWW/Shorten/TinyURL.pm0000644000175000017500000000016612413425715022017 0ustar mikemikeuse strict; use warnings; package WWW::Shorten::TinyURL; our $VERSION = 999; sub makeashorterlink { return $_[0] } 1; Dist-Zilla-Plugin-Twitter-0.026/t/lib/LWP/0000775000175000017500000000000012413425715016506 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/lib/LWP/TestUA.pm0000644000175000017500000000146612413425715020216 0ustar mikemike# crudly adapted from t/lib/TestUA.pm in Net::Twitter use strict; use warnings; use HTTP::Response; package LWP::TestUA; use base 'LWP::UserAgent'; # from http://apiwiki.twitter.com/ xAuth example my $token_reply = "oauth_token=819797-torCkTs0XK7H2A2i1ee5iofqkMC4p7aayeEXRTmlw&" . "oauth_token_secret=SpuaLXRxZ0gOZHNQKPooBiWC2RY81klw13kLZGa2wc&" . "user_id=819797&screen_name=episod"; sub new { my $class = shift; my $self = $class->SUPER::new(@_); $self->add_handler( request_send => sub { my $req = shift; my $res = HTTP::Response->new(200, 'OK'); if ( $req->uri =~ qr{\Ahttps://api.twitter.com/oauth/access_token} ) { $res->content($token_reply); } else { $res->content('{"test":"success"}'); } return $res }, ); return $self; } 1; Dist-Zilla-Plugin-Twitter-0.026/t/lib/Test/0000775000175000017500000000000012413425715016763 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/lib/Test/DZil.pm0000644000175000017500000000336412413425715020167 0ustar mikemikeuse strict; use warnings; package Test::DZil; use Dist::Zilla::Tester; use Params::Util qw(_HASH0); use Sub::Exporter -setup => { exports => [ dist_ini => \'_dist_ini', simple_ini => \'_simple_ini', ], groups => [ default => [ qw(dist_ini simple_ini) ] ], }; sub _build_ini_builder { my ($starting_core) = @_; $starting_core ||= {}; sub { my (@arg) = @_; my $new_core = _HASH0($arg[0]) ? shift(@arg) : {}; my $core_config = { %$starting_core, %$new_core }; my $config = ''; for my $key (keys %$core_config) { my @values = ref $core_config->{ $key } ? @{ $core_config->{ $key } } : $core_config->{ $key }; $config .= "$key = $_\n" for grep {defined} @values; } $config .= "\n" if length $config; for my $line (@arg) { my @plugin = ref $line ? @$line : ($line, {}); my $moniker = shift @plugin; my $name = _HASH0($plugin[0]) ? undef : shift @plugin; my $payload = shift(@plugin) || {}; die "TOO MANY ARGS TO PLUGIN GAHLGHALAGH" if @plugin; $config .= '[' . $moniker; $config .= ' / ' . $name if defined $name; $config .= "]\n"; for my $key (keys %$payload) { my @values = ref $payload->{ $key } ? @{ $payload->{ $key } } : $payload->{ $key }; $config .= "$key = $_\n" for @values; } $config .= "\n"; } return $config; } } sub _dist_ini { _build_ini_builder; } sub _simple_ini { _build_ini_builder({ name => 'DZT-Sample', abstract => 'Sample DZ Dist', version => '0.001', author => 'E. Xavier Ample ', license => 'Perl_5', copyright_holder => 'E. Xavier Ample', }); } 1; Dist-Zilla-Plugin-Twitter-0.026/t/lib/Net/0000775000175000017500000000000012413425715016572 5ustar mikemikeDist-Zilla-Plugin-Twitter-0.026/t/lib/Net/Netrc.pm0000644000175000017500000000056512413425715020207 0ustar mikemike# mock version use strict; use warnings; package Net::Netrc; my $fake = { login => 'jdoe@example.com', account => 'jdoe', password => 'example', }; sub lookup { return bless $fake } sub login { return $fake->{login} } sub account { return $fake->{account} } sub password { return $fake->{password} } sub lpa { ($fake->login, $fake->password, $fake->account) } 1; Dist-Zilla-Plugin-Twitter-0.026/t/00-compile.t0000644000175000017500000000201312413425715017322 0ustar mikemikeuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.046 use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Dist/Zilla/Plugin/Twitter.pm' ); # no fake home requested my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', explain \@warnings if $ENV{AUTHOR_TESTING}; Dist-Zilla-Plugin-Twitter-0.026/t/twitter.t0000644000175000017500000000145612413425715017171 0ustar mikemikeuse strict; use warnings; use lib 't/lib'; use LWP::TestUA; # mocked UA use Net::Netrc; # mocked version use Test::More 0.88; use File::Spec; use Dist::Zilla::App::Tester; use Test::DZil; ## SIMPLE TEST WITH DZIL::APP TESTER $ENV{DZIL_GLOBAL_CONFIG_ROOT} = File::Spec->rel2abs( File::Spec->catdir(qw(corpus fake-HOME dzil)) ); $ENV{DZ_TWITTER_USERAGENT} = 'LWP::TestUA'; my $result = test_dzil('corpus/DZ1', [ qw(release) ]); is($result->exit_code, 0, "dzil release would have exited 0"); my $dvname = 'DZ1-0.001'; my $url = "https://metacpan.org/release/AUTHORID/${dvname}/"; my $msg = "[Twitter] Released $dvname $url #foo"; ok( (grep { $_ eq $msg } @{ $result->log_messages }), "we logged the Twitter message", ) or diag "STDOUT:\n" . $result->output . "STDERR:\n" . $result->error; done_testing; Dist-Zilla-Plugin-Twitter-0.026/t/module.t0000644000175000017500000000221312413425715016744 0ustar mikemikeuse strict; use warnings; use lib 't/lib'; use LWP::TestUA; # mocked UA use Net::Netrc; # mocked version use Test::More 0.88; use File::Spec; use Dist::Zilla::App::Tester; use Test::DZil; ## SIMPLE TEST WITH DZIL::APP TESTER $ENV{DZIL_GLOBAL_CONFIG_ROOT} = File::Spec->rel2abs( File::Spec->catdir(qw(corpus fake-HOME dzil)) ); $ENV{DZ_TWITTER_USERAGENT} = 'LWP::TestUA'; my $dist = 'DZ-Test'; my $result = test_dzil("corpus/$dist", [ qw(release) ]); is($result->exit_code, 0, "dzil release would have exited 0"); my $module = $dist; $module =~ s/-/::/g; my $url = "http://p3rl.org/$module"; my $tweet = "[Twitter] Released $dist-v1.2.2 $url http://github.com/dude/project #bar"; ok( (grep { $_ eq $tweet } @{ $result->log_messages }), "we logged the Twitter message", ) or diag explain { STDOUT => $result->output, STDERR => $result->error }; my $no_shortener_msg = '[Twitter] dist.ini specifies to not use a URL shortener; using full URL'; ok ( (grep { $_ eq $no_shortener_msg } @{ $result->log_messages }), q/Log claims we didn't use a URL shortener/, ) or diag explain { STDOUT => $result->output, STDERR => $result->error }; done_testing; Dist-Zilla-Plugin-Twitter-0.026/t/meta.t0000644000175000017500000000155212413425715016412 0ustar mikemikeuse strict; use warnings; use lib 't/lib'; use LWP::TestUA; # mocked UA use Net::Netrc; # mocked version use Test::More 0.88; use File::Spec; use Dist::Zilla::App::Tester; use Test::DZil; ## SIMPLE TEST WITH DZIL::APP TESTER $ENV{DZIL_GLOBAL_CONFIG_ROOT} = File::Spec->rel2abs( File::Spec->catdir(qw(corpus fake-HOME dzil)) ); $ENV{DZ_TWITTER_USERAGENT} = 'LWP::TestUA'; my $result = test_dzil('corpus/DZ-meta', [ qw(release) ]); is($result->exit_code, 0, "dzil release would have exited 0"); my $dvname = 'DZ1-0.001'; my $url = "https://metacpan.org/release/AUTHORID/${dvname}/"; my $msg = "[Twitter] E. Xavier Ample released DZ1 0.001: $url (perl_5) 1.00 #foo"; ok( (grep { $_ eq $msg } @{ $result->log_messages }), "we logged the Twitter message", ) or diag "STDOUT:\n" . $result->output . "STDERR:\n" . $result->error; done_testing; Dist-Zilla-Plugin-Twitter-0.026/dist.ini0000644000175000017500000000047412413425715016502 0ustar mikemikename = Dist-Zilla-Plugin-Twitter author = David Golden author = Mike Doherty license = Apache_2_0 copyright_holder = David Golden [@Author::DOHERTY] tag_format = release-%v%t version_regexp = ^release-(.+)$ authoritative_fork = 1 Dist-Zilla-Plugin-Twitter-0.026/INSTALL0000644000175000017500000000204512413425715016063 0ustar mikemikeThis is the Perl distribution Dist-Zilla-Plugin-Twitter. Installing Dist-Zilla-Plugin-Twitter is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm Dist::Zilla::Plugin::Twitter If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S Dist::Zilla::Plugin::Twitter ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan Dist::Zilla::Plugin::Twitter ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Build.PL % ./Build && ./Build test Then install it: % ./Build install If you are installing into a system-wide directory, you may need to run: % sudo ./Build install ## Documentation Dist-Zilla-Plugin-Twitter documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc Dist::Zilla::Plugin::Twitter Dist-Zilla-Plugin-Twitter-0.026/LICENSE0000644000175000017500000002635412413425715016050 0ustar mikemikeThis software is Copyright (c) 2014 by David Golden. This is free software, licensed under: The Apache License, Version 2.0, January 2004 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Dist-Zilla-Plugin-Twitter-0.026/Changes0000644000175000017500000000560112413425715016326 0ustar mikemikeRevision history for Dist-Zilla-Plugin-Twitter 0.026 2014-10-02 - Fixed the test suite for compatibility with WWW::Shorten v0.1.1, which removed Metamark support [gh-8] 0.025 2014-01-16 - Twitter API is now SSL-only, so use SSL to connect to Twitter 0.024 2013-11-27 - Add "=head1 NAME" so the pod will get munged during test 0.023 2013-10-18 - Improved compile test 0.022 2013-09-27 - Add new ways of interpolating metadata into tweet text, and use that to fix the failing tests. 0.021 2013-06-13 - API v1.1 support [GH #5] 0.020 2013-02-02 - Link to doherty's github repo instead of dagolden's 0.019 2013-02-02 - Fix a typo in the default tweet spec 0.018 2013-02-02 - Allow adding any information from META [Yanick Champoux] and add a link to the repo's web URL by default 0.017 2012-07-06 - Use url_shortener=none to use the full URL (which Twitter will shorten with t.co) 0.016 2012-05-18 - Don't treat the PIN as a password [GH #1] 0.015 2012-04-01 22:40:05 EST5EDT - Update Twitter authentication method [RT #75995 - Mike Doherty] - This will require all users to re-authorize the application at Twitter, and will fetch & store an access token + secret pair instead of using passwords. You may delete the section in your .netrc file for api.twitter.com unless you need it for something else. 0.014 2012-01-13 12:36:58 EST5EDT - distribution abstract now available for use in tweets [Harley Pig] 0.013 2011-12-01 09:06:37 EST5EDT - changed default URL to metacpan [Mike Doherty] 0.012 2011-11-22 17:04:03 EST5EDT - better handling of missing .netrc auth data [William Orr] 0.011 2011-10-07 16:11:01 EST5EDT - add support for -TRIAL dists [Kent Fredric] 0.010 2011-01-23 15:53:51 EST5EDT - add 'url_shortener' option [Mike Doherty] 0.009 2010-07-27 11:32:57 EST5EDT - bump Dist::Zilla prereq to 4 0.008 2010-07-26 20:14:54 EST5EDT - document that FakeRelease may also be used [contributed by kent fredric] - add some alternate sources for username since dist-zilla may have renamed what gets defined by release plugins - update dist.ini to @DAGOLDEN bundle (but still twitter it) 0.007 2010-04-29 10:09:15 EST5EDT - add 'hash_tags' option to append custom tags [contributed by mschout] 0.006 2010-04-28 13:10:03 EST5EDT - use xauth authentication 0.005 2010-04-27 10:06:14 EST5EDT - turn on auto collection of prerequisites (duh) 0.004 2010-04-26 17:12:38 EST5EDT - don't index sample distributin for testing 0.003 2010-04-26 00:26:26 EST5EDT - no changes -- releasing to test the new URL 0.002 2010-04-26 00:19:42 EST5EDT - change url from frepan to the README on cpan.cpantesters.org; this is one of the fastest hyperlinks to be available after upload 0.001 2010-04-25 23:46:15 EST5EDT - first draft Dist-Zilla-Plugin-Twitter-0.026/README0000644000175000017500000001002612413425715015710 0ustar mikemikeNAME Dist::Zilla::Plugin::Twitter - Twitter when you release with Dist::Zilla VERSION version 0.026 SYNOPSIS In your dist.ini: [Twitter] hash_tags = #foo url_shortener = TinyURL DESCRIPTION This plugin will use Net::Twitter to send a release notice to Twitter. By default, it will include a link to release on . The default configuration is as follows: [Twitter] tweet_url = https://metacpan.org/release/{{$AUTHOR_UC}}/{{$DIST}}-{{$VERSION}}/ tweet = Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} {{$URL}} !META{resources}{repository}{web} url_shortener = TinyURL The "tweet_url" is shortened with WWW::Shorten::TinyURL or whichever other service you choose (use 'none' to use the full URL, in which case Twitter will shorten it for you) and appended to the "tweet" message. VARIABLE INTERPOLATION The following variables are available for substitution in the URL and message templates: DIST # Foo-Bar MODULE # Foo::Bar ABSTRACT # Foo-Bar is a module that FooBars VERSION # 1.23 TRIAL # -TRIAL if is_trial, empty string otherwise. TARBALL # Foo-Bar-1.23.tar.gz AUTHOR_UC # JOHNDOE AUTHOR_LC # johndoe AUTHOR_PATH # J/JO/JOHNDOE URL # http://tinyurl.com/... DISTMETA INTERPOLATION Resources information available in the META.* files of the distribution can be accessed via ". You may mix-and-match "{...}" to access hashref elements and "[\d]" to access arrayref elements. You're responsible for making sure you are accessing the right part of the META data structure, and treating it as the right type of data. See CPAN::Meta::Spec and the "$TYPE DATA" sections of CPAN::Meta in particular. The "META{...}" replacement may also have one of two modifiers, which are prefixed directly before "META": "!" - URL shortening Providing an exclamation point ("!META{...}") will URL-shorten the value you extract from the distmeta data structure. This will have no effect unless the value is a URL to begin with. "@" - Arrayref stringification Providing an at-symbol (@META{...}) will include all the elements of the arrayref you specify by joining them with $". So, this is just like doing "@{ $your_array_ref }". So, for example, to use the GitHub home of the project instead of its metacpan page, one can do: [Twitter] tweet = Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} !META{resource}{repository}{web} url_shortener = TinyURL Or, to include the authors in your tweet: [Twitter] tweet = @META{author} released {{$MODULE}} {{$VERSION}}: {{$URL}} PAUSEID You must be using the "UploadToCPAN" or "FakeRelease" plugin for this plugin to determine your PAUSEID. HASHTAGS You can use the "hash_tags" option to append hash tags (or anything, really) to the end of the message generated from "tweet". [Twitter] hash_tags = #perl #cpan #foo AVAILABILITY The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit to find a CPAN site near you, or see . SOURCE The development version is on github at and may be cloned from BUGS AND LIMITATIONS You can make new bug reports, and view existing ones, through the web interface at . AUTHORS * David Golden * Mike Doherty COPYRIGHT AND LICENSE This software is Copyright (c) 2014 by David Golden. This is free software, licensed under: The Apache License, Version 2.0, January 2004 Dist-Zilla-Plugin-Twitter-0.026/Todo0000644000175000017500000000011312413425715015654 0ustar mikemikeStuff todo: * fork a process and delay the tweet until the URL goes live