Permalink
Browse files

include perl instructions for function wrappers

  • Loading branch information...
1 parent 5825b07 commit bc62691c22fc6d4c483a498d54e8b573c3262095 @frioux committed Nov 23, 2012
Showing with 30 additions and 28 deletions.
  1. +7 −27 adenosine-exports
  2. +13 −1 bin/adenosine
  3. +10 −0 lib/App/Adenosine.pm
View
@@ -1,29 +1,9 @@
-function HEAD() {
- adenosine HEAD "$@"
-}
-
-function OPTIONS() {
- adenosine OPTIONS "$@"
-}
-
-function GET() {
- adenosine GET "$@"
-}
-
-function POST() {
- adenosine POST "$@"
-}
-
-function PUT() {
- adenosine PUT "$@"
-}
-
-function DELETE() {
- adenosine DELETE "$@"
-}
-
-function TRACE() {
- adenosine TRACE "$@"
-}
+function HEAD() { adenosine HEAD "$@" }
+function OPTIONS() { adenosine OPTIONS "$@" }
+function GET() { adenosine GET "$@" }
+function POST() { adenosine POST "$@" }
+function PUT() { adenosine PUT "$@" }
+function DELETE() { adenosine DELETE "$@" }
+function TRACE() { adenosine TRACE "$@" }
export PATH="$PATH:$(cd $(dirname $0) && pwd)/bin"
View
@@ -49,7 +49,9 @@ L<Here is a nice screencast showing adenosine (née resty) in action|http://jpme
=head1 Quick Start
-You have C<git>, right? Okay.
+=head2 From git
+
+Grab the files from github:
$ git clone http://github.com/frioux/app-adenosine-prefab
@@ -58,6 +60,16 @@ file if you want.)
$ . app-adenosine-prefab/adenosine-exports
+=head2 From CPAN
+
+If you are a Perl user you can install adenosine from CPAN as follows:
+
+ $ cpanm App::Adenosine
+
+And then source the function wrappers as follows:
+
+ $ eval $(adenosine exports)
+
Set the REST host to which you will be making your requests (you can do this
whenever you want to change hosts, anytime).
View
@@ -107,6 +107,16 @@ sub new {
my ($out, $err, $ret) = $self->capture_curl(@curl);
return $self->handle_curl_output($out, $err, $ret);
+ } elsif ($action eq 'exports') {
+ print <<'SHELL';
+function HEAD() { adenosine HEAD "$@" };
+function OPTIONS() { adenosine OPTIONS "$@" };
+function GET() { adenosine GET "$@" };
+function POST() { adenosine POST "$@" };
+function PUT() { adenosine PUT "$@" };
+function DELETE() { adenosine DELETE "$@" };
+function TRACE() { adenosine TRACE "$@" };
+SHELL
} else {
my $uri_base = $self->uri_base($action);
$self->_set_extra_options(@ARGV);

0 comments on commit bc62691

Please sign in to comment.