class CookbookOmnifetch::PathLocation

def ==(other)

def ==(other)
  other.is_a?(PathLocation) &&
    other.metadata? == metadata? &&
    other.relative_path == relative_path
end

def cached_cookbook

Other tags:
    See: BaseLocation#cached_cookbook -
def cached_cookbook
  @cached_cookbook ||= CookbookOmnifetch.cached_cookbook_class.from_path(expanded_path)
end

def expanded_path

Returns:
  • (Pathname) -
def expanded_path
  # TODO: this requires Berkshelf::Dependency to provide a delegate (ish) method that does
  #
  # def relative_paths_root
  #   File.dirname(berksfile.filepath)
  # end
  @expanded_path ||= Pathname.new File.expand_path(options[:path], dependency.relative_paths_root)
end

def inspect

def inspect
  "#<CookbookOmnifetch::PathLocation metadata: #{metadata?}, path: #{relative_path}>"
end

def install

Other tags:
    See: BaseLocation#install -
def install
  validate_cached!(expanded_path)
end

def install_path

def install_path
  relative_path
end

def installed?

Other tags:
    See: BaseLocation#installed? -
def installed?
  false
end

def lock_data

def lock_data
  out = {}
  out["path"] = relative_path.to_s
  out["metadata"] = true if metadata?
  out
end

def metadata?

Returns:
  • (Boolean) -
def metadata?
  !!options[:metadata]
end

def relative_path

Returns:
  • (Pathname) -
def relative_path
  # TODO: this requires Berkshelf::Dependency to provide a delegate (ish) method that does
  #
  # def relative_paths_root
  #   File.dirname(berksfile.filepath)
  # end
  @relative_path ||= expanded_path.relative_path_from(Pathname.new(dependency.relative_paths_root))
end

def to_lock

def to_lock
  out =  "    path: #{relative_path}\n"
  out << "    metadata: true\n" if metadata?
  out
end

def to_s

def to_s
  "source at #{relative_path}"
end