Class: Bundler::GitSource
- Inherits:
-
DirectorySource
- Object
- Source
- DirectorySource
- Bundler::GitSource
- Defined in:
- lib/bundler08/source.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Attributes inherited from DirectorySource
Attributes inherited from Source
Instance Method Summary collapse
- #download(spec) ⇒ Object
- #gems ⇒ Object
-
#initialize(bundle, options) ⇒ GitSource
constructor
A new instance of GitSource.
- #local? ⇒ Boolean
- #location ⇒ Object
- #to_s ⇒ Object
Methods inherited from DirectorySource
#==, #add_spec, #locate_gemspecs, #merge_defined_specs, #validate_gemspec
Constructor Details
#initialize(bundle, options) ⇒ GitSource
Returns a new instance of GitSource.
302 303 304 305 306 307 |
# File 'lib/bundler08/source.rb', line 302 def initialize(bundle, ) super @uri = [:uri] @branch = [:branch] || 'master' @ref = [:ref] || "origin/#{@branch}" end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
300 301 302 |
# File 'lib/bundler08/source.rb', line 300 def branch @branch end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
300 301 302 |
# File 'lib/bundler08/source.rb', line 300 def ref @ref end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
300 301 302 |
# File 'lib/bundler08/source.rb', line 300 def uri @uri end |
Instance Method Details
#download(spec) ⇒ Object
325 326 327 |
# File 'lib/bundler08/source.rb', line 325 def download(spec) # Nothing needed here end |
#gems ⇒ Object
319 320 321 322 323 |
# File 'lib/bundler08/source.rb', line 319 def gems update if Bundler.remote? checkout if Bundler.writable? super end |
#local? ⇒ Boolean
309 310 311 312 |
# File 'lib/bundler08/source.rb', line 309 def local? raise SourceNotCached, "Git repository '#{@uri}' has not been cloned yet" unless location.directory? super end |
#location ⇒ Object
314 315 316 317 |
# File 'lib/bundler08/source.rb', line 314 def location # TMP HAX to get the *.gemspec reading to work bundle.gem_path.join('dirs', File.basename(@uri, '.git')) end |
#to_s ⇒ Object
329 330 331 |
# File 'lib/bundler08/source.rb', line 329 def to_s "git: #{uri}" end |