Skip to content

Commit 0bf168f

Browse files
authored
Merge pull request #188 from SpinlockLabs/dev
Merge 6.0.0 Dev Release to Stable
2 parents 1eb8496 + d80f843 commit 0bf168f

File tree

131 files changed

+6206
-3572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+6206
-3572
lines changed

CHANGELOG.md

Lines changed: 77 additions & 62 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ GitHub.dart is of course Open Source! We love it when people contribute!
77
- Make sure you have a [GitHub Account](https://github.com/signup/free).
88
- Make sure the [Dart SDK](https://www.dartlang.org/tools/sdk/) is installed on your system.
99
- Make sure you have [Git](http://git-scm.com/) installed on your system.
10-
- [Fork](https://help.github.com/articles/fork-a-repo) the [repository](https://github.com/DirectMyFile/github.dart) on GitHub.
10+
- [Fork](https://help.github.com/articles/fork-a-repo) the [repository](https://github.com/SpinlockLabs/github.dart) on GitHub.
1111

1212
## Making Changes
1313

README.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Please submit issues and pull requests, help out, or just give encouragement.
2121

2222
- [Library Demos](http://github.directcode.org/demos/)
2323
- [Pub Package](https://pub.dartlang.org/packages/github)
24-
- [Wiki](https://github.com/DirectMyFile/github.dart/wiki)
24+
- [Wiki](https://github.com/SpinlockLabs/github.dart/wiki)
2525
- [Latest API reference](https://pub.dev/documentation/github/latest/)
2626

2727
## Getting Started
@@ -30,36 +30,49 @@ First, add the following to your pubspec.yaml:
3030

3131
```yaml
3232
dependencies:
33-
github: ^5.0.0
33+
github: ^6.0.0
3434
```
3535
3636
Then import the library
3737
38-
For the browser use:
3938
```dart
40-
import 'package:github/browser.dart';
41-
```
42-
43-
and for the server or Flutter use:
44-
```dart
45-
import 'package:github/server.dart';
39+
import 'package:github/github.dart';
4640
```
4741

4842
and then use it:
4943

5044
**Example**
5145
```dart
52-
import 'package:github/browser.dart';
53-
54-
void main() async {
55-
/* Create a GitHub Client */
56-
var github = createGitHubClient();
46+
import 'package:github/github.dart';
47+
48+
Future<void> main() async {
49+
/* Create a GitHub Client, with anonymous authentication by default */
50+
var github = GitHub();
51+
52+
/* or Create a GitHub Client and have it try to find your token or credentials automatically
53+
In Flutter and in server environments this will search environment variables in this order
54+
GITHUB_ADMIN_TOKEN
55+
GITHUB_DART_TOKEN
56+
GITHUB_API_TOKEN
57+
GITHUB_TOKEN
58+
HOMEBREW_GITHUB_API_TOKEN
59+
MACHINE_GITHUB_API_TOKEN
60+
and then GITHUB_USERNAME and GITHUB_PASSWORD
61+
62+
In a browser it will search keys in the same order first through the query string parameters
63+
and then in window sessionStorage
64+
*/
65+
var github = GitHub(auth: findAuthenticationFromEnvironment());
5766
5867
/* or Create a GitHub Client using an auth token */
59-
var github = createGitHubClient(auth: new Authentication.withToken("YourTokenHere"));
68+
var github = GitHub(auth: new Authentication.withToken("YourTokenHere"));
69+
70+
/* or Create a GitHub Client using a username and password */
71+
var github = GitHub(auth: new Authentication.basic('username', 'password'));
6072
6173
Repository repo = await github.repositories.getRepository(new RepositorySlug("user_or_org", "repo_name"));
6274
/* Do Something with repo */
75+
6376
}
6477
```
6578

0 commit comments

Comments
 (0)