Skip to content

Commit 655afc1

Browse files
committed
#1807: Fix typo in README.md and update class names to match GitHub API naming conventions.
1 parent e35ba33 commit 655afc1

382 files changed

Lines changed: 1142 additions & 1174 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ we have a unique implemenation of GitHub server-side functionality,
1818
which you can use in your unit tests, eliminating the necessity to connect
1919
to GitHub during unit/integration testing.
2020
Please, read the blog post
21-
[_Object-Oriented Github API_][blog]
21+
[_Object-Oriented GitHub API_][blog]
2222
by [Yegor Bugayenko](https://www.yegor256.com), the creator of this library.
2323

2424
Java 8 or higher is required.
@@ -31,15 +31,15 @@ The set of classes in the
3131
[`com.jcabi.github`][package]
3232
package is the object-oriented API. Use it like this:
3333

34-
## Work with Github's API
34+
## Work with GitHub's API
3535

36-
By default, the library works with Github's API (https://api.github.com)
36+
By default, the library works with GitHub's API (https://api.github.com)
3737

3838
```java
3939
import com.jcabi.github.*;
4040
public class Main {
4141
public static void main(String[] args) throws IOException {
42-
Github github = new RtGithub(".. your OAuth token ..");
42+
GitHub github = new RtGitHub(".. your OAuth token ..");
4343
Repo repo = github.repos().get(
4444
new Coordinates.Simple("octocat/Hello-World")
4545
);
@@ -49,56 +49,56 @@ public class Main {
4949
}
5050
```
5151

52-
## Work with Github Enterprise or other
52+
## Work with GitHub Enterprise or other
5353

54-
If you want to work with Github's API through another domain,
54+
If you want to work with GitHub's API through another domain,
5555
you can use the URI-constructors
56-
of class `RtGithub`. For instance, if you have your own instance
57-
of Github deployed under the
56+
of class `RtGitHub`. For instance, if you have your own instance
57+
of GitHub deployed under the
5858
domain `https://github.mydomain.com`, do the following:
5959

6060
```java
61-
final Github github = new RtGithub(URI.create("https://github.mydomain.com"));
61+
final GitHub github = new RtGitHub(URI.create("https://github.mydomain.com"));
6262

6363
//OR
6464

65-
final Github github = new RtGithub(
65+
final GitHub github = new RtGitHub(
6666
"<<oauth2_token>>",
6767
URI.create("https://github.mydomain.com")
6868
);
6969

7070
//OR
7171

72-
final Github github = new RtGithub(
72+
final GitHub github = new RtGitHub(
7373
"username", "password",
7474
URI.create("https://github.mydomain.com")
7575
);
7676
```
7777

7878
**DO NOT** change or mask your URIs!
79-
Using Github under a different domain is fine but do not
79+
Using GitHub under a different domain is fine but do not
8080
change the URI **paths**. Changing the requests'
8181
paths is not possible since the whole architecture
82-
of this library relies on Github's URI paths.
82+
of this library relies on GitHub's URI paths.
8383

8484
For more complex configurations, you can instantiate
85-
`RtGithub` with your own custom `Request`,
86-
by using the [RtGithub(Request)][RtGithub] constructor.
85+
`RtGitHub` with your own custom `Request`,
86+
by using the [RtGitHub(Request)][RtGitHub] constructor.
8787
Be sure to configure the `Request` properly.
8888
See how the [default Request][Request]
8989
is created -- you basically have to do the same thing.
9090

9191
## Mock Implementation Of The API
9292

93-
We also provide [MkGithub],
93+
We also provide [MkGitHub],
9494
a mock version of the GitHub server, which
9595
you can use in your unit tests, for example:
9696

9797
```java
9898
import com.jcabi.github.*;
9999
public class FooTest {
100-
public void submitsCommentToGithubIssue() {
101-
final Repo repo = new MkGithub().repos().create(
100+
public void submitsCommentToGitHubIssue() {
101+
final Repo repo = new MkGitHub().repos().create(
102102
Json.createObjectBuilder().add("name", "test").build()
103103
);
104104
final Issue issue = repo.issues().create("how are you?", "");
@@ -124,8 +124,8 @@ mvn clean install -Pqulice
124124
```
125125

126126
There are many integration tests that check our classes against
127-
live Github accounts. In order to run them, you should create
128-
a new Github OAuth access tokens
127+
live GitHub accounts. In order to run them, you should create
128+
a new GitHub OAuth access tokens
129129
([how?][pat),
130130
and provide them in command line, like this:
131131

@@ -134,7 +134,7 @@ mvn clean install -Dit.test=RtGistITCase -Dfailsafe.github.key=<token> -Dfailsaf
134134
```
135135

136136
Replace `<token>` and `<second-token>` with the OAuth access tokens
137-
of two different Github
137+
of two different GitHub
138138
accounts. This test case will try to fork a gist from first account
139139
into second. Replace
140140
`<repo>` with the name of repository you create in your first account
@@ -172,7 +172,7 @@ mvn clean install -DskipTests -Dinvoker.skip=true -Pqulice
172172
[GitHub RESTful API]: https://developer.github.com/v3/
173173
[blog]: https://www.yegor256.com/2014/05/14/object-oriented-github-java-sdk.html
174174
[pat]: https://help.github.com/articles/creating-an-access-token-for-command-line-use
175-
[MkGithub]: https://static.javadoc.io/com.jcabi/jcabi-github/1.0/com/jcabi/github/mock/MkGithub.html
176-
[RtGithub]: https://github.com/jcabi/jcabi-github/blob/master/src/main/java/com/jcabi/github/RtGithub.java#L147
175+
[MkGitHub]: https://static.javadoc.io/com.jcabi/jcabi-github/1.0/com/jcabi/github/mock/MkGitHub.html
176+
[RtGitHub]: https://github.com/jcabi/jcabi-github/blob/master/src/main/java/com/jcabi/github/RtGitHub.java#L147
177177
[package]: https://static.javadoc.io/com.jcabi/jcabi-github/1.0/com/jcabi/github/package-frame.html
178-
[Request]: https://github.com/jcabi/jcabi-github/blob/master/src/main/java/com/jcabi/github/RtGithub.java#L82
178+
[Request]: https://github.com/jcabi/jcabi-github/blob/master/src/main/java/com/jcabi/github/RtGitHub.java#L82

examples/search-repos/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This micro Maven project shows how you can
2-
use this library in order to access Github API
2+
use this library in order to access GitHub API
33
directly through RESTful requests.
44

55
Just run it with:

examples/search-repos/src/main/java/com/jcabi/Main.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55
package com.jcabi;
66

7-
import com.jcabi.github.Github;
8-
import com.jcabi.github.RtGithub;
7+
import com.jcabi.github.GitHub;
8+
import com.jcabi.github.RtGitHub;
99
import com.jcabi.http.response.JsonResponse;
1010
import java.util.List;
1111
import javax.json.JsonObject;
@@ -22,7 +22,7 @@ public final class Main {
2222
* @param args Command line arguments
2323
*/
2424
public static void main(final String[] args) throws Exception {
25-
final Github github = new RtGithub();
25+
final GitHub github = new RtGitHub();
2626
final JsonResponse resp = github.entry()
2727
.uri().path("/search/repositories")
2828
.queryParam("q", "java").back()

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<version>2.0-SNAPSHOT</version>
1515
<packaging>jar</packaging>
1616
<name>jcabi-github</name>
17-
<description>Object Oriented Github API</description>
17+
<description>Object Oriented GitHub API</description>
1818
<issueManagement>
1919
<system>github</system>
2020
<url>https://github.com/jcabi/jcabi-github/issues</url>

src/it/basic-usage/src/test/java/com/jcabi/foo/SampleTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
package com.jcabi.foo;
66

77
import com.jcabi.github.Coordinates;
8-
import com.jcabi.github.Github;
8+
import com.jcabi.github.GitHub;
99
import com.jcabi.github.Repo;
10-
import com.jcabi.github.RtGithub;
10+
import com.jcabi.github.RtGitHub;
1111
import org.hamcrest.MatcherAssert;
1212
import org.hamcrest.Matchers;
1313
import org.junit.Test;
@@ -18,12 +18,12 @@
1818
public final class SampleTest {
1919

2020
/**
21-
* Fetches labels from Github.
21+
* Fetches labels from GitHub.
2222
* @throws Exception If fails
2323
*/
2424
@Test
25-
public void fetchesLabelsFromGithub() throws Exception {
26-
final Github github = new RtGithub();
25+
public void fetchesLabelsFromGitHub() throws Exception {
26+
final GitHub github = new RtGitHub();
2727
final Repo repo = github.repos().get(
2828
new Coordinates.Simple("jcabi/jcabi-github")
2929
);

src/it/fat-jar/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
<!-- <classpathScope>compile</classpathScope> -->
2525
<source><![CDATA[
2626
import com.jcabi.github.Coordinates
27-
import com.jcabi.github.Github
27+
import com.jcabi.github.GitHub
2828
import com.jcabi.github.Label
2929
import com.jcabi.github.Repo
30-
import com.jcabi.github.RtGithub
30+
import com.jcabi.github.RtGitHub
3131
import java.io.IOException
32-
final Github github = new RtGithub()
32+
final GitHub github = new RtGitHub()
3333
final Repo repo = github.repos().get(
3434
new Coordinates.Simple("jcabi/jcabi-github")
3535
)

src/main/java/com/jcabi/github/Blob.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import lombok.ToString;
1313

1414
/**
15-
* Github Git blob.
15+
* GitHub Git blob.
1616
*
1717
* @see <a href="https://developer.github.com/v3/git/blobs/">Blobs API</a>
1818
* @checkstyle MultipleStringLiterals (500 lines)

src/main/java/com/jcabi/github/Blobs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.io.IOException;
99

1010
/**
11-
* Github Git Data Blobs.
11+
* GitHub Git Data Blobs.
1212
*
1313
* @since 0.8
1414
* @see <a href="https://developer.github.com/v3/git/blobs/">Blobs API</a>

src/main/java/com/jcabi/github/Bulk.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Bulk items, with pre-saved JSON.
1515
*
1616
* <p>This class should be used as a decorator for object obtained
17-
* from Github, when you want to keep their JSON values in memory. For
17+
* from GitHub, when you want to keep their JSON values in memory. For
1818
* example:
1919
*
2020
* <pre> Iterable&lt;Issue&gt; issues = repo.issues().iterate(
@@ -24,8 +24,8 @@
2424
* System.out.println(new Issue.Smart(issue).title());
2525
* }</pre>
2626
*
27-
* <p>Let's say, there are 50 issues in Github's repo. This code will
28-
* make 52 HTTP requests to Github. The first one will fetch the first
27+
* <p>Let's say, there are 50 issues in GitHub's repo. This code will
28+
* make 52 HTTP requests to GitHub. The first one will fetch the first
2929
* 30 issues in JSON array. Then, for every one of them, in order
3030
* to retrieve issue title a separate HTTP request will be made. Then,
3131
* one more page will be fetched, with 20 issues. And again, 20 new

src/main/java/com/jcabi/github/Check.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import java.util.Locale;
1010

1111
/**
12-
* Github check.
12+
* GitHub check.
1313
*
1414
* @see <a href="https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28">Check Runs API</a>
1515
* @since 1.5.0
@@ -81,8 +81,8 @@ public String value() {
8181
* @param value String value.
8282
* @return Status.
8383
*/
84-
public static Status fromString(final String value) {
85-
return Arrays.stream(Status.values())
84+
public static Check.Status fromString(final String value) {
85+
return Arrays.stream(Check.Status.values())
8686
.filter(stat -> stat.same(value))
8787
.findFirst()
8888
.orElseThrow(
@@ -97,7 +97,7 @@ public static Status fromString(final String value) {
9797
* @return True if check is finished.
9898
*/
9999
boolean finished() {
100-
return this == Status.COMPLETED;
100+
return this == Check.Status.COMPLETED;
101101
}
102102

103103
/**
@@ -181,8 +181,8 @@ enum Conclusion {
181181
* @param value String value.
182182
* @return Conclusion.
183183
*/
184-
public static Conclusion fromString(final String value) {
185-
return Arrays.stream(Conclusion.values())
184+
public static Check.Conclusion fromString(final String value) {
185+
return Arrays.stream(Check.Conclusion.values())
186186
.filter(stat -> stat.same(value))
187187
.findFirst()
188188
.orElseThrow(
@@ -205,7 +205,7 @@ public String value() {
205205
* @return True if check is successful.
206206
*/
207207
boolean successful() {
208-
return this == Conclusion.SUCCESS;
208+
return this == Check.Conclusion.SUCCESS;
209209
}
210210

211211
/**

0 commit comments

Comments
 (0)