@@ -18,7 +18,7 @@ we have a unique implemenation of GitHub server-side functionality,
1818which you can use in your unit tests, eliminating the necessity to connect
1919to GitHub during unit/integration testing.
2020Please, read the blog post
21- [ _ Object-Oriented Github API_ ] [ blog ]
21+ [ _ Object-Oriented GitHub API_ ] [ blog ]
2222by [ Yegor Bugayenko] ( https://www.yegor256.com ) , the creator of this library.
2323
2424Java 8 or higher is required.
@@ -31,15 +31,15 @@ The set of classes in the
3131[ ` com.jcabi.github ` ] [ package ]
3232package 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
3939import com.jcabi.github.* ;
4040public 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,
5555you 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
5858domain ` 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
8080change the URI ** paths** . Changing the requests'
8181paths 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
8484For 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.
8787Be sure to configure the ` Request ` properly.
8888See how the [ default Request] [ Request ]
8989is 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 ] ,
9494a mock version of the GitHub server, which
9595you can use in your unit tests, for example:
9696
9797``` java
9898import com.jcabi.github.* ;
9999public 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
126126There 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),
130130and 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
136136Replace ` <token> ` and ` <second-token> ` with the OAuth access tokens
137- of two different Github
137+ of two different GitHub
138138accounts. This test case will try to fork a gist from first account
139139into 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
0 commit comments