Class: Gitlab::RepositorySizeErrorMessage

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::NumberHelper
Defined in:
lib/gitlab/repository_size_error_message.rb

Instance Method Summary collapse

Constructor Details

#initialize(checker) ⇒ RepositorySizeErrorMessage

Returns a new instance of RepositorySizeErrorMessage.

Parameters:



10
11
12
# File 'lib/gitlab/repository_size_error_message.rb', line 10

def initialize(checker)
  @checker = checker
end

Instance Method Details

#above_size_limit_messageObject



34
35
36
# File 'lib/gitlab/repository_size_error_message.rb', line 34

def above_size_limit_message
  "The size of this repository (#{formatted(current_size)}) exceeds the limit of #{formatted(limit)} by #{formatted(exceeded_size)}. You won't be able to push new code to this project. #{more_info_message}"
end

#commit_errorObject



14
15
16
# File 'lib/gitlab/repository_size_error_message.rb', line 14

def commit_error
  "Your changes could not be committed, #{base_message}"
end

#merge_errorObject



18
19
20
# File 'lib/gitlab/repository_size_error_message.rb', line 18

def merge_error
  "This merge request cannot be merged, #{base_message}"
end

#more_info_messageObject



30
31
32
# File 'lib/gitlab/repository_size_error_message.rb', line 30

def more_info_message
  'Contact your GitLab administrator for more information.'
end

#new_changes_errorObject



26
27
28
# File 'lib/gitlab/repository_size_error_message.rb', line 26

def new_changes_error
  "Your push to this repository cannot be completed as it would exceed the allocated storage for your project. #{more_info_message}"
end

#push_errorObject



22
23
24
# File 'lib/gitlab/repository_size_error_message.rb', line 22

def push_error
  "Your push to this repository cannot be completed #{base_message}. #{more_info_message}"
end