Module: Pullr::Repository
- Included in:
- LocalRepository, RemoteRepository
- Defined in:
- lib/pullr/repository.rb
Instance Method Summary collapse
-
#infer_scm_from_dir ⇒ Boolean
protected
Attempts to infer the SCM used for the repository.
-
#infer_scm_from_uri ⇒ Boolean
protected
Attempts to infer the SCM used for the remote repository.
-
#initialize(options = {}) ⇒ Object
Initializes the repository.
Instance Method Details
#infer_scm_from_dir ⇒ Boolean (protected)
Attempts to infer the SCM used for the repository.
58 59 60 61 62 63 64 65 66 |
# File 'lib/pullr/repository.rb', line 58 def infer_scm_from_dir if @path if (@scm = SCM.infer_from_dir(@path)) return true end end return false end |
#infer_scm_from_uri ⇒ Boolean (protected)
Attempts to infer the SCM used for the remote repository.
42 43 44 45 46 47 48 49 50 |
# File 'lib/pullr/repository.rb', line 42 def infer_scm_from_uri if @uri if (@scm = SCM.infer_from_uri(@uri)) return true end end return false end |
#initialize(options = {}) ⇒ Object
Initializes the repository.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/pullr/repository.rb', line 20 def initialize(={}) @scm = [:scm] @uri = nil case [:uri] when Addressable::URI @uri = [:uri] when Hash @uri = Addressable::URI.new([:uri]) when URI::Generic, String @uri = Addressable::URI.parse([:uri]) end end |