NAME
WWW::Github::Files - Read files and directories from Github
SYNOPSIS
my $gitfiles = WWW::Github::Files->new(
author => 'semuel',
resp => 'site-lang-collab',
branch => 'master',
);
my @files = $gitfiles->open('/')->readdir();
DESCRIPTION
Using Github API to browse a git resp easily and download files
This modules is a thin warper around the API, just to make life easier
CONSTRUCTOR OPTIONS
- resp - resp name
- branch - The branch to read from
-
Mutual exlusive with 'commit'.
On first access the object will "lock" on the latest commit in this branch, and from this point will serve files only from this commit
- commit - a specific commit to read from
-
The object will retrive files and directories as they were after this commit
- token
-
Optional Net::Oauth2 Access Token, for using in API calls. If not specified, will make anonymous calls using LWP
METHODS
open(path)
receive path (which have to start with '/') and return file or dir object for that location
get_file(path)
shortcut to $gitfiles->open(path)->read()
get_dir(path)
shortcut to $gitfiles->open(path)->readdir()
FILE OBJECT METHODS
name
The name of the file
path
full path (+name) of the file
is_file
is_dir
read
returns the content of the file
DIRECTORY OBJECT METHODS
name
The name of the directory
path
full path (+name) of the directory
is_file
is_dir
readdir
returns a list of file/dir objects that this directory contains
AUTHOR
Fomberg Shmuel, <owner@semuel.co.il>
COPYRIGHT AND LICENSE
Copyright 2013 by Shmuel Fomberg.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.