Class: Gitlab::GitPostReceive

Inherits:
Object
  • Object
show all
Includes:
Identifier
Defined in:
lib/gitlab/git_post_receive.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo_path, identifier, changes) ⇒ GitPostReceive

Returns a new instance of GitPostReceive


6
7
8
9
10
11
12
13
14
15
# File 'lib/gitlab/git_post_receive.rb', line 6

def initialize(repo_path, identifier, changes)
  repo_path.gsub!(/\.git\z/, '')
  repo_path.gsub!(/\A\//, '')

  @repo_path = repo_path
  @identifier = identifier
  @changes = deserialize_changes(changes)

  retrieve_project_and_type
end

Instance Attribute Details

#changesObject (readonly)

Returns the value of attribute changes


4
5
6
# File 'lib/gitlab/git_post_receive.rb', line 4

def changes
  @changes
end

#identifierObject (readonly)

Returns the value of attribute identifier


4
5
6
# File 'lib/gitlab/git_post_receive.rb', line 4

def identifier
  @identifier
end

#projectObject (readonly)

Returns the value of attribute project


4
5
6
# File 'lib/gitlab/git_post_receive.rb', line 4

def project
  @project
end

#repo_pathObject (readonly)

Returns the value of attribute repo_path


4
5
6
# File 'lib/gitlab/git_post_receive.rb', line 4

def repo_path
  @repo_path
end

Instance Method Details

#identify(revision) ⇒ Object


25
26
27
# File 'lib/gitlab/git_post_receive.rb', line 25

def identify(revision)
  super(identifier, project, revision)
end

#regular_project?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'lib/gitlab/git_post_receive.rb', line 21

def regular_project?
  @type == :project
end

#wiki?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'lib/gitlab/git_post_receive.rb', line 17

def wiki?
  @type == :wiki
end