Hello community, here is the log from the commit of package perl-App-Nopaste for openSUSE:Factory checked in at 2013-05-16 11:22:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-App-Nopaste (Old) and /work/SRC/openSUSE:Factory/.perl-App-Nopaste.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-App-Nopaste" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-App-Nopaste/perl-App-Nopaste.changes 2012-09-14 12:33:39.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-App-Nopaste.new/perl-App-Nopaste.changes 2013-05-16 11:22:59.000000000 +0200 @@ -1,0 +2,20 @@ +Wed May 15 15:24:28 UTC 2013 - [email protected] + +- updated to 0.92 + Fix the language mappins for Ubuntu's pastebin (Sergey Romanov) + Don't need to load Moose in the tests (Sergey Romanov) + + Decode incoming text as utf8 (Jesse Luehrs) + Support for GITHUB_USER and GITHUB_PASS (Rafael Kitover) + Name the gist file `nopaste` not `nopaste.txt` for possible syntax highlighting (Rafael Kitover) + Use decode_json not a regular expression to decode Gist response body (Shawn M Moore) + Give a hint to perldoc App::Nopaste::Service::Gist on 401 (Shawn M Moore) + + Port from Moose and MooseX::Getopt to Getopt::Long::Descriptive (frew) + App::Nopaste is not using any interesting Moose features, + so it doesn't make sense to pay the startup cost (even + though it's probably dominated by network latency) + + Please report any regressions! + +------------------------------------------------------------------- Old: ---- App-Nopaste-0.35.tar.gz New: ---- App-Nopaste-0.92.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-App-Nopaste.spec ++++++ --- /var/tmp/diff_new_pack.FHtHAC/_old 2013-05-16 11:23:00.000000000 +0200 +++ /var/tmp/diff_new_pack.FHtHAC/_new 2013-05-16 11:23:00.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-App-Nopaste # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,43 +17,55 @@ Name: perl-App-Nopaste -Version: 0.35 +Version: 0.92 Release: 0 -Summary: Easy access to any pastebin +%define cpan_name App-Nopaste +Summary: easy access to any pastebin License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl -Source: http://search.cpan.org/CPAN/authors/id/S/SA/SARTAK/App-Nopaste-%{version}.tar.gz +Url: http://search.cpan.org/dist/App-Nopaste/ +Source: http://www.cpan.org/authors/id/S/SA/SARTAK/%{cpan_name}-%{version}.tar.gz +# MANUAL Source1: SusePaste.pm -Url: http://search.cpan.org/dist/App-Nopaste +BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build -%{perl_requires} -BuildRequires: make +BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Browser::Open) BuildRequires: perl(Class::Load) BuildRequires: perl(Clipboard) -BuildRequires: perl(Config::GitLike) -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42 -BuildRequires: perl(File::Spec) -BuildRequires: perl(File::Temp) -BuildRequires: perl(HTML::Form) +BuildRequires: perl(Getopt::Long::Descriptive) >= 0.090 BuildRequires: perl(JSON) BuildRequires: perl(Module::Pluggable) -BuildRequires: perl(Moose) >= 0.74 -BuildRequires: perl(MooseX::Getopt) >= 0.17 +BuildRequires: perl(URI::Escape) BuildRequires: perl(WWW::Mechanize) BuildRequires: perl(WWW::Pastebin::PastebinCom::Create) -Requires: perl(HTML::Form) +#BuildRequires: perl(App::Nopaste) +#BuildRequires: perl(App::Nopaste::Command) +#BuildRequires: perl(App::Nopaste::Service) +#BuildRequires: perl(CPANPLUS::Backend) +#BuildRequires: perl(HTTP::Request::Common) +#BuildRequires: perl(inc::Module::Install) +#BuildRequires: perl(LWP::Protocol) +#BuildRequires: perl(LWP::Simple) +#BuildRequires: perl(Module::AutoInstall) +#BuildRequires: perl(Module::Build) +#BuildRequires: perl(Module::Install::AutoManifest) +#BuildRequires: perl(Module::Install::Base) +#BuildRequires: perl(Module::Install::GithubMeta) +#BuildRequires: perl(Module::Install::ManifestSkip) +#BuildRequires: perl(Parse::CPAN::Meta) +#BuildRequires: perl(YAML::Tiny) +Requires: perl(Browser::Open) +Requires: perl(Class::Load) +Requires: perl(Clipboard) +Requires: perl(Getopt::Long::Descriptive) >= 0.090 +Requires: perl(JSON) Requires: perl(Module::Pluggable) -Requires: perl(Moose) >= 0.74 -Requires: perl(MooseX::Getopt) >= 0.17 +Requires: perl(URI::Escape) Requires: perl(WWW::Mechanize) -Recommends: perl(Browser::Open) -Recommends: perl(Clipboard) -Recommends: perl(WWW::Pastebin::PastebinCom::Create) -Recommends: perl(Config::GitLike) -Recommends: perl(File::Temp) -Recommends: perl(File::Spec) +Requires: perl(WWW::Pastebin::PastebinCom::Create) +%{perl_requires} %description Pastebins (also known as nopaste sites) let you post text, usually code, @@ -62,16 +74,16 @@ nopaste). Each pastebin is slightly different. When one pastebin goes down (I'm -looking at you, <http://paste.husk.org>), then you have to find a new one. -And if you usually use a script to publish text, then it's too much -hassle. +looking at you, the http://paste.husk.org manpage), then you have to find a +new one. And if you usually use a script to publish text, then it's too +much hassle. This module aims to smooth out the differences between pastebins, and provides redundancy: if one site doesn't work, it just tries a different one. -It's also modular: you only need to put on CPAN a -App::Nopaste::Service::Foo module and anyone can begin using it. +It's also modular: you only need to put on CPAN a the +App::Nopaste::Service::Foo manpage module and anyone can begin using it. %package -n nopaste Summary: Easy access to any pastebin @@ -97,41 +109,25 @@ one. %prep -%setup -q -n "App-Nopaste-%{version}" +%setup -q -n %{cpan_name}-%{version} %__sed -i '/^auto_install/d' Makefile.PL %__install -m 0644 "%{SOURCE1}" lib/App/Nopaste/Service/ +find . -type f -print0 | xargs -0 chmod 644 %build -%__perl Makefile.PL PREFIX="%{_prefix}" -%__make %{?jobs:-j%{jobs}} +%{__perl} Makefile.PL INSTALLDIRS=vendor +%{__make} %{?_smp_mflags} + +%check +%{__make} test %install %perl_make_install - -find "%{buildroot}%{perl_vendorlib}" -type f -name '*.pm' -exec %__chmod 0644 {} \; - %perl_process_packlist +%perl_gen_filelist -%check -%__make test - -%files -%defattr(-,root,root) +%files -f %{name}.files +%defattr(-,root,root,755) %doc Changes -%dir %{perl_vendorlib}/App -%{perl_vendorlib}/App/Nopaste.pm -%dir %{perl_vendorlib}/App/Nopaste -%{perl_vendorlib}/App/Nopaste/*.pm -%dir %{perl_vendorlib}/App/Nopaste/Service -%{perl_vendorlib}/App/Nopaste/Service/*.pm -%dir %{perl_vendorarch}/auto/App -%{perl_vendorarch}/auto/App/Nopaste -%doc %{perl_man3dir}/App::Nopaste.%{perl_man3ext}%{ext_man} -%doc %{perl_man3dir}/App::Nopaste::*.%{perl_man3ext}%{ext_man} - -%files -n nopaste -%defattr(-,root,root) -%{_bindir}/nopaste -%doc %{_mandir}/man1/nopaste.1%{ext_man} %changelog ++++++ App-Nopaste-0.35.tar.gz -> App-Nopaste-0.92.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/Changes new/App-Nopaste-0.92/Changes --- old/App-Nopaste-0.35/Changes 2012-07-17 21:34:55.000000000 +0200 +++ new/App-Nopaste-0.92/Changes 2013-04-26 17:05:10.000000000 +0200 @@ -1,5 +1,24 @@ Revision history for App-Nopaste +0.92 Fri Apr 26 2013 + Fix the language mappins for Ubuntu's pastebin (Sergey Romanov) + Don't need to load Moose in the tests (Sergey Romanov) + +0.91 Sun Jan 27 2013 + Decode incoming text as utf8 (Jesse Luehrs) + Support for GITHUB_USER and GITHUB_PASS (Rafael Kitover) + Name the gist file `nopaste` not `nopaste.txt` for possible syntax highlighting (Rafael Kitover) + Use decode_json not a regular expression to decode Gist response body (Shawn M Moore) + Give a hint to perldoc App::Nopaste::Service::Gist on 401 (Shawn M Moore) + +0.90 Tue Oct 30 2012 + Port from Moose and MooseX::Getopt to Getopt::Long::Descriptive (frew) + App::Nopaste is not using any interesting Moose features, + so it doesn't make sense to pay the startup cost (even + though it's probably dominated by network latency) + + Please report any regressions! + 0.35 Tue Jul 17 2012 Don't barf when gist-ing STDIN. (Ricardo SIGNES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/MANIFEST new/App-Nopaste-0.92/MANIFEST --- old/App-Nopaste-0.35/MANIFEST 2012-07-17 21:35:40.000000000 +0200 +++ new/App-Nopaste-0.92/MANIFEST 2013-04-26 17:05:41.000000000 +0200 @@ -32,3 +32,4 @@ META.yml t/000-load.t t/001-subclass_cmd.t +t/002-encoding.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/META.yml new/App-Nopaste-0.92/META.yml --- old/App-Nopaste-0.35/META.yml 2012-07-17 21:35:04.000000000 +0200 +++ new/App-Nopaste-0.92/META.yml 2013-04-26 17:05:39.000000000 +0200 @@ -22,13 +22,11 @@ Browser::Open: 0 Class::Load: 0 Clipboard: 0 - Config::GitLike: 0.00 File::Spec: 0 File::Temp: 0 + Getopt::Long::Descriptive: 0.090 JSON: 0 Module::Pluggable: 0 - Moose: 0.74 - MooseX::Getopt: 0.17 URI::Escape: 0 WWW::Mechanize: 0 WWW::Pastebin::PastebinCom::Create: 0 @@ -36,8 +34,5 @@ resources: homepage: https://github.com/sartak/app-nopaste/tree license: http://dev.perl.org/licenses/ - repository: - type: git - url: git://github.com/sartak/app-nopaste.git - web: https://github.com/sartak/app-nopaste/tree -version: 0.35 + repository: git://github.com/sartak/app-nopaste.git +version: 0.92 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/Makefile.PL new/App-Nopaste-0.92/Makefile.PL --- old/App-Nopaste-0.35/Makefile.PL 2012-07-14 16:39:21.000000000 +0200 +++ new/App-Nopaste-0.92/Makefile.PL 2012-10-30 19:25:00.000000000 +0100 @@ -11,8 +11,7 @@ requires 'WWW::Mechanize'; requires 'Module::Pluggable'; -requires 'Moose' => '0.74'; -requires 'MooseX::Getopt' => '0.17'; +requires 'Getopt::Long::Descriptive' => '0.090'; requires 'Class::Load'; requires 'URI::Escape'; requires 'JSON'; @@ -24,9 +23,6 @@ 'copying of URLs with -x/--copy' => [ 'Clipboard', ], - 'Github authentication (having Git installed works too)' => [ - 'Config::GitLike' => '0.00', - ], 'copy files to remote server with scp' => [ 'File::Temp', 'File::Spec' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/inc/Module/Install/GithubMeta.pm new/App-Nopaste-0.92/inc/Module/Install/GithubMeta.pm --- old/App-Nopaste-0.35/inc/Module/Install/GithubMeta.pm 2012-07-17 21:35:04.000000000 +0200 +++ new/App-Nopaste-0.92/inc/Module/Install/GithubMeta.pm 2013-04-26 17:05:38.000000000 +0200 @@ -7,7 +7,7 @@ use base qw(Module::Install::Base); use vars qw($VERSION); -$VERSION = '0.16'; +$VERSION = '0.22'; sub githubmeta { my $self = shift; @@ -21,13 +21,7 @@ $git_url =~ s![\w\-]+\@([^:]+):!git://$1/!; $http_url =~ s![\w\-]+\@([^:]+):!https://$1/!; $http_url =~ s!\.git$!/tree!; - $self->repository( - { - type => 'git', - url => $git_url, - web => $http_url, - }, - ); + $self->repository( $git_url ); $self->homepage( $http_url ) unless $self->homepage(); return 1; } @@ -54,4 +48,4 @@ 'Github'; __END__ -#line 117 +#line 111 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/lib/App/Nopaste/Command.pm new/App-Nopaste-0.92/lib/App/Nopaste/Command.pm --- old/App-Nopaste-0.35/lib/App/Nopaste/Command.pm 2012-07-14 16:39:21.000000000 +0200 +++ new/App-Nopaste-0.92/lib/App/Nopaste/Command.pm 2013-01-27 20:11:20.000000000 +0100 @@ -1,102 +1,90 @@ package App::Nopaste::Command; -use Moose; -with 'MooseX::Getopt'; + +use strict; +use warnings; + +use Getopt::Long::Descriptive (); use App::Nopaste; -has desc => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Str', - cmd_aliases => ['description', 'd'], - documentation => "The one line description of your paste. The default is usually the first few characters of your text.", -); +sub new_with_options { + my $class = shift; + my ($opt, $usage) = Getopt::Long::Descriptive::describe_options( + "$0 %o", + ['help|usage|?|h', 'Prints this usage information' ], + ['desc|description|d=s', + 'The one line description of your paste. The default is usually the first few characters of your text.' + ], + ['nick|nickname|name|n=s', 'Your nickname, usually displayed with the paste.'], -has nick => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Str', - cmd_aliases => ['nickname', 'name', 'n'], - documentation => "Your nickname, usually displayed with the paste.", -); + ['lang|language|l=s', 'The language of the nopaste. Default: perl.', + { default => 'perl' }, + ], -has lang => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Str', - default => 'perl', - cmd_aliases => ['language', 'l'], - documentation => "The language of the nopaste. Default: perl.", -); + ['chan|channel|c=s', + 'The channel for the nopaste, not always relevant. Usually tied to a pastebot in that channel which will announce your paste.', + ], -has chan => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Str', - cmd_aliases => ['channel', 'c'], - documentation => "The channel for the nopaste, not always relevant. Usually tied to a pastebot in that channel which will announce your paste.", -); + ['services|service|s=s', + 'The nopaste services to try, in order. You may also specify this in the env var NOPASTE_SERVICES.', + ], -has services => ( - traits => ['Getopt'], - is => 'rw', - isa => 'ArrayRef[Str]', - cmd_aliases => ['service', 's'], - documentation => "The nopaste services to try, in order. You may also specify this in the env var NOPASTE_SERVICES.", -); + ['list_services|list|L', 'List available nopaste services'], -has list_services => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Bool', - cmd_aliases => ['list', 'L'], - documentation => "List available nopaste services", -); + ['copy|x', 'If specified, automatically copy the URL to your clipboard.'], -has copy => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Bool', - cmd_aliases => ['x'], - documentation => "If specified, automatically copy the URL to your clipboard.", -); + ['paste|p', 'If specified, use only the clipboard as input.'], -has paste => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Bool', - cmd_aliases => ['p'], - documentation => "If specified, use only the clipboard as input.", -); + ['open_url|open|o', 'If specified, automatically open the URL using Browser::Open.'], -has open_url => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Bool', - cmd_aliases => ['open', 'o'], - documentation => "If specified, automatically open the URL using Browser::Open.", -); + ['quiet|q', 'If specified, do not warn or complain about broken services.'], -has quiet => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Bool', - cmd_aliases => ['q'], - documentation => "If specified, do not warn or complain about broken services.", -); + ['private', 'If specified, paste privately to services where possible.'], + ); -has private => ( - traits => ['Getopt'], - is => 'rw', - isa => 'Bool', - documentation => "If specified, paste privately to services where possible.", -); + print($usage->text), exit if $opt->help; + + my $self = $class->new({ + extra_argv => [@ARGV], + map { $_ => $opt->$_ } qw( + desc nick lang chan list_services copy paste open_url quiet private services + ), + }); +} -has filename => ( - is => 'rw', - isa => 'Maybe[Str]', - builder => 'detect_filename' +sub new { + my $class = shift; + my $self; + if (!ref $_[0]) { + $self = { @_ }; + } else { + $self = $_[0] + } + + $self->{services} = [ split /\s+/, $self->{services} ] + if defined $self->{services} && !ref $self->{services}; + + bless $self, $class; + + return $self +} +my @acc = qw( + desc nick lang chan list_services copy paste open_url quiet private usage + extra_argv services ); +for my $a (@acc) { + no strict 'refs'; + + *{__PACKAGE__ . '::' . $a } = sub { $_[0]->{$a} } +} +sub filename { + my $self = shift; + my @files = @{ $self->extra_argv }; + + return undef unless @files; + return undef if $self->paste or $files[0] eq '-'; + return $files[0]; +} sub run { my $self = shift; @@ -110,10 +98,9 @@ } my $text = $self->read_text; + utf8::decode($text); - my %args = map { - $_->name => $_->get_value($self) - } $self->meta->get_all_attributes; + my %args = map { $_ => $self->$_ } @acc, qw(filename); $args{text} ||= $text; @@ -154,18 +141,6 @@ return <>; } -sub detect_filename { - my $self = shift; - my @files = @{ $self->extra_argv }; - - return undef unless @files; - return undef if $self->paste or $files[0] eq '-'; - return $files[0]; -} - -__PACKAGE__->meta->make_immutable; -no Moose; - 1; __END__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/lib/App/Nopaste/Service/Gist.pm new/App-Nopaste-0.92/lib/App/Nopaste/Service/Gist.pm --- old/App-Nopaste-0.35/lib/App/Nopaste/Service/Gist.pm 2012-07-17 21:34:32.000000000 +0200 +++ new/App-Nopaste-0.92/lib/App/Nopaste/Service/Gist.pm 2013-01-27 20:25:19.000000000 +0100 @@ -25,7 +25,7 @@ my $filename = defined $arg{filename} ? File::Basename::basename($arg{filename}) - : 'nopaste.txt'; + : 'nopaste'; $content->{files} = { $filename => { @@ -37,11 +37,23 @@ my %auth = $self->_get_auth; - my $res = $ua->post( - 'https://api.github.com/gists', - 'Authorization' => "token $auth{oauth_token}", - Content => $content - ); + my $url = 'https://api.github.com/gists'; + + my $res = do { + if ($auth{oauth_token}) { + $ua->post( + $url, + 'Authorization' => "token $auth{oauth_token}", + Content => $content + ); + } + else { + require HTTP::Request::Common; + my $req = HTTP::Request::Common::POST($url, Content => $content); + $req->authorization_basic(@auth{qw/username password/}); + $ua->request($req); + } + }; return $self->return($res); } @@ -52,10 +64,18 @@ if (my $oauth_token = $ENV{GITHUB_OAUTH_TOKEN}) { return (oauth_token => $oauth_token); } + elsif ($ENV{GITHUB_USER} && $ENV{GITHUB_PASSWORD}) { + return ( + username => $ENV{GITHUB_USER}, + password => $ENV{GITHUB_PASSWORD}, + ); + } die join("\n", "Export GITHUB_OAUTH_TOKEN first. For example:", - " perl -Ilib -MApp::Nopaste::Service::Gist -e 'App::Nopaste::Service::Gist->create_token'" + " perl -Ilib -MApp::Nopaste::Service::Gist -e 'App::Nopaste::Service::Gist->create_token'", + "", + "OR you can export GITHUB_USER and GITHUB_PASSWORD.", ) . "\n"; } @@ -99,14 +119,18 @@ my ($self, $res) = @_; if ($res->is_error) { - return (0, "Failed: " . $res->status_line); + my $text = $res->status_line; + if ($res->code == 401) { + $text .= "\nYou may need to authorize $0. See `perldoc " . __PACKAGE__ . "`"; + } + return (0, "Failed: " . $text); } if (($res->header('Client-Warning') || '') eq 'Internal response') { return (0, "LWP Error: " . $res->content); } - my ($id) = $res->content =~ qr{"id":"([0-9a-f]+)"}; + my $id = JSON::decode_json($res->content)->{id}; return (0, "Could not find paste link.") if !$id; return (1, "http://gist.github.com/$id"); @@ -136,6 +160,10 @@ access rights anytime from the GitHub profile settings. Search for C<token> in response and export it as C<GITHUB_OAUTH_TOKEN> environment variable. +Alternatively, you can export the C<GITHUB_USER> and C<GITHUB_PASSWORD> +environment variables, just like for the +L<gist|https://github.com/defunkt/gist> utility. + That's it! =head1 AUTHOR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/lib/App/Nopaste/Service/Ubuntu.pm new/App-Nopaste-0.92/lib/App/Nopaste/Service/Ubuntu.pm --- old/App-Nopaste-0.35/lib/App/Nopaste/Service/Ubuntu.pm 2012-07-14 16:39:21.000000000 +0200 +++ new/App-Nopaste-0.92/lib/App/Nopaste/Service/Ubuntu.pm 2013-03-16 01:31:42.000000000 +0100 @@ -4,103 +4,103 @@ use base 'App::Nopaste::Service'; my $languages = { - "Plain Text" => "text", - "ApacheConf" => "apacheconf", - "ActionScript" => "as", - "Bash" => "bash", - "Batchfile" => "bat", - "BBCode" => "bbcode", - "Befunge" => "befunge", - "Boo" => "boo", - "C" => "c", - "c-objdump" => "c-objdump", - "Common Lisp" => "common-lisp", - "Debian Control file" => "control", - "C++" => "cpp", - "cpp-objdump" => "cpp-objdump", - "C#" => "csharp", - "CSS" => "css", - "CSS+Django/Jinja" => "css+django", - "CSS+Ruby" => "css+erb", - "CSS+Genshi Text" => "css+genshitext", - "CSS+Mako" => "css+mako", - "CSS+Myghty" => "css+myghty", - "CSS+PHP" => "css+php", - "CSS+Smarty" => "css+smarty", - "D" => "d", - "d-objdump" => "d-objdump", - "Delphi" => "delphi", - "Diff" => "diff", - "Django/Jinja" => "django", - "DylanLexer" => "dylan", - "ERB" => "erb", - "Erlang" => "erlang", - "GAS" => "gas", - "Genshi" => "genshi", - "Genshi Text" => "genshitext", - "Groff" => "groff", - "Haskell" => "haskell", - "HTML" => "html", - "HTML+Django/Jinja" => "html+django", - "HTML+Genshi" => "html+genshi", - "HTML+Mako" => "html+mako", - "HTML+Myghty" => "html+myghty", - "HTML+PHP" => "html+php", - "HTML+Smarty" => "html+smarty", - "INI" => "ini", - "IRC logs" => "irc", - "Java" => "java", - "JavaScript" => "js", - "JavaScript+Django/Jinja" => "js+django", - "JavaScript+Ruby" => "js+erb", - "JavaScript+Genshi Text" => "js+genshitext", - "JavaScript+Mako" => "js+mako", - "JavaScript+Myghty" => "js+myghty", - "JavaScript+PHP" => "js+php", - "JavaScript+Smarty" => "js+smarty", - "Java Server Page" => "jsp", - "Literate Haskell" => "lhs", - "LLVM" => "llvm", - "Lua" => "lua", - "Makefile" => "make", - "Mako" => "mako", - "MiniD" => "minid", - "MOOCode" => "moocode", - "MuPAD" => "mupad", - "Myghty" => "myghty", - "MySQL" => "mysql", - "objdump" => "objdump", - "Objective-C" => "objective-c", - "OCaml" => "ocaml", - "Perl" => "perl", - "PHP" => "php", - "Gettext Catalog" => "pot", - "Python console session" => "pycon", - "Python Traceback" => "pytb", - "Python" => "python", - "Raw token data" => "raw", - "Ruby" => "rb", - "Ruby irb session" => "rbcon", - "Redcode" => "redcode", - "RHTML" => "rhtml", - "reStructuredText" => "rst", - "Scheme" => "scheme", - "Smarty" => "smarty", - "Debian Sourcelist" => "sourceslist", - "SQL" => "sql", - "SquidConf" => "squidconf", - "TeX" => "tex", - "Text only" => "text", - "MoinMoin/Trac Wiki markup" => "trac-wiki", - "VB.net" => "vb.net", - "VimL" => "vim", - "XML" => "xml", - "XML+Django/Jinja" => "xml+django", - "XML+Ruby" => "xml+erb", - "XML+Mako" => "xml+mako", - "XML+Myghty" => "xml+myghty", - "XML+PHP" => "xml+php", - "XML+Smarty" => "xml+smarty", + "text" => "Plain Text", + "apacheconf" => "ApacheConf", + "as" => "ActionScript", + "bash" => "Bash", + "bat" => "Batchfile", + "bbcode" => "BBCode", + "befunge" => "Befunge", + "boo" => "Boo", + "c" => "C", + "c-objdump" => "c-objdump", + "common-lisp" => "Common Lisp", + "control" => "Debian Control file", + "cpp" => "C++", + "cpp-objdump" => "cpp-objdump", + "csharp" => "C#", + "css" => "CSS", + "css+django" => "CSS+Django/Jinja", + "css+erb" => "CSS+Ruby", + "css+genshitext" => "CSS+Genshi Text", + "css+mako" => "CSS+Mako", + "css+myghty" => "CSS+Myghty", + "css+php" => "CSS+PHP", + "css+smarty" => "CSS+Smarty", + "d" => "D", + "d-objdump" => "d-objdump", + "delphi" => "Delphi", + "diff" => "Diff", + "django" => "Django/Jinja", + "dylan" => "DylanLexer", + "erb" => "ERB", + "erlang" => "Erlang", + "gas" => "GAS", + "genshi" => "Genshi", + "genshitext" => "Genshi Text", + "groff" => "Groff", + "haskell" => "Haskell", + "html" => "HTML", + "html+django" => "HTML+Django/Jinja", + "html+genshi" => "HTML+Genshi", + "html+mako" => "HTML+Mako", + "html+myghty" => "HTML+Myghty", + "html+php" => "HTML+PHP", + "html+smarty" => "HTML+Smarty", + "ini" => "INI", + "irc" => "IRC logs", + "java" => "Java", + "js" => "JavaScript", + "js+django" => "JavaScript+Django/Jinja", + "js+erb" => "JavaScript+Ruby", + "js+genshitext" => "JavaScript+Genshi Text", + "js+mako" => "JavaScript+Mako", + "js+myghty" => "JavaScript+Myghty", + "js+php" => "JavaScript+PHP", + "js+smarty" => "JavaScript+Smarty", + "jsp" => "Java Server Page", + "lhs" => "Literate Haskell", + "llvm" => "LLVM", + "lua" => "Lua", + "make" => "Makefile", + "mako" => "Mako", + "minid" => "MiniD", + "moocode" => "MOOCode", + "mupad" => "MuPAD", + "myghty" => "Myghty", + "mysql" => "MySQL", + "objdump" => "objdump", + "objective-c" => "Objective-C", + "ocaml" => "OCaml", + "perl" => "Perl", + "php" => "PHP", + "pot" => "Gettext Catalog", + "pycon" => "Python console session", + "pytb" => "Python Traceback", + "python" => "Python", + "raw" => "Raw token data", + "rb" => "Ruby", + "rbcon" => "Ruby irb session", + "redcode" => "Redcode", + "rhtml" => "RHTML", + "rst" => "reStructuredText", + "scheme" => "Scheme", + "smarty" => "Smarty", + "sourceslist" => "Debian Sourcelist", + "sql" => "SQL", + "squidconf" => "SquidConf", + "tex" => "TeX", + "text" => "Text only", + "trac-wiki" => "MoinMoin/Trac Wiki markup", + "vb.net" => "VB.net", + "vim" => "VimL", + "xml" => "XML", + "xml+django" => "XML+Django/Jinja", + "xml+erb" => "XML+Ruby", + "xml+mako" => "XML+Mako", + "xml+myghty" => "XML+Myghty", + "XML+PHP" => "XML+PHP", + "XML+SMARTY" => "XML+Smarty", }; sub uri { "http://paste.ubuntu.com/" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/lib/App/Nopaste.pm new/App-Nopaste-0.92/lib/App/Nopaste.pm --- old/App-Nopaste-0.35/lib/App/Nopaste.pm 2012-07-17 21:35:00.000000000 +0200 +++ new/App-Nopaste-0.92/lib/App/Nopaste.pm 2013-04-26 17:04:28.000000000 +0200 @@ -8,7 +8,7 @@ use base 'Exporter'; our @EXPORT_OK = 'nopaste'; -our $VERSION = '0.35'; +our $VERSION = '0.92'; sub nopaste { # process arguments diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/t/001-subclass_cmd.t new/App-Nopaste-0.92/t/001-subclass_cmd.t --- old/App-Nopaste-0.35/t/001-subclass_cmd.t 2012-07-14 16:39:21.000000000 +0200 +++ new/App-Nopaste-0.92/t/001-subclass_cmd.t 2012-10-30 18:56:40.000000000 +0100 @@ -4,8 +4,7 @@ { package App::Nopaste::Service::_MyTest; - use Moose; - extends 'App::Nopaste::Service'; + use base 'App::Nopaste::Service'; sub available { 1 } sub uri { 'test' } @@ -18,16 +17,9 @@ { package _MyTest::Cmd; - use Moose; - extends 'App::Nopaste::Command'; + use base 'App::Nopaste::Command'; - has text => ( - is => 'rw', - isa => 'Str', - default => 'test', - ); - - sub read_text {} + sub read_text { 'test' } } my $input = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.35/t/002-encoding.t new/App-Nopaste-0.92/t/002-encoding.t --- old/App-Nopaste-0.35/t/002-encoding.t 1970-01-01 01:00:00.000000000 +0100 +++ new/App-Nopaste-0.92/t/002-encoding.t 2013-03-16 01:31:42.000000000 +0100 @@ -0,0 +1,131 @@ +use strict; +use warnings; +use Test::More; + +my @content = ( + <<FORM, +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> + <head> + <title>pasting to magnet_web</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + </head> + <body> + <table> + <tr> + <td> + <img src="http://paste.scsys.co.uk/static/nopaste.gif" alt="POE Paste with lovely alien head..."> + </td> + <td align="left"> + <h1><font face="courier new">No paste!</font></h1> + <font face="courier new" size="-1"> + 1. Select the channel for the URL announcment.<br> + 2. Supply a nick for the announcement.<br> + 3. Supply an summary of the paste for the announcement<br> + 4. <b>Paste!</b><br> + 5. Submit the form with the Paste it! button.<br> + </font> + </td> + </tr> + </table> + <form method='post' action='http://paste.scsys.co.uk/paste' enctype='application/x-www-from-urlencoded' name="pasteForm"> + <font face="courier new" size="-1"><br><br> + 1. channel: <select name='channel'><option value="" selected>(none)</option> <option value="#angerwhale">#angerwhale</option> <option value="#axkit-dahut">#axkit-dahut</option> <option value="#catalyst">#catalyst</option> <option value="#catalyst-dev">#catalyst-dev</option> <option value="#cometd">#cometd</option> <option value="#dbix-class">#dbix-class</option> <option value="#distzilla">#distzilla</option> <option value="#formhandler">#formhandler</option> <option value="#handel">#handel</option> <option value="#iusethis">#iusethis</option> <option value="#killtrac">#killtrac</option> <option value="#london.pm">#london.pm</option> <option value="#miltonkeynes.pm">#miltonkeynes.pm</option> <option value="#moose">#moose</option> <option value="#p5p">#p5p</option> <option value="#padre">#padre</option> <option value="#pdl">#pdl</option> <option value="#perl">#perl</option> <option value="#perl-help">#perl-help</option> <option value="#perlde">#perlde</option> <option value="#pita">#pita</option> <option value="#poe">#poe</option> <option value="#reaction">#reaction</option> <option value="#rt">#rt</option> <option value="#soap-lite">#soap-lite</option> <option value="#spb.pm">#spb.pm</option> <option value="#tt">#tt</option> <option value="#web-simple">#web-simple</option></select> + 2. your nick: <input type='text' name='nick' size='25' maxlength='25'><br><br> + 3. summary: <input type='text' name='summary' size='80' maxlength='160'><br><br> + 4. paste: <textarea name='paste' rows=25 cols=75 style='width:100%'></textarea><br><br> + 5. <input type='submit' name='Paste it' value='Paste it'><input type='reset' name='Clear form' value='Clear form'> + </font> + </form><br> + <div align="right"> + <a href="http://validator.w3.org/check/referer"><img border="0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" height="31" width="88"></a><br><br> + </div> + <div> + <div align=right><font size='-1'><a href='http://sf.net/projects/pastebot/'>Pastebot</a> is powered by <a href='http://poe.perl.org/'>POE</a>.</font></div> + </div> + <!-- Automatically put the clipboard contents into the paste field and select it. --> + <script language="jscript" type=""> + onload=function () { + try { + document.pasteForm.paste.value=clipboardData.getData("Text") || ""; + document.pasteForm.paste.select(); + } + catch (oErr) {} + } + </script> + </body> +</html> +FORM + <<RETURN, +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> + <head> + <title>Your paste, number 211360...</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <meta http-equiv="refresh" content="5;url=http://paste.scsys.co.uk/211360"> + </head> + <body> + + <p> + This content is stored as + <a href='http://paste.scsys.co.uk/211360'>http://paste.scsys.co.uk/211360</a>. You will be redirected + shortly. + </p> + <p> + From: Someone at 217.168.150.38 + <br> + Summary: ‘test’ + </p> + <p> + <pre>‘test’</pre> + </p> + <p> + <div align=right><font size='-1'><a href='http://sf.net/projects/pastebot/'>Pastebot</a> is powered by <a href='http://poe.perl.org/'>POE</a>.</font></div> + </p> + </body> +</html> +RETURN +); + +my @requests; +{ + package LWP::Protocol::test; + use base 'LWP::Protocol'; + sub request { + my $self = shift; + my ($req) = @_; + push @requests, $req; + return HTTP::Response->new(200, 'OK', [], shift @content); + } +} +LWP::Protocol::implementor('http' => 'LWP::Protocol::test'); + +{ + package App::Nopaste::Service::MyTest; + use base 'App::Nopaste::Service'; + + sub uri { 'http://localhost/' } +} + +{ + package MyTest::Cmd; + use base 'App::Nopaste::Command'; + + sub read_text { '‘test’' } +} + +my $input = { + nick => '', + services => ['App::Nopaste::Service::MyTest'], + extra_argv => [] +}; + +my $cmd = MyTest::Cmd->new($input); +isa_ok($cmd,'App::Nopaste::Command'); + +my $ret = $cmd->run; +is($ret, 'http://paste.scsys.co.uk/211360'); +my ($post) = grep { $_->method eq 'POST' } @requests; +is($post->content, 'channel=&nick=&summary=&paste=%E2%80%98test%E2%80%99&private=0'); + +done_testing; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
