lib/ refactoring. Module Gitlabhq renamed to Gitlab

This commit is contained in:
randx 2012-05-26 13:37:49 +03:00
parent 8ceb94081a
commit 3272620f72
20 changed files with 87 additions and 85 deletions

View file

@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :abilities, :can?
rescue_from Gitlabhq::Gitolite::AccessDenied do |exception|
rescue_from Gitlab::Gitolite::AccessDenied do |exception|
render "errors/gitolite", :layout => "error"
end

View file

@ -45,7 +45,7 @@ class ProjectsController < ApplicationController
format.js
end
end
rescue Gitlabhq::Gitolite::AccessDenied
rescue Gitlab::Gitolite::AccessDenied
render :js => "location.href = '#{errors_githost_path}'" and return
rescue StandardError => ex
@project.errors.add(:base, "Cant save project. Please try again later")

View file

@ -143,6 +143,6 @@ module ApplicationHelper
end
def string_to_utf8 str
Gitlabhq::Encode.utf8 str
Gitlab::Encode.utf8 str
end
end

View file

@ -1,6 +1,6 @@
class Commit
include ActiveModel::Conversion
include Gitlabhq::Encode
include Gitlab::Encode
extend ActiveModel::Naming
attr_accessor :commit

View file

@ -38,14 +38,14 @@ class Key < ActiveRecord::Base
end
def update_repository
Gitlabhq::GitHost.system.new.configure do |c|
Gitlab::GitHost.system.new.configure do |c|
c.update_keys(identifier, key)
c.update_projects(projects)
end
end
def repository_delete_key
Gitlabhq::GitHost.system.new.configure do |c|
Gitlab::GitHost.system.new.configure do |c|
#delete key file is there is no identically deploy keys
if !is_deploy_key || Key.where(:identifier => identifier).count() == 0
c.delete_key(identifier)

View file

@ -82,7 +82,7 @@ class MergeRequest < ActiveRecord::Base
end
def check_if_can_be_merged
self.state = if GitlabMerge.new(self, self.author).can_be_merged?
self.state = if Gitlab::Merge.new(self, self.author).can_be_merged?
CAN_BE_MERGED
else
CANNOT_BE_MERGED
@ -184,7 +184,7 @@ class MergeRequest < ActiveRecord::Base
end
def automerge!(current_user)
if GitlabMerge.new(self, current_user).merge
if Gitlab::Merge.new(self, current_user).merge
self.merge!(current_user.id)
true
end

View file

@ -38,7 +38,7 @@ module Project::RepositoryTrait
end
def satellite
@satellite ||= Gitlabhq::Satellite.new(self)
@satellite ||= Gitlab::Satellite.new(self)
end
def write_hook(name, content)
@ -65,7 +65,7 @@ module Project::RepositoryTrait
end
def url_to_repo
Gitlabhq::GitHost.url_to_repo(path)
Gitlab::GitHost.url_to_repo(path)
end
def path_to_repo
@ -73,13 +73,13 @@ module Project::RepositoryTrait
end
def update_repository
Gitlabhq::GitHost.system.update_project(path, self)
Gitlab::GitHost.system.update_project(path, self)
write_hooks if File.exists?(path_to_repo)
end
def destroy_repository
Gitlabhq::GitHost.system.destroy_project(self)
Gitlab::GitHost.system.destroy_project(self)
end
def repo_exists?

View file

@ -7,7 +7,7 @@ class ProtectedBranch < ActiveRecord::Base
after_destroy :update_repository
def update_repository
Gitlabhq::GitHost.system.update_project(project.path, project)
Gitlab::GitHost.system.update_project(project.path, project)
end
def commit

View file

@ -58,7 +58,7 @@ class UsersProject < ActiveRecord::Base
end
def update_repository
Gitlabhq::GitHost.system.new.configure do |c|
Gitlab::GitHost.system.new.configure do |c|
c.update_project(project.path, project)
end
end