Class: Pullr::RemoteRepository
- Inherits:
-
Object
- Object
- Pullr::RemoteRepository
- Includes:
- Repository
- Defined in:
- lib/pullr/remote_repository.rb
Instance Attribute Summary collapse
-
#scm ⇒ Object
readonly
The SCM that manages the remote repository.
-
#uri ⇒ Object
readonly
The URI of the remote repository.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RemoteRepository
constructor
Initializes the remote repository.
-
#pull(dest = nil) ⇒ Repository
Clones the remote repository into the given destination.
Methods included from Repository
#infer_scm_from_dir, #infer_scm_from_uri
Constructor Details
#initialize(options = {}) ⇒ RemoteRepository
Initializes the remote repository.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/pullr/remote_repository.rb', line 28 def initialize(={}) super() infer_scm_from_uri unless @scm unless @scm raise(AmbigiousURI,"could not infer the SCM used for the URI #{@uri}",caller) end extend SCM.lookup(@scm) end |
Instance Attribute Details
#scm ⇒ Object (readonly)
The SCM that manages the remote repository
11 12 13 |
# File 'lib/pullr/remote_repository.rb', line 11 def scm @scm end |
#uri ⇒ Object (readonly)
The URI of the remote repository
14 15 16 |
# File 'lib/pullr/remote_repository.rb', line 14 def uri @uri end |
Instance Method Details
#pull(dest = nil) ⇒ Repository
Clones the remote repository into the given destination.
49 50 51 52 53 |
# File 'lib/pullr/remote_repository.rb', line 49 def pull(dest=nil) scm_pull(@uri,dest) return LocalRepository.new(:path => dest, :scm => @scm) end |