Class: PgBundle::GitSource
- Inherits:
-
BaseSource
- Object
- BaseSource
- PgBundle::GitSource
- Defined in:
- lib/pgbundle/git_source.rb
Overview
The GithubSource class defines a Github Source
Direct Known Subclasses
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
Attributes inherited from BaseSource
Instance Method Summary collapse
- #clean ⇒ Object
-
#initialize(path, branch = 'master') ⇒ GitSource
constructor
A new instance of GitSource.
- #load(host, user, dest) ⇒ Object
Constructor Details
#initialize(path, branch = 'master') ⇒ GitSource
Returns a new instance of GitSource.
7 8 9 10 |
# File 'lib/pgbundle/git_source.rb', line 7 def initialize(path, branch = 'master') @branch = branch || 'master' super(path) end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
5 6 7 |
# File 'lib/pgbundle/git_source.rb', line 5 def branch @branch end |
Instance Method Details
#clean ⇒ Object
21 22 23 |
# File 'lib/pgbundle/git_source.rb', line 21 def clean FileUtils.remove_dir(clone_dir, true) end |
#load(host, user, dest) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/pgbundle/git_source.rb', line 12 def load(host, user, dest) clone if host == 'localhost' copy_local("#{clone_dir}/", dest) else copy_to_remote(host, user, "#{clone_dir}/", dest) end end |