Module: GitHub::Finders

Included in:
GitHub
Defined in:
lib/github/finders.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) branches(login, repository_name)



33
34
35
# File 'lib/github/finders.rb', line 33

def branches(, repository_name)
  json("/repos/show/#{}/#{repository_name}/branches", :branches)
end

- (Object) commit(login, repository_name, commit_id)



47
48
49
50
# File 'lib/github/finders.rb', line 47

def commit(, repository_name, commit_id)
  h = json("/commits/show/#{}/#{repository_name}/#{commit_id}", :commit)
  Commit.from_hash(h, Repository.new(:owner => , :name => repository_name))
end

- (Object) commits(login, repository_name, branch = 'master'))



42
43
44
45
# File 'lib/github/finders.rb', line 42

def commits(, repository_name, branch = 'master')
  h = json("/commits/list/#{}/#{repository_name}/#{branch}", :commits)
  Commit.commits_from_hashes(h, Repository.new(:owner => , :name => repository_name))
end

- (Object) followers(login)



13
14
15
16
# File 'lib/github/finders.rb', line 13

def followers()
  l = json("/user/show/#{}/followers", :users)
  User.users_from_logins(l)
end

- (Object) following(login)



8
9
10
11
# File 'lib/github/finders.rb', line 8

def following()
  l = json("/user/show/#{}/following", :users)
  User.users_from_logins(l)
end

- (Object) network(login, repository_name)



37
38
39
40
# File 'lib/github/finders.rb', line 37

def network(, repository_name)
  j = json("/repos/show/#{}/#{repository_name}/network", :network)
  Repository.repositories_from_hashes(j, Repository.new(:owner => , :name => repository_name))
end

- (Object) repositories(login)



18
19
20
21
# File 'lib/github/finders.rb', line 18

def repositories()
  j = json("/repos/show/#{}", :repositories)
  Repository.repositories_from_hashes(j)
end

- (Object) repository(login, repository_name)



28
29
30
31
# File 'lib/github/finders.rb', line 28

def repository(, repository_name)
  j = json("/repos/show/#{}/#{repository_name}", :repository)
  Repository.from_hash(j)
end

- (Object) user(login)



3
4
5
6
# File 'lib/github/finders.rb', line 3

def user()
  j = json("/user/show/#{}", :user)
  User.from_hash(j)
end

- (Object) watched(login)



23
24
25
26
# File 'lib/github/finders.rb', line 23

def watched()
  j = json("/repos/watched/#{}", :repositories)
  Repository.repositories_from_hashes(j)
end