Examples of GitHub


Examples of com.jcabi.github.Github

     * MkIssues can create a multiple issues.
     * @throws Exception If some problem inside
     */
    @Test
    public void createsMultipleIssues() throws Exception {
        final Github github = new MkGithub("jeff");
        final Repo repo = github.repos().create(
            Json.createObjectBuilder().add("name", "test-3").build()
        );
        for (int idx = 1; idx < Tv.TEN; ++idx) {
            repo.issues().create("title", "body");
        }
View Full Code Here

Examples of com.jcabi.github.Github

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void retrievesMarkdown() throws Exception {
        final Github github = new MkGithub();
        MatcherAssert.assertThat(
            github.markdown(),
            Matchers.notNullValue()
        );
    }
View Full Code Here

Examples of com.jcabi.github.Github

     * @throws Exception when a problem occurs.
     */
    @Test
    public void canRememberItsAuthor() throws Exception {
        final MkGithub first = new MkGithub("first");
        final Github second = first.relogin("second");
        final Repo repo = first.repos().create(
            Json.createObjectBuilder().add("name", "test").build()
        );
        final int number = second.repos()
            .get(repo.coordinates())
            .issues()
            .create("", "")
            .number();
        final Issue issue = first.repos()
View Full Code Here

Examples of com.jcabi.github.Github

     * Fetches labels from Github.
     * @throws Exception If fails
     */
    @Test
    public void fetchesLabelsFromGithub() throws Exception {
        final Github github = new RtGithub();
        final Repo repo = github.repos().get(
            new Coordinates.Simple("jcabi/jcabi-github")
        );
        MatcherAssert.assertThat(
            repo.labels().iterate().iterator().hasNext(),
            Matchers.equalTo(true)
View Full Code Here

Examples of com.jcabi.github.Github

    /**
     * Main entry point.
     * @param args Command line arguments
     */
    public static void main(final String[] args) throws Exception {
        final Github github = new RtGithub();
        final JsonResponse resp = github.entry()
            .uri().path("/search/repositories")
            .queryParam("q", "java").back()
            .fetch()
            .as(JsonResponse.class);
        final List<JsonObject> items = resp.json().readObject()
View Full Code Here

Examples of com.rexsl.page.auth.Github

    public final AuthInset auth() {
        // @checkstyle LineLength (4 lines)
        return new AuthInset(this, Manifests.read("S3Auth-SecurityKey"))
            .with(new Facebook(this, Manifests.read("S3Auth-FbId"), Manifests.read("S3Auth-FbSecret")))
            .with(new Google(this, Manifests.read("S3Auth-GoogleId"), Manifests.read("S3Auth-GoogleSecret")))
            .with(new Github(this, Manifests.read("S3Auth-GithubId"), Manifests.read("S3Auth-GithubSecret")));
    }
View Full Code Here

Examples of org.kohsuke.github.GitHub

        }
    }

    public static GithubCurrentUserService current() {
        GithubAuthenticationToken auth = (GithubAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();
        GitHub gh = auth.getGitHub();
        return new GithubCurrentUserService(gh);
    }
View Full Code Here

Examples of org.kohsuke.github.GitHub

      public void put(String url) throws IOException {
        DBObject token = getToken(url);

        GithubAuthenticationToken auth = getAuthentication();
        GitHub gh = auth.getGitHub();
        String accessToken = getEncryptedToken(auth);

            if (token != null) {
                 getCollection().remove(token);
            }

            BasicDBObject doc = new BasicDBObject("user", gh.getMyself().getLogin()).append("access_token", accessToken).append("repo_url", url);
            getCollection().insert(doc);
      }
View Full Code Here

Examples of org.kohsuke.github.GitHub

    }

    private String getGravatarUrl() {
        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        if (auth instanceof GithubAuthenticationToken) {
            GitHub gh = ((GithubAuthenticationToken) auth).getGitHub();
            try {
                return gh.getOrganization(orgName).getAvatarUrl();
            } catch (IOException e) {
                // try user
                try {
                    return gh.getUser(orgName).getAvatarUrl();
                } catch (IOException e1) {
                    // give up
                }
            }
        }
View Full Code Here

Examples of org.kohsuke.github.GitHub

  public static Status ignore(GitHubIgnore annotation) {
    try {
      if (annotation == null) {
        return Status.NOT_TRACKING;
      }
      GitHub gitHub = GitHub.connect();
      GHRepository repository = gitHub.getRepository(annotation.repository());
      GHIssue issue = repository.getIssue(annotation.issue());
      if (issue != null && issue.getState() == GHIssueState.OPEN) {
        return Status.OPEN;
      } else {
        return Status.CLOSED;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.