summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-21 21:01:14 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-21 21:01:14 +0200
commit0103363191d63d9a81bfeba61abf443532f47183 (patch)
tree04a27645758a53dd2ae91db40da7e4d5acb32bb4
parentd6338a8482920fc69cc016e5da796194034a1861 (diff)
downloadgitlab-ce-0103363191d63d9a81bfeba61abf443532f47183.tar.gz
replace Gitolited mixin with Gitlab::ShellAdapter
-rw-r--r--app/models/project.rb2
-rw-r--r--app/models/protected_branch.rb2
-rw-r--r--app/models/users_project.rb2
-rw-r--r--app/observers/key_observer.rb2
-rw-r--r--app/services/project_transfer_service.rb2
-rw-r--r--app/workers/gitlab_shell_worker.rb2
-rw-r--r--config/initializers/5_backend.rb3
-rw-r--r--lib/gitlab/backend/shell_adapter.rb12
-rw-r--r--lib/gitolited.rb11
9 files changed, 21 insertions, 17 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index b13b2918652..23eb7f90194 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -23,7 +23,7 @@
require "grit"
class Project < ActiveRecord::Base
- include Gitolited
+ include Gitlab::ShellAdapter
extend Enumerize
class TransferError < StandardError; end
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb
index 57229d50759..16379720e59 100644
--- a/app/models/protected_branch.rb
+++ b/app/models/protected_branch.rb
@@ -10,7 +10,7 @@
#
class ProtectedBranch < ActiveRecord::Base
- include Gitolited
+ include Gitlab::ShellAdapter
attr_accessible :name
diff --git a/app/models/users_project.rb b/app/models/users_project.rb
index 486aaa6966a..8051c0604d9 100644
--- a/app/models/users_project.rb
+++ b/app/models/users_project.rb
@@ -11,7 +11,7 @@
#
class UsersProject < ActiveRecord::Base
- include Gitolited
+ include Gitlab::ShellAdapter
GUEST = 10
REPORTER = 20
diff --git a/app/observers/key_observer.rb b/app/observers/key_observer.rb
index 9d02cbc16f7..0bc71a663e8 100644
--- a/app/observers/key_observer.rb
+++ b/app/observers/key_observer.rb
@@ -1,5 +1,5 @@
class KeyObserver < ActiveRecord::Observer
- include Gitolited
+ include Gitlab::ShellAdapter
def after_save(key)
GitlabShellWorker.perform_async(
diff --git a/app/services/project_transfer_service.rb b/app/services/project_transfer_service.rb
index 2ff1aa919df..719e0d3db23 100644
--- a/app/services/project_transfer_service.rb
+++ b/app/services/project_transfer_service.rb
@@ -3,7 +3,7 @@
# Used for transfer project to another namespace
#
class ProjectTransferService
- include Gitolited
+ include Gitlab::ShellAdapter
attr_accessor :project
diff --git a/app/workers/gitlab_shell_worker.rb b/app/workers/gitlab_shell_worker.rb
index 0a921b1bd44..cfeda88bbc5 100644
--- a/app/workers/gitlab_shell_worker.rb
+++ b/app/workers/gitlab_shell_worker.rb
@@ -1,6 +1,6 @@
class GitlabShellWorker
include Sidekiq::Worker
- include Gitolited
+ include Gitlab::ShellAdapter
sidekiq_options queue: :gitlab_shell
diff --git a/config/initializers/5_backend.rb b/config/initializers/5_backend.rb
index 73436608c93..7c2e7f39000 100644
--- a/config/initializers/5_backend.rb
+++ b/config/initializers/5_backend.rb
@@ -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")
diff --git a/lib/gitlab/backend/shell_adapter.rb b/lib/gitlab/backend/shell_adapter.rb
new file mode 100644
index 00000000000..f247f4593d7
--- /dev/null
+++ b/lib/gitlab/backend/shell_adapter.rb
@@ -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
+
diff --git a/lib/gitolited.rb b/lib/gitolited.rb
deleted file mode 100644
index a7fc4148106..00000000000
--- a/lib/gitolited.rb
+++ /dev/null
@@ -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