Lines Matching refs:path

19   delegate :path, :empty?, to: :repo
21 def initialize(path)
22 if File.exists?(path)
23 @repo = Rugged::Repository.new(path)
26 @repo = Rugged::Repository.init_at(path, true)
32 FileUtils.chmod_R('g+ws', path)
36 FileUtils.rmtree(self.path)
39 def dir?(path, commit_oid = nil)
40 path ||= '/'
46 object = get_object(rugged_commit, path)
51 def path_exists?(path, commit_oid = nil)
52 return true if path == '/' || path.empty?
55 if !rugged_commit && path.empty?
58 path_exists_rugged?(rugged_commit, path)
62 def paths_starting_with(path, commit_oid = nil)
63 dir = dir?(path, commit_oid) ? path : path.split('/')[0..-2].join('/')
66 contents.map { |git_file| git_file.path }.
67 select { |p| p.starts_with?(path) }
70 def get_file(path, commit_oid = nil)
72 get_file!(path, commit_oid)
78 def get_file!(path, commit_oid = nil)
79 path ||= '/'
81 raise GitRepository::PathNotFoundError if !rugged_commit && path.empty?
83 GitFile.new(self, rugged_commit, path)
86 def get_path_of_dir(oid = nil, path = nil)
87 path ||= ''
88 path = path[0..-2] if(path[-1] == '/')
89 raise PathNotFoundError.new unless path_exists?(path, oid)
91 path
94 def self.directory(path)
95 path.split("/")[0..-2].join("/")
98 def deepest_existing_dir(path, commit_oid = nil)
99 path ||= '/'
100 dirs = path.split('/')
105 path = dirs[0..i].join('/')
106 dir = path if dir?(path, commit_oid)
168 def build_target_path(path, file_name)
169 file_path = path.dup
188 def self.is_repository_with_working_copy?(path)
189 repo = Rugged::Repository.new(path)
196 def self.is_bare_repository?(path)
197 Rugged::Repository.new(path).bare?
219 def path_exists_rugged?(rugged_commit, path = '/')
220 path.empty? || !get_object(rugged_commit, path).nil?