Class/Module Index [+]

Quicksearch

Bundler::Source::Git

Attributes

options[R]
ref[R]
submodules[R]
uri[R]

Public Class Methods

from_lock(options) click to toggle source
# File lib/bundler/source.rb, line 496
def self.from_lock(options)
  new(options.merge("uri" => options.delete("remote")))
end
new(options) click to toggle source
# File lib/bundler/source.rb, line 482
def initialize(options)
  super

  # stringify options that could be set as symbols
  %(ref branch tag revision).each{|k| options[k] = options[k].to_s if options[k] }

  @uri        = options["uri"]
  @ref        = options["ref"] || options["branch"] || options["tag"] || 'master'
  @revision   = options["revision"]
  @submodules = options["submodules"]
  @update     = false
  @installed  = nil
end

Public Instance Methods

==(o) click to toggle source
Alias for: eql?
eql?(o) click to toggle source
# File lib/bundler/source.rb, line 511
def eql?(o)
  Git === o            &&
  uri == o.uri         &&
  ref == o.ref         &&
  name == o.name       &&
  version == o.version &&
  submodules == o.submodules
end
Also aliased as: ==
install(spec) click to toggle source
# File lib/bundler/source.rb, line 558
def install(spec)
  Bundler.ui.info "Using #{spec.name} (#{spec.version}) from #{to_s} "

  unless @installed
    Bundler.ui.debug "  * Checking out revision: #{ref}"
    checkout if allow_git_ops?
    @installed = true
  end
  generate_bin(spec)
end
load_spec_files() click to toggle source
# File lib/bundler/source.rb, line 569
def load_spec_files
  super
rescue PathError, GitError
  raise GitError, "#{to_s} is not checked out. Please run `bundle install`"
end
name() click to toggle source
# File lib/bundler/source.rb, line 527
def name
  File.basename(@uri, '.git')
end
path() click to toggle source
# File lib/bundler/source.rb, line 531
def path
  @install_path ||= begin
    git_scope = "#{base_name}-#{shortref_for_path(revision)}"

    if Bundler.requires_sudo?
      Bundler.user_bundle_path.join(Bundler.ruby_scope).join(git_scope)
    else
      Bundler.install_path.join(git_scope)
    end
  end
end
specs() click to toggle source

TODO: actually cache git specs

# File lib/bundler/source.rb, line 548
def specs
  if allow_git_ops? && !@update
    # Start by making sure the git cache is up to date
    cache
    checkout
    @update = true
  end
  local_specs
end
to_lock() click to toggle source
# File lib/bundler/source.rb, line 500
def to_lock
  out = "GIT\n"
  out << "  remote: #{@uri}\n"
  out << "  revision: #{revision}\n"
  %(ref branch tag submodules).each do |opt|
    out << "  #{opt}: #{options[opt]}\n" if options[opt]
  end
  out << "  glob: #{@glob}\n" unless @glob == DEFAULT_GLOB
  out << "  specs:\n"
end
to_s() click to toggle source
# File lib/bundler/source.rb, line 522
def to_s
  sref = options["ref"] ? shortref_for_display(options["ref"]) : ref
  "#{uri} (at #{sref})"
end
unlock!() click to toggle source
# File lib/bundler/source.rb, line 543
def unlock!
  @revision = nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.