Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5 from throughnothing/multiple-projects

Update documentation for Multiple Projects
  • Loading branch information...
commit 9ab1686c13937da0abf420c5d0b6b67655298614 2 parents c0fec2b + 9d664a7
@bigpresh authored
Showing with 41 additions and 20 deletions.
  1. +25 −13 README
  2. +16 −7 lib/Bot/BasicBot/Pluggable/Module/GitHub.pm
View
38 README
@@ -64,31 +64,43 @@ Loading modules
including shared functionality and common documentation.
Configuring the default project repo
- The modules above need to know what GitHub project repository they
- should refer to.
+ The modules above need to know what GitHub project repositories they should
+ refer to.
- The project (and, optionally, authentication details, if it's not a
- public project) are configured with the `!setgithubproject' command in a
- private message to the bot.
+ The projects are configured with the `!setgithubprojects` command in
+ a private message to the bot.
You'll need to be authenticated to the bot in order to set the project
(see the auth module).
You set the project with:
- !setgithubproject #channel user/projectname
+ !setgithubprojects #channel user/projectname1 user/projectname2 ...
- That sets the default project repo to `projectname' owned by `user' on
- GitHub (in other words, <https://github.com/user/projectname>).
+ The default project repo for each channel is always the first one you set.
+ The user/projectname is mapped to `projectname` owned by `user` on GitHub
+ (in other words, <https://github.com/user/projectname>).
- If the project is a private repository which requires authentication,
- you can also tell the bot what user and token it should use to
- authenticate:
+ Projects can also be added and removed one by one using
+ `!addgithubproject` and `!deletegithubproject` as follows:
- !setgithubproject #channel user/privateproject someuser:githubtokenhere
+ !addgithubproject #channel user/projectname3
+
+ !deletegithubproject #channel user/projectname3
+
+ If the project is a private repository which requires authentication, you
+ can also tell the bot what user and token it should use to authenticate:
+
+ !setauthforproject #channel user/privateproject someuser:githubtokenhere
You can generate/find an API token for your GitHub account at
- https://github.com/account/admin
+ <https://github.com/account/admin>
+
+ If you have many projects that you want to use the same auth credentials,
+ you can use the `!setdefaultauth` command to set a default auth to use
+ for all projects that don't have a specific auth set.
+
+ !setdefaultauth user:githubtokenhere
AUTHOR
David Precious `<davidp@preshweb.co.uk'>
View
23 lib/Bot/BasicBot/Pluggable/Module/GitHub.pm
@@ -318,11 +318,10 @@ shared functionality and common documentation.
=head1 Configuring the default project repo
-The modules above need to know what GitHub project repository they should refer
-to.
+The modules above need to know what GitHub project repositories they should
+refer to.
-The project (and, optionally, authentication details, if it's not a public
-project) are configured with the C<!setgithubproject> command in a private
+The projects are configured with the C<!setgithubprojects> command in a private
message to the bot.
You'll need to be authenticated to the bot in order to set the project
@@ -330,19 +329,29 @@ You'll need to be authenticated to the bot in order to set the project
You set the project with:
- !setgithubproject #channel user/projectname
+ !setgithubprojects #channel user/projectname1 user/projectname2 ...
-That sets the default project repo to C<projectname> owned by C<user> on GitHub
+The default project repo for each channel is always the first one you set.
+The user/projectname is mapped to C<projectname> owned by C<user> on GitHub
(in other words, <https://github.com/user/projectname>).
+Projects can also be added and removed one by one using C<!addgithubproject> and C<!deletegithubproject> as follows:
+
+ !addgithubproject #channel user/projectname3
+
+ !deletegithubproject #channel user/projectname3
+
If the project is a private repository which requires authentication, you can
also tell the bot what user and token it should use to authenticate:
- !setgithubproject #channel user/privateproject someuser:githubtokenhere
+ !setauthforproject #channel user/privateproject someuser:githubtokenhere
You can generate/find an API token for your GitHub account at
L<https://github.com/account/admin>
+If you have many projects that you want to use the same auth credentials, you can use the C<!setdefaultauth> command to set a default auth to use for all projects that don't have a specific auth set.
+
+ !setdefaultauth user:githubtokenhere
=head1 AUTHOR
Please sign in to comment.
Something went wrong with that request. Please try again.