Skip to content

Commit

Permalink
replace Gitolited mixin with Gitlab::ShellAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Mar 21, 2013
1 parent d6338a8 commit 0103363
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/models/project.rb
Expand Up @@ -23,7 +23,7 @@
require "grit"

class Project < ActiveRecord::Base
include Gitolited
include Gitlab::ShellAdapter
extend Enumerize

class TransferError < StandardError; end
Expand Down
2 changes: 1 addition & 1 deletion app/models/protected_branch.rb
Expand Up @@ -10,7 +10,7 @@
#

class ProtectedBranch < ActiveRecord::Base
include Gitolited
include Gitlab::ShellAdapter

attr_accessible :name

Expand Down
2 changes: 1 addition & 1 deletion app/models/users_project.rb
Expand Up @@ -11,7 +11,7 @@
#

class UsersProject < ActiveRecord::Base
include Gitolited
include Gitlab::ShellAdapter

GUEST = 10
REPORTER = 20
Expand Down
2 changes: 1 addition & 1 deletion 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(
Expand Down
2 changes: 1 addition & 1 deletion app/services/project_transfer_service.rb
Expand Up @@ -3,7 +3,7 @@
# Used for transfer project to another namespace
#
class ProjectTransferService
include Gitolited
include Gitlab::ShellAdapter

attr_accessor :project

Expand Down
2 changes: 1 addition & 1 deletion 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

Expand Down
3 changes: 3 additions & 0 deletions config/initializers/5_backend.rb
Expand Up @@ -3,3 +3,6 @@

# GIT over SSH
require Rails.root.join("lib", "gitlab", "backend", "shell")

# GitLab shell adapter
require Rails.root.join("lib", "gitlab", "backend", "shell_adapter")
12 changes: 12 additions & 0 deletions 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

11 changes: 0 additions & 11 deletions lib/gitolited.rb

This file was deleted.

0 comments on commit 0103363

Please sign in to comment.