Method: Bundler::Source::Path#initialize

Defined in:
lib/bundler/source/path.rb

#initialize(options) ⇒ Path



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/bundler/source/path.rb', line 16

def initialize(options)
  @checksum_store = Checksum::Store.new
  @options = options.dup
  @glob = options["glob"] || DEFAULT_GLOB

  @root_path = options["root_path"] || root

  if options["path"]
    @path = Pathname.new(options["path"])
    expanded_path = expand(@path)
    @path = if @path.relative?
      expanded_path.relative_path_from(File.expand_path(root_path))
    else
      expanded_path
    end
  end

  @name    = options["name"]
  @version = options["version"]

  # Stores the original path. If at any point we move to the
  # cached directory, we still have the original path to copy from.
  @original_path = @path
end