# File lib/bundler/source.rb, line 498 def self.from_lock(options) new(options.merge("uri" => options.delete("remote"))) end
# File lib/bundler/source.rb, line 484 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
# File lib/bundler/source.rb, line 577 def cache_path @cache_path ||= begin git_scope = "#{base_name}-#{uri_hash}" if Bundler.requires_sudo? Bundler.user_bundle_path.join("cache/git", git_scope) else Bundler.cache.join("git", git_scope) end end end
# File lib/bundler/source.rb, line 513 def eql?(o) Git === o && uri == o.uri && ref == o.ref && name == o.name && version == o.version && submodules == o.submodules end
# File lib/bundler/source.rb, line 560 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
# File lib/bundler/source.rb, line 571 def load_spec_files super rescue PathError, GitError raise GitError, "#{to_s} is not checked out. Please run `bundle install`" end
# File lib/bundler/source.rb, line 529 def name File.basename(@uri, '.git') end
# File lib/bundler/source.rb, line 533 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
TODO: actually cache git specs
# File lib/bundler/source.rb, line 550 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
# File lib/bundler/source.rb, line 502 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
Generated with the Darkfish Rdoc Generator 2.