Class: GitPusher::Repo::GitHub

Inherits:
Base
  • Object
show all
Defined in:
lib/gitpusher/repo/github.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ GitHub

Returns a new instance of GitHub.



9
10
11
12
13
14
15
16
17
18
# File 'lib/gitpusher/repo/github.rb', line 9

def initialize(config)
  super(config)
  @user     = Pit.get(
    'github', :require => { 'user' => 'Your user name of GitHub' }
  )['user']
  @password = Pit.get(
    'github', :require => { 'password' => 'Your user password of GitHub' }
  )['password']
  @organization = config[:organization]
end

Instance Attribute Details

#organizationObject (readonly)

Returns the value of attribute organization.



7
8
9
# File 'lib/gitpusher/repo/github.rb', line 7

def organization
  @organization
end

#passwordObject (readonly)

Returns the value of attribute password.



7
8
9
# File 'lib/gitpusher/repo/github.rb', line 7

def password
  @password
end

#userObject (readonly)

Returns the value of attribute user.



7
8
9
# File 'lib/gitpusher/repo/github.rb', line 7

def user
  @user
end

Instance Method Details

#reposObject



20
21
22
23
24
25
26
27
# File 'lib/gitpusher/repo/github.rb', line 20

def repos
  repos = []
  octokit.repos(self.organization||self.user).each do |repo|
    p repo
    break
  end
  repos
end