Skip to content

Commit

Permalink
Merge pull request #188 from SpinlockLabs/dev
Browse files Browse the repository at this point in the history
Merge 6.0.0 Dev Release to Stable
  • Loading branch information
robrbecker authored Nov 10, 2019
2 parents 1eb8496 + d80f843 commit 0bf168f
Show file tree
Hide file tree
Showing 131 changed files with 6,206 additions and 3,572 deletions.
139 changes: 77 additions & 62 deletions CHANGELOG.md

Large diffs are not rendered by default.

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

## Making Changes

Expand Down
43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Please submit issues and pull requests, help out, or just give encouragement.

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

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

```yaml
dependencies:
github: ^5.0.0
github: ^6.0.0
```
Then import the library
For the browser use:
```dart
import 'package:github/browser.dart';
```

and for the server or Flutter use:
```dart
import 'package:github/server.dart';
import 'package:github/github.dart';
```

and then use it:

**Example**
```dart
import 'package:github/browser.dart';
void main() async {
/* Create a GitHub Client */
var github = createGitHubClient();
import 'package:github/github.dart';
Future<void> main() async {
/* Create a GitHub Client, with anonymous authentication by default */
var github = GitHub();
/* or Create a GitHub Client and have it try to find your token or credentials automatically
In Flutter and in server environments this will search environment variables in this order
GITHUB_ADMIN_TOKEN
GITHUB_DART_TOKEN
GITHUB_API_TOKEN
GITHUB_TOKEN
HOMEBREW_GITHUB_API_TOKEN
MACHINE_GITHUB_API_TOKEN
and then GITHUB_USERNAME and GITHUB_PASSWORD
In a browser it will search keys in the same order first through the query string parameters
and then in window sessionStorage
*/
var github = GitHub(auth: findAuthenticationFromEnvironment());
/* or Create a GitHub Client using an auth token */
var github = createGitHubClient(auth: new Authentication.withToken("YourTokenHere"));
var github = GitHub(auth: new Authentication.withToken("YourTokenHere"));
/* or Create a GitHub Client using a username and password */
var github = GitHub(auth: new Authentication.basic('username', 'password'));
Repository repo = await github.repositories.getRepository(new RepositorySlug("user_or_org", "repo_name"));
/* Do Something with repo */
}
```

Expand Down
Loading

0 comments on commit 0bf168f

Please sign in to comment.