Commit 0103363191d63d9a81bfeba61abf443532f47183

Authored by Dmitriy Zaporozhets
1 parent d6338a84

replace Gitolited mixin with Gitlab::ShellAdapter

app/models/project.rb
... ... @@ -23,7 +23,7 @@
23 23 require "grit"
24 24  
25 25 class Project < ActiveRecord::Base
26   - include Gitolited
  26 + include Gitlab::ShellAdapter
27 27 extend Enumerize
28 28  
29 29 class TransferError < StandardError; end
... ...
app/models/protected_branch.rb
... ... @@ -10,7 +10,7 @@
10 10 #
11 11  
12 12 class ProtectedBranch < ActiveRecord::Base
13   - include Gitolited
  13 + include Gitlab::ShellAdapter
14 14  
15 15 attr_accessible :name
16 16  
... ...
app/models/users_project.rb
... ... @@ -11,7 +11,7 @@
11 11 #
12 12  
13 13 class UsersProject < ActiveRecord::Base
14   - include Gitolited
  14 + include Gitlab::ShellAdapter
15 15  
16 16 GUEST = 10
17 17 REPORTER = 20
... ...
app/observers/key_observer.rb
1 1 class KeyObserver < ActiveRecord::Observer
2   - include Gitolited
  2 + include Gitlab::ShellAdapter
3 3  
4 4 def after_save(key)
5 5 GitlabShellWorker.perform_async(
... ...
app/services/project_transfer_service.rb
... ... @@ -3,7 +3,7 @@
3 3 # Used for transfer project to another namespace
4 4 #
5 5 class ProjectTransferService
6   - include Gitolited
  6 + include Gitlab::ShellAdapter
7 7  
8 8 attr_accessor :project
9 9  
... ...
app/workers/gitlab_shell_worker.rb
1 1 class GitlabShellWorker
2 2 include Sidekiq::Worker
3   - include Gitolited
  3 + include Gitlab::ShellAdapter
4 4  
5 5 sidekiq_options queue: :gitlab_shell
6 6  
... ...
config/initializers/5_backend.rb
... ... @@ -3,3 +3,6 @@ require Rails.root.join(&quot;lib&quot;, &quot;gitlab&quot;, &quot;backend&quot;, &quot;grack_auth&quot;)
3 3  
4 4 # GIT over SSH
5 5 require Rails.root.join("lib", "gitlab", "backend", "shell")
  6 +
  7 +# GitLab shell adapter
  8 +require Rails.root.join("lib", "gitlab", "backend", "shell_adapter")
... ...
lib/gitlab/backend/shell_adapter.rb 0 → 100644
... ... @@ -0,0 +1,12 @@
  1 +# == GitLab Shell mixin
  2 +#
  3 +# Provide a shortcut to Gitlab::Shell instance by gitlab_shell
  4 +#
  5 +module Gitlab
  6 + module ShellAdapter
  7 + def gitlab_shell
  8 + Gitlab::Shell.new
  9 + end
  10 + end
  11 +end
  12 +
... ...
lib/gitolited.rb
... ... @@ -1,11 +0,0 @@
1   -# == Gitolited mixin
2   -#
3   -# Provide a shortcut to Gitlab::Shell instance by gitlab_shell
4   -#
5   -# Used by Project, UsersProject, etc
6   -#
7   -module Gitolited
8   - def gitlab_shell
9   - Gitlab::Shell.new
10   - end
11   -end