Class: Gitlab::ImportExport::LfsRestorer
- Inherits:
-
Object
- Object
- Gitlab::ImportExport::LfsRestorer
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/import_export/lfs_restorer.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
Returns the value of attribute project.
-
#shared ⇒ Object
Returns the value of attribute shared.
Instance Method Summary collapse
-
#initialize(project:, shared:) ⇒ LfsRestorer
constructor
A new instance of LfsRestorer.
- #restore ⇒ Object
Constructor Details
#initialize(project:, shared:) ⇒ LfsRestorer
Returns a new instance of LfsRestorer.
10 11 12 13 |
# File 'lib/gitlab/import_export/lfs_restorer.rb', line 10 def initialize(project:, shared:) @project = project @shared = shared end |
Instance Attribute Details
#project ⇒ Object
Returns the value of attribute project.
8 9 10 |
# File 'lib/gitlab/import_export/lfs_restorer.rb', line 8 def project @project end |
#shared ⇒ Object
Returns the value of attribute shared.
8 9 10 |
# File 'lib/gitlab/import_export/lfs_restorer.rb', line 8 def shared @shared end |
Instance Method Details
#restore ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gitlab/import_export/lfs_restorer.rb', line 15 def restore return true if lfs_file_paths.empty? lfs_file_paths.each do |file_path| link_or_create_lfs_object!(file_path) end true rescue StandardError => e shared.error(e) false end |