Skip to content

Commit

Permalink
Release 1.00
Browse files Browse the repository at this point in the history
Bump version to 1.00
Update Pod
  • Loading branch information
jadeallenx committed Dec 31, 2011
1 parent 2990dfa commit 2a8e99d
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 39 deletions.
3 changes: 3 additions & 0 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ my $builder = Module::Build->new(
license => 'perl',
dist_author => q{Mark Allen <mrallen1@yahoo.com>},
dist_version_from => 'lib/Net/API/Gett.pm',
configure_requires => {
'Module::Build' => 0.38,
},
build_requires => {
'Test::More' => 0,
},
Expand Down
59 changes: 44 additions & 15 deletions lib/Net/API/Gett.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Net::API::Gett - Perl bindings for Ge.tt API
=head1 VERSION
Version 0.02
Version 1.00
=cut

our $VERSION = '0.02';
our $VERSION = '1.00';

=head1 SYNOPSIS
Expand Down Expand Up @@ -71,6 +71,13 @@ share up to 2 GB of files for free. They recently implemented a REST API; this
binding for the API. See L<http://ge.tt/developers> for full details and how to get an
API key.
=head1 CHANGES FROM PREVIOUS VERSION
This library is more encapsulated. Share functions which act on shares are in the L<Net::API::Gett::Share>
object namespace, and likewise with Ge.tt L<files|Net::API::Gett:File>. Future versions of this library
will modify the L<Request|Net::API::Gett::Request> and L<User|Net::API::Gett::User> objects to be
L<roles|Moo::Role> rather than objects.
=cut

sub BUILD {
Expand All @@ -88,9 +95,6 @@ sub BUILD {

=head1 ATTRIBUTES
If attributes are read‐write mutators, they behave in a Perl‐ish way:
pass values to set them, pass no arguments to get current values.
=over
=item user
Expand Down Expand Up @@ -133,6 +137,26 @@ errors.
=over
=item new()
Constructs a new object. Optionally accepts:
=over
=item * A Ge.tt API key, email, and password, or,
=item * A Ge.tt refresh token, or,
=item * A Ge.tt access token
=back
If any of these parameters are passed, they will be proxied into the L<Net::API::Gett::User> object which
will then permit you to make authenticated API calls. Without an access token (or the means to acquire one)
only non-authenticated calls are allowed; they are: C<get_share()>, C<get_file()> and C<$file->contents()>.
=back
=head2 Share functions
All of these functions cache L<Net::API::Gett::Share> objects. Retrieve objects from the
Expand Down Expand Up @@ -291,6 +315,10 @@ This method uploads a file to Gett. The following key/value pairs are valid:
=over
=item * filename (B<required>)
What to call the uploaded file when it's inside of the Gett service.
=item * sharename (optional)
If not specified, a new share will be automatically created.
Expand All @@ -299,27 +327,28 @@ If not specified, a new share will be automatically created.
If specified, this value is used when creating a new share to hold the file.
=item * filename (required)
What to call the uploaded file when it's inside of the Gett service.
=item * content (optional)
A synonym for C<contents>. (Yes, I've typo'd this too many times.) Anything in C<contents> has
precedent, though.
=item * content (optional)
=item * contents (optional)
A representation of the file's contents. This can be one of:
=over
=item A buffer
=item * A buffer
=item An L<IO::Handle> object
=item * An L<IO::Handle> object
=item A FILEGLOB
=item * A FILEGLOB
=item A pathname to a file to be read
=item * A pathname to a file to be read
=back
If not specified, the filename parameter is used as a pathname.
If not specified, the C<filename> parameter is treated as a pathname.
=item * encoding
Expand Down Expand Up @@ -476,7 +505,7 @@ sub shares {

=head1 AUTHOR
Mark Allen, C<mrallen1 at yahoo dot com>
Mark Allen, C<< <mrallen1 at yahoo dot com> >>
=head1 BUGS
Expand Down
26 changes: 13 additions & 13 deletions lib/Net/API/Gett/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use Carp qw(croak);
use File::Slurp qw(read_file);
use MooX::Types::MooseLike qw(Int Str);

our $VERSION = '0.02';
our $VERSION = '1.00';

=head1 PURPOSE
Expand Down Expand Up @@ -166,26 +166,26 @@ has 'request' => (
lazy => 1,
);

=head1 METHODS
=over
=item send_file()
This method actually uploads the file to the Gett service. This method is normally invoked by the
C<upload_file()> method, but it's a public method which might be useful in combination with
C<get_upload_url()>. It takes the following parameters:
C<upload_file()> method, but it might be useful in combination with C<get_upload_url()>. It takes
the following parameters:
=over
=item *
a PUT based Gett upload url
=item * a Gett put upload url
=item *
=item * data
a scalar representing the file contents which can be one of: a buffer, an L<IO::Handle> object, a FILEGLOB, or a
file pathname.
=item *
=item * encoding
an encoding scheme. By default, it uses C<:raw> (see C<perldoc -f binmode> for more information.)
Expand Down Expand Up @@ -251,9 +251,9 @@ sub get_upload_url {

=over
=item destroy_file()
=item destroy()
This method destroys a file specified by the given sharename/fileid parameters. Returns a true value.
This method destroys the file represented by the object. Returns a true value on success.
=back
Expand Down Expand Up @@ -299,7 +299,7 @@ sub _file_contents {
=item contents()
This method retrieves the contents of a this file in the Gett service. You are responsible for
outputting the file (if desired) with any appropriate encoding.
outputting the file (if desired) with any appropriate encoding. Does not require an access token.
=back
Expand All @@ -317,8 +317,8 @@ sub contents {
=item thumbnail()
This method returns a thumbnail if the file in Gett is an image. Requires a
sharename and fileid.
This method returns a thumbnail if the file in Gett is an image. Does not require an access token, but
is really only meaningful if the data is a valid image format file.
=back
Expand Down
2 changes: 1 addition & 1 deletion lib/Net/API/Gett/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use JSON;
use LWP::UserAgent;
use HTTP::Request::Common;

our $VERSION = '0.02';
our $VERSION = '1.00';

=head1 NAME
Expand Down
6 changes: 4 additions & 2 deletions lib/Net/API/Gett/Share.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Net::API::Gett::Share - Gett share object
=cut

use Moo;
use Sub::Quote;
use Carp qw(croak);
use Array::Iterator;
use MooX::Types::MooseLike qw(Int Str);

our $VERSION = '0.02';
our $VERSION = '1.00';

=head1 PURPOSE
Expand Down Expand Up @@ -81,6 +81,7 @@ C<get_file_iterator()> below.

has 'sharename' => (
is => 'ro',
isa => Str,
);

has 'title' => (
Expand All @@ -89,6 +90,7 @@ has 'title' => (

has 'created' => (
is => 'ro',
isa => Int,
);

sub files {
Expand Down
14 changes: 6 additions & 8 deletions lib/Net/API/Gett/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package Net::API::Gett::User;
use Moo;
use Sub::Quote;
use Carp qw(croak);
use Scalar::Util qw(looks_like_number);
use MooX::Types::MooseLike qw(Str Int);

use Net::API::Gett::Request;

our $VERSION = '0.02';
our $VERSION = '1.00';

=head1 NAME
Expand All @@ -21,14 +20,13 @@ this class on its own as the library will create and return this object when app
=head1 ATTRIBUTES
Here are the attributes of this class. If they are read-write mutators, they behave in
a Perl-ish way: pass values to set them, pass no arguments to get current values.
Here are the attributes of this class. They are read only.
=over
=item api_key
Scalar string. Read-only. C<has_api_key> predicate.
Scalar string. C<has_api_key> predicate.
=back
Expand All @@ -44,7 +42,7 @@ has 'api_key' => (
=item email
Scalar string. Read-only. C<has_email> predicate.
Scalar string. C<has_email> predicate.
=back
Expand All @@ -60,7 +58,7 @@ has 'email' => (
=item password
Scalar string. Read-only. C<has_password> predicate.
Scalar string. C<has_password> predicate.
=back
Expand Down Expand Up @@ -194,7 +192,7 @@ has 'storage_limit' => (
writer => '_set_storage_limit',
);

=head2 Account methods
=head1 METHODS
=over
Expand Down

0 comments on commit 2a8e99d

Please sign in to comment.