r59162 - in /branches/upstream/libapp-nopaste-perl/current: Changes MANIFEST META.yml lib/App/Nopaste.pm lib/App/Nopaste/Service/SSH.pm lib/App/Nopaste/Service/ssh.pm

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Fri Jun 11 05:18:33 UTC 2010


Author: carnil-guest
Date: Fri Jun 11 05:18:25 2010
New Revision: 59162

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59162
Log:
[svn-upgrade] new version libapp-nopaste-perl (0.22)

Added:
    branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/ssh.pm   (with props)
Removed:
    branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/SSH.pm
Modified:
    branches/upstream/libapp-nopaste-perl/current/Changes
    branches/upstream/libapp-nopaste-perl/current/MANIFEST
    branches/upstream/libapp-nopaste-perl/current/META.yml
    branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm

Modified: branches/upstream/libapp-nopaste-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/Changes?rev=59162&op=diff
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/Changes (original)
+++ branches/upstream/libapp-nopaste-perl/current/Changes Fri Jun 11 05:18:25 2010
@@ -1,4 +1,8 @@
 Revision history for App-Nopaste
+
+0.22    Thu Jun 10 12:58:99 2010
+        Add NOPASTE_SSH_MODE for chmod'ing after uploading (Thomas Sibley)
+        Doc fixes (Thomas Sibley)
 
 0.21    Sat May  1 09:32:10 2010
         Add a --list_services/-L option (David Bremner) [rt.cpan.org #55562]

Modified: branches/upstream/libapp-nopaste-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/MANIFEST?rev=59162&op=diff
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/MANIFEST (original)
+++ branches/upstream/libapp-nopaste-perl/current/MANIFEST Fri Jun 11 05:18:25 2010
@@ -25,7 +25,7 @@
 lib/App/Nopaste/Service/Pastie.pm
 lib/App/Nopaste/Service/Shadowcat.pm
 lib/App/Nopaste/Service/Snitch.pm
-lib/App/Nopaste/Service/SSH.pm
+lib/App/Nopaste/Service/ssh.pm
 Makefile.PL
 MANIFEST			This list of files
 META.yml

Modified: branches/upstream/libapp-nopaste-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/META.yml?rev=59162&op=diff
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/META.yml (original)
+++ branches/upstream/libapp-nopaste-perl/current/META.yml Fri Jun 11 05:18:25 2010
@@ -27,4 +27,4 @@
   homepage: http://github.com/sartak/app-nopaste/tree
   license: http://dev.perl.org/licenses/
   repository: git://github.com/sartak/app-nopaste.git
-version: 0.21
+version: 0.22

Modified: branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm?rev=59162&op=diff
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm (original)
+++ branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm Fri Jun 11 05:18:25 2010
@@ -7,7 +7,7 @@
 use base 'Exporter';
 our @EXPORT_OK = 'nopaste';
 
-our $VERSION = '0.21';
+our $VERSION = '0.22';
 
 sub nopaste {
     # process arguments {{{

Added: branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/ssh.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/ssh.pm?rev=59162&op=file
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/ssh.pm (added)
+++ branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/ssh.pm Fri Jun 11 05:18:25 2010
@@ -1,0 +1,68 @@
+package App::Nopaste::Service::ssh;
+use strict;
+use warnings;
+use base 'App::Nopaste::Service';
+use File::Temp;
+use File::Spec;
+use POSIX qw(strftime);
+
+sub run {
+    my ($self, %args) = @_;
+
+    my $server = $ENV{NOPASTE_SSH_SERVER} || return (0,"No NOPASTE_SSH_SERVER set");
+    my $docroot = $ENV{NOPASTE_SSH_DOCROOT} || return (0, "No NOPASTE_SSH_DOCROOT set");
+    my $topurl = $ENV{NOPASTE_SSH_WEBPATH} || "http://$server";
+    my $mode = $ENV{NOPASTE_SSH_MODE} || undef;
+
+    my $date = strftime("%Y-%m-%d",localtime());
+    my $tmp = File::Temp->new( TEMPLATE => "${date}XXXXXXXX", CLEANUP => 1 );
+    my $filename = $tmp->filename;
+    print $tmp $args{text} || return (0, "Can't write to tempfile $filename");
+    close $tmp || return (0, "Can't write to tempfile $filename");
+
+    chmod oct($mode), $filename
+        if defined $mode;
+
+    system('scp', '-q', $filename, "$server:$docroot");
+
+    my ($volume, $dir, $file) = File::Spec->splitpath($filename);
+    return (1, "$topurl/$file");
+
+}
+
+1;
+
+=head1 NAME
+
+App::Nopaste::Service::ssh - copies files to your server using scp
+
+=head1 AUTHOR
+
+Kevin Falcone << <falcone at cpan.org> >>
+
+=head1 ENVIRONMENT VARIABLES
+
+=over 4
+
+=item NOPASTE_SSH_SERVER
+
+The hostname to which you ssh. The left-hand side of the colon in the scp.
+Something like C<sartak.org>.
+
+=item NOPASTE_SSH_DOCROOT
+
+The path on disk for your pastes. Something like C<public_html/paste>.
+
+=item NOPASTE_SSH_WEBPATH
+
+The path for URLs. Something like C<http://sartak.org/paste>.
+
+=item NOPASTE_SSH_MODE
+
+Octal permissions mode to set for the temporary file before uploading.
+Something like C<0644>. 
+
+=back
+
+=cut
+

Propchange: branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/ssh.pm
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-perl-cvs-commits mailing list