Skip to content

Commit

Permalink
Implement the PATCH HTTP verb
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Axel 'fREW' Schmidt committed Feb 24, 2014
1 parent 080a412 commit 0a286dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Revision history for {{$dist->name}}

{{$NEXT}}
- Implement the PATCH HTTP verb (thanks @mdi for GH#6)

2.001006 2013-08-14 21:09:39 CST6CDT
- Fix tests in Win32 (on the off chance they have curl installed)
Expand Down
1 change: 1 addition & 0 deletions adenosine-exports
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ function POST() { adenosine POST "$@" }
function PUT() { adenosine PUT "$@" }
function DELETE() { adenosine DELETE "$@" }
function TRACE() { adenosine TRACE "$@" }
function PATCH() { adenosine PATCH "$@" }

export PATH="$PATH:$(cd $(dirname $0) && pwd)/bin"
5 changes: 3 additions & 2 deletions lib/App/Adenosine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use Text::ParseWords;
use Scalar::Util 'blessed';
use Module::Runtime 'use_module';

our $verb_regex = '(?:HEAD|OPTIONS|GET|DELETE|PUT|POST|TRACE)';
our $verb_regex = '(?:HEAD|OPTIONS|GET|DELETE|PUT|POST|TRACE|PATCH)';

sub verbose { $_[0]->{verbose} }
sub plugins { @{$_[0]->{plugins}} }
Expand Down Expand Up @@ -86,7 +86,7 @@ sub new {

my @extra = (@ARGV, $self->_get_extra_options);
my $wantdata;
$wantdata = 1 if $action =~ m/^(?:PUT|POST|TRACE)$/;
$wantdata = 1 if $action =~ m/^(?:PUT|POST|TRACE|PATCH)$/;
if ($wantdata && $interactive_edit) {
require File::Temp;
my ($fh, $fn) = File::Temp::tempfile();
Expand Down Expand Up @@ -130,6 +130,7 @@ function POST() { adenosine POST "$@"; };
function PUT() { adenosine PUT "$@"; };
function DELETE() { adenosine DELETE "$@"; };
function TRACE() { adenosine TRACE "$@"; };
function PATCH() { adenosine TRACE "$@"; };
SHELL
} else {
my $uri_base = $self->uri_base($action);
Expand Down

0 comments on commit 0a286dc

Please sign in to comment.