Class: PgBundle::GithubSource

Inherits:
BaseSource show all
Defined in:
lib/pgbundle/github_source.rb

Overview

The GithubSource class defines a Github Source

Instance Attribute Summary collapse

Attributes inherited from BaseSource

#path

Instance Method Summary collapse

Constructor Details

#initialize(path, branch = 'master') ⇒ GithubSource

Returns a new instance of GithubSource.



7
8
9
10
# File 'lib/pgbundle/github_source.rb', line 7

def initialize(path, branch = 'master')
  @branch = branch
  super(path)
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



5
6
7
# File 'lib/pgbundle/github_source.rb', line 5

def branch
  @branch
end

Instance Method Details

#load(host, user, dest) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/pgbundle/github_source.rb', line 12

def load(host, user, dest)
  clone(dest)
  if host == 'localhost'
    copy_local(clone_dir, dest)
  else
    copy_to_remote(host, user, clone_dir, dest)
  end
end