Module: Pod::GitHub

Defined in:
lib/cocoapods-core/github.rb

Overview

Allows to access information about the GitHub repos.

This class is stored in Core because it might be used by web services.

Class Method Summary collapse

Class Method Details

.branches(url) ⇒ Array

Returns the branches of a repo.

Parameters:

  • url (String)

    @see #repo

Returns:

  • (Array)

    The list of the branches.



51
52
53
54
55
# File 'lib/cocoapods-core/github.rb', line 51

def self.branches(url)
  if repo_id = normalized_repo_id(url)
    peform_request("https://api.github.com/repos/#{repo_id}/branches")
  end
end

.repo(url) ⇒ Hash

Returns the information of a repo.

Parameters:

  • url (String)

    The URL of the repo.

Returns:

  • (Hash)

    The hash containing the data as reported by GitHub.



27
28
29
30
31
# File 'lib/cocoapods-core/github.rb', line 27

def self.repo(url)
  if repo_id = normalized_repo_id(url)
    peform_request("https://api.github.com/repos/#{repo_id}")
  end
end

.tags(url) ⇒ Array

Returns the tags of a repo.

Parameters:

  • url (String)

    @see #repo

Returns:

  • (Array)

    The list of the tags.



39
40
41
42
43
# File 'lib/cocoapods-core/github.rb', line 39

def self.tags(url)
  if repo_id = normalized_repo_id(url)
    peform_request("https://api.github.com/repos/#{repo_id}/tags")
  end
end

.user(login) ⇒ Hash

Returns the information of a user.

Parameters:

  • login (String)

    The name of the user.

Returns:

  • (Hash)

    The data of user.



16
17
18
# File 'lib/cocoapods-core/github.rb', line 16

def self.user()
  peform_request("https://api.github.com/users/#{}")
end