Class: Gitlab::RepositorySizeErrorMessage
- Inherits:
-
Object
- Object
- Gitlab::RepositorySizeErrorMessage
- Includes:
- ActiveSupport::NumberHelper
- Defined in:
- lib/gitlab/repository_size_error_message.rb
Instance Method Summary collapse
- #above_size_limit_message ⇒ Object
- #commit_error ⇒ Object
-
#initialize(checker) ⇒ RepositorySizeErrorMessage
constructor
A new instance of RepositorySizeErrorMessage.
- #merge_error ⇒ Object
- #more_info_message ⇒ Object
- #new_changes_error ⇒ Object
- #push_error(change_size = 0) ⇒ Object
Constructor Details
#initialize(checker) ⇒ RepositorySizeErrorMessage
Returns a new instance of RepositorySizeErrorMessage.
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_message ⇒ Object
38 39 40 |
# File 'lib/gitlab/repository_size_error_message.rb', line 38 def "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. #{}" end |
#commit_error ⇒ Object
14 15 16 |
# File 'lib/gitlab/repository_size_error_message.rb', line 14 def commit_error "Your changes could not be committed, #{}" end |
#merge_error ⇒ Object
18 19 20 |
# File 'lib/gitlab/repository_size_error_message.rb', line 18 def merge_error "This merge request cannot be merged, #{}" end |
#more_info_message ⇒ Object
34 35 36 |
# File 'lib/gitlab/repository_size_error_message.rb', line 34 def 'Please contact your GitLab administrator for more information.' end |
#new_changes_error ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/gitlab/repository_size_error_message.rb', line 26 def new_changes_error if additional_repo_storage_available? "Your push to this repository has been rejected because it would exceed storage limits. #{}" else "Your push to this repository would cause it to exceed the size limit of #{formatted(limit)} so it has been rejected. #{}" end end |
#push_error(change_size = 0) ⇒ Object
22 23 24 |
# File 'lib/gitlab/repository_size_error_message.rb', line 22 def push_error(change_size = 0) "Your push has been rejected, #{(change_size)}. #{}" end |