Schema Information
Table name: namespaces
id :integer not null, primary key name :string(255) not null path :string(255) not null owner_id :integer not null created_at :datetime not null updated_at :datetime not null type :string(255)
Methods
- D
- E
- G
- H
- M
- N
- R
- S
- T
- U
Class Public methods
search(query)
Link
Source: show
# File app/models/namespace.rb, line 37 def self.search query where("name LIKE :query OR path LIKE :query", query: "%#{query}%") end
Instance Public methods
dir_exists?()
Link
Source: show
# File app/models/namespace.rb, line 59 def dir_exists? File.exists?(namespace_full_path) end
ensure_dir_exist()
Link
Source: show
# File app/models/namespace.rb, line 53 def ensure_dir_exist unless dir_exists? system("mkdir -m 770 #{namespace_full_path}") end end
human_name()
Link
Source: show
# File app/models/namespace.rb, line 49 def human_name owner_name end
move_dir()
Link
Source: show
# File app/models/namespace.rb, line 67 def move_dir if path_changed? old_path = File.join(Gitlab.config.gitolite.repos_path, path_was) new_path = File.join(Gitlab.config.gitolite.repos_path, path) if File.exists?(new_path) raise "Already exists" end if system("mv #{old_path} #{new_path}") send_update_instructions @require_update_gitolite = true else raise "Namespace move error #{old_path} #{new_path}" end end end
namespace_full_path()
Link
Source: show
# File app/models/namespace.rb, line 63 def namespace_full_path @namespace_full_path ||= File.join(Gitlab.config.gitolite.repos_path, path) end
rm_dir()
Link
Source: show
# File app/models/namespace.rb, line 89 def rm_dir dir_path = File.join(Gitlab.config.gitolite.repos_path, path) system("rm -rf #{dir_path}") end