WWW::Github::Files - Read files and directories from Github
my $gitfiles = WWW::Github::Files->new( author => 'semuel', resp => 'site-lang-collab', branch => 'master', ); my @files = $gitfiles->open('/')->readdir();
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
The easiest way to get a file off Github is to use the raw url:
This will return the content of this module's MANIFEST file. Easy, but the file have to be public and you need to know beforehand where exactly it is. (this method does not fetch directory content)
Also, if you download two files under 'master', there is a chance that a commit happened in the middle and you get two files from two different versions of the respo. Of course you can fetch the current commit and use it instead of master, but then it is less easy
This module let you use Access Token for permission, and scan directories
Need to write code that read files from Github and local repositories? Check out WWW::Github::Files::Mock that uses the same interface for local directory.
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
The object will retrive files and directories as they were after this commit
Optional Net::Oauth2 Access Token, for using in API calls. If not specified, will make anonymous calls using LWP
Optional Github "Personal Access Token" to use for API authentication.
receive path (which have to start with '/') and return file or dir object for that location
shortcut to $gitfiles->open(path)->read()
shortcut to $gitfiles->open(path)->readdir()
The name of the file
full path (+name) of the file
returns the content of the file
The name of the directory
full path (+name) of the directory
returns a list of file/dir objects that this directory contains
Fomberg Shmuel, <email@example.com>
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.