Class: Gitlab::ImportExport::AvatarSaver
- Inherits:
-
Object
- Object
- Gitlab::ImportExport::AvatarSaver
- Includes:
- DurationMeasuring
- Defined in:
- lib/gitlab/import_export/avatar_saver.rb
Instance Method Summary collapse
-
#initialize(project:, shared:) ⇒ AvatarSaver
constructor
A new instance of AvatarSaver.
- #save ⇒ Object
Constructor Details
#initialize(project:, shared:) ⇒ AvatarSaver
Returns a new instance of AvatarSaver.
8 9 10 11 |
# File 'lib/gitlab/import_export/avatar_saver.rb', line 8 def initialize(project:, shared:) @project = project @shared = shared end |
Instance Method Details
#save ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gitlab/import_export/avatar_saver.rb', line 13 def save with_duration_measuring do break true unless @project.avatar.exists? Gitlab::ImportExport::UploadsManager.new( project: @project, shared: @shared, relative_export_path: 'avatar' ).save end rescue StandardError => e @shared.error(e) false end |