Skip to content

Commit 086f904

Browse files
committed
tweaks
1 parent 7731ee6 commit 086f904

File tree

6 files changed

+33
-18
lines changed

6 files changed

+33
-18
lines changed

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,34 @@ and then use it:
4545
```dart
4646
import 'package:github/github.dart';
4747
48-
void main() async {
48+
Future<void> main() async {
4949
/* Create a GitHub Client, with anonymous authentication by default */
5050
var github = GitHub();
5151
52-
/* or Create a GitHub Client and have it try to find your token or credentials automatically */
53-
var github = GitHub(auth: findAuthenticationFromEnvironment());
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());
5466
5567
/* or Create a GitHub Client using an auth token */
56-
var github = GitHub(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'));
5772
5873
Repository repo = await github.repositories.getRepository(new RepositorySlug("user_or_org", "repo_name"));
5974
/* Do Something with repo */
75+
6076
}
6177
```
6278

example/releases.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Future<void> main() async {
1414

1515
void loadReleases() {
1616
github.repositories
17-
.listReleases(RepositorySlug('twbs', 'bootstrap'))
17+
.listReleases(RepositorySlug('Workiva', 'wdesk'))
18+
.take(10)
1819
.toList()
1920
.then((releases) {
2021
for (final release in releases) {

lib/src/common/model/repos_releases.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ part 'repos_releases.g.dart';
1111
class Release {
1212
Release({
1313
this.id,
14+
this.url,
1415
this.htmlUrl,
1516
this.tarballUrl,
1617
this.uploadUrl,
@@ -28,6 +29,9 @@ class Release {
2829
this.assets,
2930
});
3031

32+
/// Url to this Release
33+
String url;
34+
3135
/// Url to this Release
3236
String htmlUrl;
3337

lib/src/common/model/repos_releases.g.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/common/repos_service.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -935,14 +935,6 @@ class RepositoriesService extends Service {
935935
);
936936
}
937937

938-
/// Fetches a single release by the release ID.
939-
///
940-
/// API docs: https://developer.github.com/v3/repos/releases/#get-a-single-release
941-
@Deprecated(
942-
'Use getReleaseById or for getting a release using a tag name, use getReleaseByTagName')
943-
Future<Release> getRelease(RepositorySlug slug, int id) =>
944-
getReleaseById(slug, id);
945-
946938
/// Fetches a single release by the release ID.
947939
///
948940
/// API docs: https://developer.github.com/v3/repos/releases/#get-a-single-release

test/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Integration Tests
22

3-
The integration tests will run against the live GitHub API. These tests will
3+
The integration tests will run against the live GitHub API. These tests will
44
verify that the library is properly coded against the actual behavior of the
55
GitHub API.
66

77
To run these tests a GitHub repository and OAuth token will need to be defined
8-
in the `config/config.dart` file.
8+
in the `config/config.dart` file.
99

10-
**Warning:** The test will delete and recreate the specified repository to
11-
start with a clean repo. It is highly recommended that a dedicated test account
12-
is used!
10+
**Warning:** The test will delete and recreate the specified repository to
11+
start with a clean repo. It is highly recommended that a dedicated test account
12+
is used!

0 commit comments

Comments
 (0)