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 - coolo@suse.com
+
+- 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