replace Gitolited mixin with Gitlab::ShellAdapter
This commit is contained in:
parent
d6338a8482
commit
0103363191
|
@ -23,7 +23,7 @@
|
|||
require "grit"
|
||||
|
||||
class Project < ActiveRecord::Base
|
||||
include Gitolited
|
||||
include Gitlab::ShellAdapter
|
||||
extend Enumerize
|
||||
|
||||
class TransferError < StandardError; end
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
|
||||
class ProtectedBranch < ActiveRecord::Base
|
||||
include Gitolited
|
||||
include Gitlab::ShellAdapter
|
||||
|
||||
attr_accessible :name
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
|
||||
class UsersProject < ActiveRecord::Base
|
||||
include Gitolited
|
||||
include Gitlab::ShellAdapter
|
||||
|
||||
GUEST = 10
|
||||
REPORTER = 20
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class KeyObserver < ActiveRecord::Observer
|
||||
include Gitolited
|
||||
include Gitlab::ShellAdapter
|
||||
|
||||
def after_save(key)
|
||||
GitlabShellWorker.perform_async(
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Used for transfer project to another namespace
|
||||
#
|
||||
class ProjectTransferService
|
||||
include Gitolited
|
||||
include Gitlab::ShellAdapter
|
||||
|
||||
attr_accessor :project
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class GitlabShellWorker
|
||||
include Sidekiq::Worker
|
||||
include Gitolited
|
||||
include Gitlab::ShellAdapter
|
||||
|
||||
sidekiq_options queue: :gitlab_shell
|
||||
|
||||
|
|
|
@ -3,3 +3,6 @@ require Rails.root.join("lib", "gitlab", "backend", "grack_auth")
|
|||
|
||||
# GIT over SSH
|
||||
require Rails.root.join("lib", "gitlab", "backend", "shell")
|
||||
|
||||
# GitLab shell adapter
|
||||
require Rails.root.join("lib", "gitlab", "backend", "shell_adapter")
|
||||
|
|
12
lib/gitlab/backend/shell_adapter.rb
Normal file
12
lib/gitlab/backend/shell_adapter.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
# == GitLab Shell mixin
|
||||
#
|
||||
# Provide a shortcut to Gitlab::Shell instance by gitlab_shell
|
||||
#
|
||||
module Gitlab
|
||||
module ShellAdapter
|
||||
def gitlab_shell
|
||||
Gitlab::Shell.new
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# == Gitolited mixin
|
||||
#
|
||||
# Provide a shortcut to Gitlab::Shell instance by gitlab_shell
|
||||
#
|
||||
# Used by Project, UsersProject, etc
|
||||
#
|
||||
module Gitolited
|
||||
def gitlab_shell
|
||||
Gitlab::Shell.new
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue