r63376 - in /trunk/libsocialtext-resting-perl: Changes MANIFEST META.yml Makefile.PL bin/st-webhook debian/changelog debian/copyright debian/source/ debian/source/format lib/Socialtext/Resting.pm

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Oct 5 01:35:30 UTC 2010


Author: jawnsy-guest
Date: Tue Oct  5 01:35:18 2010
New Revision: 63376

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63376
Log:
* Use new 3.0 (quilt) source format
* Update copyright information
* Update copyright to DEP5 format

Added:
    trunk/libsocialtext-resting-perl/bin/st-webhook
      - copied unchanged from r63374, branches/upstream/libsocialtext-resting-perl/current/bin/st-webhook
    trunk/libsocialtext-resting-perl/debian/source/
    trunk/libsocialtext-resting-perl/debian/source/format
Modified:
    trunk/libsocialtext-resting-perl/Changes
    trunk/libsocialtext-resting-perl/MANIFEST
    trunk/libsocialtext-resting-perl/META.yml
    trunk/libsocialtext-resting-perl/Makefile.PL
    trunk/libsocialtext-resting-perl/debian/changelog
    trunk/libsocialtext-resting-perl/debian/copyright
    trunk/libsocialtext-resting-perl/lib/Socialtext/Resting.pm

Modified: trunk/libsocialtext-resting-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocialtext-resting-perl/Changes?rev=63376&op=diff
==============================================================================
--- trunk/libsocialtext-resting-perl/Changes (original)
+++ trunk/libsocialtext-resting-perl/Changes Tue Oct  5 01:35:18 2010
@@ -1,3 +1,18 @@
+0.34 - Fri Jul 16 09:35:49 PDT 2010
+ - Include st-webhook in the MANIFEST. Doh.
+
+0.33 - Wed Jul 14 15:14:40 PDT 2010
+ - Make sure to install st-webhook
+
+0.32 - Wed Jul 14 12:43:34 PDT 2010
+ - Use a more correct HTTP verb (POST) when creating a webhook.
+
+0.31 - Wed Jul 14 11:32:33 PDT 2010
+ - Add support for sending signals in reply to another signal.
+ - Add support for sending signals with annotations.
+ - Add "on_behalf_of" to set header for "X-On-Behalf-Of". (not docced yet)
+ - Add `st-webhook` tool to create/list/delete webhooks
+
 0.30 - Thu Feb  4 10:19:42 PST 2010
  - Add group and account ids to post_signal()
  - Doc that get_signals() accepts query parameters (such as group & account

Modified: trunk/libsocialtext-resting-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocialtext-resting-perl/MANIFEST?rev=63376&op=diff
==============================================================================
--- trunk/libsocialtext-resting-perl/MANIFEST (original)
+++ trunk/libsocialtext-resting-perl/MANIFEST Tue Oct  5 01:35:18 2010
@@ -1,4 +1,5 @@
 bin/strut
+bin/st-webhook
 lib/Socialtext/Resting.pm
 Makefile.PL
 MANIFEST			This list of files

Modified: trunk/libsocialtext-resting-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocialtext-resting-perl/META.yml?rev=63376&op=diff
==============================================================================
--- trunk/libsocialtext-resting-perl/META.yml (original)
+++ trunk/libsocialtext-resting-perl/META.yml Tue Oct  5 01:35:18 2010
@@ -1,23 +1,31 @@
 --- #YAML:1.0
-name:                Socialtext-Resting
-version:             0.30
-abstract:            Simple tool to use Socialtext RESTful API
-license:             ~
-author:              
+name:               Socialtext-Resting
+version:            0.34
+abstract:           Simple tool to use Socialtext RESTful API
+author:
     - Chris Dent <chris.dent at socialtext.com>, Kirsten Jones <kirsten.jones at socialtext.com>
-generated_by:        ExtUtils::MakeMaker version 6.44
-distribution_type:   module
-requires:     
-    App::Options:                  0
-    Class::Field:                  0
-    HTTP::Request:                 0
-    IPC::Run:                      0
-    JSON::XS:                      2.1
-    LWP::UserAgent:                0
-    Pod::Usage:                    0
-    Readonly:                      0
-    Test::Mock::LWP:               0.05
-    URI::Escape:                   1.31
+license:            unknown
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
+requires:
+    App::Options:     0
+    Class::Field:     0
+    HTTP::Request:    0
+    IPC::Run:         0
+    JSON::XS:         2.1
+    LWP::UserAgent:   0
+    Pod::Usage:       0
+    Readonly:         0
+    Test::Mock::LWP:  0.05
+    URI::Escape:      1.31
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.56
 meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
-    version: 1.3
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: trunk/libsocialtext-resting-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocialtext-resting-perl/Makefile.PL?rev=63376&op=diff
==============================================================================
--- trunk/libsocialtext-resting-perl/Makefile.PL (original)
+++ trunk/libsocialtext-resting-perl/Makefile.PL Tue Oct  5 01:35:18 2010
@@ -9,7 +9,7 @@
     'VERSION_FROM' => 'lib/Socialtext/Resting.pm',
     'PREREQ_PRINT' => 1,
     'EXE_FILES'    => [
-        'bin/strut',
+        'bin/strut', 'bin/st-webhook',
     ],
     'PREREQ_PM' => {
         'URI::Escape'     => 1.31,

Modified: trunk/libsocialtext-resting-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocialtext-resting-perl/debian/changelog?rev=63376&op=diff
==============================================================================
--- trunk/libsocialtext-resting-perl/debian/changelog (original)
+++ trunk/libsocialtext-resting-perl/debian/changelog Tue Oct  5 01:35:18 2010
@@ -1,4 +1,4 @@
-libsocialtext-resting-perl (0.30-1) UNRELEASED; urgency=low
+libsocialtext-resting-perl (0.34-1) UNRELEASED; urgency=low
 
   TODO: probably thousands of this message-
   Called UNIVERSAL::isa() as a function, not a method at /usr/share/perl/5.10/Test/More.pm line 1000
@@ -11,9 +11,11 @@
 
   [ Jonathan Yu ]
   * New upstream release
-  * New upstream release
+  * Use new 3.0 (quilt) source format
+  * Update copyright information
+  * Update copyright to DEP5 format
 
- -- Jonathan Yu <jawnsy at cpan.org>  Fri, 05 Feb 2010 13:53:19 -0500
+ -- Jonathan Yu <jawnsy at cpan.org>  Mon, 04 Oct 2010 21:46:49 -0400
 
 libsocialtext-resting-perl (0.28-1) unstable; urgency=low
 

Modified: trunk/libsocialtext-resting-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocialtext-resting-perl/debian/copyright?rev=63376&op=diff
==============================================================================
--- trunk/libsocialtext-resting-perl/debian/copyright (original)
+++ trunk/libsocialtext-resting-perl/debian/copyright Tue Oct  5 01:35:18 2010
@@ -1,31 +1,31 @@
-Format-Specification:
-    http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
-Upstream-Maintainer: Luke Closs <luke.closs at socialtext.com>
-Upstream-Source: http://search.cpan.org/dist/Socialtext-Resting/
-Upstream-Name: Socialtext-Resting
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Maintainer: Luke Closs <luke.closs at socialtext.com>
+Source: http://search.cpan.org/dist/Socialtext-Resting/
+Name: Socialtext-Resting
 
 Files: *
 Copyright: 2006, Socialtext <http://www.socialtext.com/>
-License-Alias: Perl
-License: Artistic | GPL-1+
+License: Artistic or GPL-1+
 
 Files: debian/*
-Copyright: 2009, Jonathan Yu <jawnsy at cpan.org>
+Copyright: 2009-2010, Jonathan Yu <jawnsy at cpan.org>
+ 2007-2009, Christoph Berg <myon at debian.org>
  2009, Ryan Niebur <ryan at debian.org>
  2009, gregor herrmann <gregoa at debian.org>
- 2007, 2009, Christoph Berg <myon at debian.org>
-License: Artistic | GPL-1+
+License: Artistic or GPL-1+
 
 License: Artistic
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Artistic License, which comes with Perl.
-    On Debian GNU/Linux systems, the complete text of the Artistic License
-    can be found in `/usr/share/common-licenses/Artistic'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the Artistic License, which comes with Perl.
+ .
+ On Debian systems, the complete text of the Artistic License can be
+ found in `/usr/share/common-licenses/Artistic'.
 
 License: GPL-1+
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 1, or (at your option)
-    any later version.
-    On Debian GNU/Linux systems, the complete text of the GNU General
-    Public License can be found in `/usr/share/common-licenses/GPL'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ .
+ On Debian systems, the complete text of the GNU General Public
+ License can be found in `/usr/share/common-licenses/GPL-1'.

Added: trunk/libsocialtext-resting-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocialtext-resting-perl/debian/source/format?rev=63376&op=file
==============================================================================
--- trunk/libsocialtext-resting-perl/debian/source/format (added)
+++ trunk/libsocialtext-resting-perl/debian/source/format Tue Oct  5 01:35:18 2010
@@ -1,0 +1,1 @@
+3.0 (quilt)

Modified: trunk/libsocialtext-resting-perl/lib/Socialtext/Resting.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocialtext-resting-perl/lib/Socialtext/Resting.pm?rev=63376&op=diff
==============================================================================
--- trunk/libsocialtext-resting-perl/lib/Socialtext/Resting.pm (original)
+++ trunk/libsocialtext-resting-perl/lib/Socialtext/Resting.pm Tue Oct  5 01:35:18 2010
@@ -11,7 +11,7 @@
 
 use Readonly;
 
-our $VERSION = '0.30';
+our $VERSION = '0.34';
 
 =head1 NAME
 
@@ -72,6 +72,7 @@
     profile_photo        => $BASE_URI . '/people/:pname/photo',
     signals              => $BASE_URI . '/signals',
     webhooks             => $BASE_URI . '/webhooks',
+    webhook              => $BASE_URI . '/webhooks/:id',
 );
 
 field 'workspace';
@@ -91,6 +92,7 @@
 field 'json_verbose';
 field 'cookie';
 field 'agent_string';
+field 'on_behalf_of';
 
 =head2 new
 
@@ -1113,10 +1115,17 @@
     $Rester->post_signal('O HAI', group_ids => [2,3,4]);
     $Rester->post_signal('O HAI', account_id => 42);
     $Rester->post_signal('O HAI', account_ids => [2,3,4]);
+    $Rester->post_signal('O HAI', in_reply_to_id => 142);
 
 Posts a signal.
 
 Optional C<account_ids> and C<group_ids> arguments for targetting the signal.
+
+Optional C<in_reply_to_id> for specifying a signal_id this signal is in reply to.
+
+Optional C<annotations> to annotate the signal. C<annotations> should be an array
+ref containing hashrefs that have one key (the annotation type) and a value that is
+a hashref containing key/value pairs.
 
 =cut
 
@@ -1131,6 +1140,11 @@
         my @ids = @{ $args{$k.'s'} || [] };
         push @ids, $args{$k} if $args{$k}; # must be non-zero
         $sig{$k.'s'} = \@ids if @ids;
+    }
+
+    for my $k (qw(in_reply_to annotations attachments)) {
+        next unless exists $args{$k};
+        $sig{$k} = $args{$k};
     }
 
     my $uri = $self->_make_uri('signals');
@@ -1152,31 +1166,81 @@
     }
 }
 
-=head2 put_webhook
-
-    $Rester->put_webhook( %args )
+=head2 post_webhook
+
+    $Rester->post_webhook( %args )
 
 Creates a webhook.  Args will be encoded as JSON and put up.
 
 =cut
 
-sub put_webhook {
+sub post_webhook {
     my $self = shift;
     my %args = @_;
 
     my $uri = $self->_make_uri('webhooks');
     my ( $status, $content, $response ) = $self->_request(
         uri     => $uri,
-        method  => 'PUT',
+        method  => 'POST',
         type    => "application/json",
         content => encode_json( \%args ),
     );
 
-    my $location = $response->header('location');
-    $location = URI::Escape::uri_unescape($1);
-
     if ( $status == 204 || $status == 201 ) {
-        return $location;
+        return $response->header('Location');
+    }
+    else {
+        die "$status: $content\n";
+    }
+}
+
+=head2 get_webhooks
+
+    my $hooks = $Rester->get_webhooks();
+
+Returns an arrayref containing hashrefs of each webhook on the server.
+
+=cut
+
+sub get_webhooks {
+    my $self = shift;
+
+    my $uri = $self->_make_uri('webhooks');
+    my ( $status, $content, $response ) = $self->_request(
+        uri     => $uri,
+        method  => 'GET',
+        type    => "application/json",
+    );
+
+    if ( $status == 200 ) {
+        return decode_json($content);
+    }
+    else {
+        die "$status: $content\n";
+    }
+}
+
+=head2 delete_webhook
+
+    $Rester->delete_webhook( id => $webhook_id );
+
+Deletes the specified webhook.
+
+=cut
+
+sub delete_webhook {
+    my $self = shift;
+    my %args = @_;
+    die "id is mandatory" unless $args{id};
+
+    my $uri = $self->_make_uri('webhook', {id => $args{id}});
+    my ( $status, $content, $response ) = $self->_request(
+        uri     => $uri,
+        method  => 'DELETE',
+    );
+
+    if ( $status == 204 ) {
+        return;
     }
     else {
         die "$status: $content\n";
@@ -1202,6 +1266,8 @@
     $request->header( 'Accept'       => $p{accept} )   if $p{accept};
     $request->header( 'Content-Type' => $p{type} )     if $p{type};
     $request->header( 'If-Match'     => $p{if_match} ) if $p{if_match};
+    $request->header( 'X-On-Behalf-Of' => $self->on_behalf_of ) if $self->on_behalf_of;
+
     if ($p{method} eq 'PUT') {
         my $content_len = 0;
         $content_len = do { use bytes; length $p{content} } if $p{content};




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