Returns the file reference for the given absolute path.

 @param  [#to_s] absolute_path
         The absolute path of the file whose reference is needed.

 @return [PBXFileReference] The file reference.
 @return [Nil] If no file reference could be found.
19814
def reference_for_path(absolute_path)
      absolute_pathname = Pathname.new(absolute_path)

      unless absolute_pathname.absolute?
        raise ArgumentError, "Paths must be absolute #{absolute_path}"
      end

      objects.find do |child|
        child.isa == 'PBXFileReference' && child.real_path == absolute_pathname
      end
    end
1057317
def file_path
      directory_name = Rails.root.join(Decidim::DataPortabilityUploader.new.store_dir)
      FileUtils.mkdir_p(directory_name) unless File.exist?(directory_name)
      directory_name + file_name
    end
407124
def to_absolute(link)
      return nil if link.nil?

      # remove anchor
      link = URI.encode(URI.decode(link.to_s.gsub(/#[a-zA-Z0-9_-]*$/,'')))

      relative = URI(link)
      absolute = base ? base.merge(relative) : @url.merge(relative)

      absolute.path = '/' if absolute.path.empty?

      return absolute
    end
1157631
def rel_to(path)
      path = path + '/' unless path.end_with?('/')
      if rel.start_with?(path)
        rel.sub(path, '')
      else
        raise "#{@abs} is not in #{path}"
      end
    end
221612
def get_basedir(path):
  
  return path[:path.index(os.sep)] if os.sep in path else path
557891
def get_absolute_path(*args):
    """"""
    directory = os.path.dirname(os.path.abspath(__file__))
    return os.path.join(directory, *args)
1033439
def find_file(filenames)
      return nil if filenames.nil?

      filenames.each_value do |value|
        if value.is_a? Array
          value.each do |file|
            file_path = Utils.lookup_file file
            return file_path unless file_path.nil?
          end
        else
          file_path = Utils.lookup_file value
          return file_path unless file_path.nil?
        end
      end

      nil
    end
878834
def to_full_path(cls, path):
        
        if isinstance(path, SymbolicReference):
            path = path.path
        full_ref_path = path
        if not cls._common_path_default:
            return full_ref_path
        if not path.startswith(cls._common_path_default + "/"):
            full_ref_path = '%s/%s' % (cls._common_path_default, path)
        return full_ref_path
828686
def relative_path path
      require 'pathname'

      full_path = Pathname.new(path).realpath             # /full/path/to/project/where/is/file.extension
      base_path = Pathname.new(source_directory).realpath # /full/path/to/project/

      full_path.relative_path_from(base_path).to_s        # where/is/file.extension
    end
895086
def relative_path(self, filepath, basepath=None):
        
        if basepath is None:
            basepath = self.basedir
        if not basepath:
            return filepath
        if filepath.startswith(basepath):
            rel = filepath[len(basepath):]
        if rel and rel[0] == os.sep:
            rel = rel[1:]
        return rel
383229
def _get_abs_filepath(self, ifile):
        
        assert ifile is not None
        ifile = ifile[7:] if ifile.startswith('file://') else ifile
        if ifile[0] != '/':
            basedir = os.path.abspath(os.path.dirname(self.config_file))
            ifile = os.path.join(basedir, ifile)
        return 'file://' + ifile
1125595
def file(name)
      files.find {|file| file.file_ref.name == name or file.file_ref.path == name  }
    end
600392
def root_path
      return @root_path if defined?(@root_path)

      root_finder = lambda do |path|
        # Note: To remain compatible with Ruby 1.8, we have to use
        # a `find` here instead of an `each`.
        vf = find_vagrantfile(path, @vagrantfile_name)
        return path if vf
        return nil if path.root? || !File.exist?(path)
        root_finder.call(path.parent)
      end

      @root_path = root_finder.call(cwd)
    end
1229810
def absolute_path(self, path, minify=True):
        '''
        '''
        if minify:
            ending = '.%s' % self.mediatype
            if not path.endswith(ending):
                if self.minified:
                    path = '%s.min' % path
                path = '%s%s' % (path, ending)
        #
        if self.is_relative(path) and self.media_path:
            return '%s%s' % (self.media_path, path)
        elif self.asset_protocol and path.startswith('//'):
            return '%s%s' % (self.asset_protocol, path)
        else:
            return path
1367551
def extract_path(file_path)
      return nil if file_path.nil?
      last_slash = file_path.rindex("/")
      if last_slash
        file_path[0, last_slash]
      end
    end
1338167
def absolute_path(asset_pathname, css_pathname)
      (asset_pathname.absolute? ?
        Pathname.new(File.join(Jammit.public_root, asset_pathname)) :
        css_pathname.dirname + asset_pathname).cleanpath
    end
1155953
function getAbsPath(...relativePathPartsToRoot) {
    const { resolve, join } = path;

    return fs.existsSync(relativePathPartsToRoot[0])
      ? resolve(join(...relativePathPartsToRoot))
      : resolve(join(getRepoRootAbsPath(), ...relativePathPartsToRoot));
  }