GitHub-RSS

 view release on metacpan or  search on metacpan

README.mkdn  view on Meta::CPAN

        dbh => {
            dsn => 'dbi:SQLite:dbname=db/issues.sqlite',
        },
    );

Constructs a new GitHub::RSS instance

- **gh** - instance of [Net::GitHub](https://metacpan.org/pod/Net%3A%3AGitHub)
- **token\_file** - name and path of the JSON-format token file containing the
GitHub API token By default, that file is searched for under the name
`github.credentials` in `.`, `$ENV{XDG_DATA_HOME}`, `$ENV{USERPROFILE}`
and `$ENV{HOME}`.
- **token** - GitHub API token. If this is missing, it will be attempted to read
it from the `token_file`.
- **default\_user** - name of the GitHub user whose repos will be read
- **default\_repo** - name of the GitHub repo whose issues will be read
- **dbh** - premade database handle or alternatively a hashref containing
the [DBI](https://metacpan.org/pod/DBI) arguments

        dbh => $dbh,

lib/GitHub/RSS.pm  view on Meta::CPAN

        Net::GitHub->new(
            maybe access_token => $self->token
        ),
    },
);

=item *

B<token_file> - name and path of the JSON-format token file containing the
GitHub API token By default, that file is searched for under the name
C<github.credentials> in C<.>, C<$ENV{XDG_DATA_HOME}>, C<$ENV{USERPROFILE}>
and C<$ENV{HOME}>.

=cut

has 'token_file' => (
    is => 'lazy',
    default => \&_find_gh_token_file,
);

=item *

lib/GitHub/RSS.pm  view on Meta::CPAN


    my $token_file;

    # This should use File::User
    for my $candidate_dir ('.',
                           $ENV{XDG_DATA_HOME},
                           $ENV{USERPROFILE},
                           $ENV{HOME}
    ) {
        next unless defined $candidate_dir;
        if( -f "$candidate_dir/github.credentials" ) {
            $token_file = "$candidate_dir/github.credentials";
            last
        };
    };

    return $token_file
}

sub _read_gh_token( $self, $token_file=undef ) {
    my $file = $token_file // $self->token_file;



( run in 0.257 second using v1.01-cache-2.11-cpan-4d50c553e7e )