Class: Gitlab::ImportExport::RepoSaver
- Inherits:
-
Object
- Object
- Gitlab::ImportExport::RepoSaver
- Includes:
- CommandLineUtil, DurationMeasuring
- Defined in:
- lib/gitlab/import_export/repo_saver.rb
Direct Known Subclasses
Constant Summary
Constants included from CommandLineUtil
CommandLineUtil::CLEAN_DIR_IGNORE_FILE_NAMES, CommandLineUtil::CommandLineUtilError, CommandLineUtil::DEFAULT_DIR_MODE, CommandLineUtil::FileOversizedError, CommandLineUtil::HardLinkError, CommandLineUtil::UNTAR_MASK
Instance Attribute Summary collapse
-
#exportable ⇒ Object
readonly
Returns the value of attribute exportable.
-
#shared ⇒ Object
readonly
Returns the value of attribute shared.
Instance Method Summary collapse
-
#initialize(exportable:, shared:) ⇒ RepoSaver
constructor
A new instance of RepoSaver.
- #repository ⇒ Object
- #save ⇒ Object
Methods included from CommandLineUtil
#gunzip, #gzip, #gzip_with_options, #mkdir_p, #tar_cf, #tar_czf, #untar_xf, #untar_zxf
Constructor Details
#initialize(exportable:, shared:) ⇒ RepoSaver
Returns a new instance of RepoSaver.
11 12 13 14 |
# File 'lib/gitlab/import_export/repo_saver.rb', line 11 def initialize(exportable:, shared:) @exportable = exportable @shared = shared end |
Instance Attribute Details
#exportable ⇒ Object (readonly)
Returns the value of attribute exportable.
9 10 11 |
# File 'lib/gitlab/import_export/repo_saver.rb', line 9 def exportable @exportable end |
#shared ⇒ Object (readonly)
Returns the value of attribute shared.
9 10 11 |
# File 'lib/gitlab/import_export/repo_saver.rb', line 9 def shared @shared end |
Instance Method Details
#repository ⇒ Object
25 26 27 |
# File 'lib/gitlab/import_export/repo_saver.rb', line 25 def repository @repository ||= @exportable.repository end |
#save ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/gitlab/import_export/repo_saver.rb', line 16 def save with_duration_measuring do # it's ok to have no repo break true unless repository_exists? bundle_to_disk end end |