Class: Bundler::GitSource

Inherits:
DirectorySource show all
Defined in:
lib/bowline/bundler/source.rb

Instance Attribute Summary collapse

Attributes inherited from DirectorySource

#required_specs, #specs

Attributes inherited from Source

#bundle, #local

Instance Method Summary collapse

Methods inherited from DirectorySource

#==, #add_spec, #can_be_local?, #locate_gemspecs, #merge_defined_specs, #validate_gemspec

Constructor Details

#initialize(bundle, options) ⇒ GitSource

Returns a new instance of GitSource.



303
304
305
306
307
308
# File 'lib/bowline/bundler/source.rb', line 303

def initialize(bundle, options)
  super
  @uri = options[:uri]
  @branch = options[:branch] || 'master'
  @ref = options[:ref] || "origin/#{@branch}"
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



301
302
303
# File 'lib/bowline/bundler/source.rb', line 301

def branch
  @branch
end

#refObject (readonly)

Returns the value of attribute ref.



301
302
303
# File 'lib/bowline/bundler/source.rb', line 301

def ref
  @ref
end

#uriObject (readonly)

Returns the value of attribute uri.



301
302
303
# File 'lib/bowline/bundler/source.rb', line 301

def uri
  @uri
end

Instance Method Details

#download(spec) ⇒ Object



321
322
323
# File 'lib/bowline/bundler/source.rb', line 321

def download(spec)
  # Nothing needed here
end

#gemsObject



315
316
317
318
319
# File 'lib/bowline/bundler/source.rb', line 315

def gems
  update
  checkout
  super
end

#locationObject



310
311
312
313
# File 'lib/bowline/bundler/source.rb', line 310

def location
  # TMP HAX to get the *.gemspec reading to work
  bundle.gem_path.join('dirs', File.basename(@uri, '.git'))
end

#to_sObject



325
326
327
# File 'lib/bowline/bundler/source.rb', line 325

def to_s
  "git: #{uri}"
end