Class: Packages::Debian::ExtractChangesMetadataService

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/services/packages/debian/extract_changes_metadata_service.rb

Constant Summary collapse

ExtractionError =
Class.new(StandardError)

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(package_file) ⇒ ExtractChangesMetadataService

Returns a new instance of ExtractChangesMetadataService.


10
11
12
13
# File 'app/services/packages/debian/extract_changes_metadata_service.rb', line 10

def initialize(package_file)
  @package_file = package_file
  @entries = {}
end

Instance Method Details

#executeObject


15
16
17
18
19
20
21
22
23
24
# File 'app/services/packages/debian/extract_changes_metadata_service.rb', line 15

def execute
  {
    file_type: file_type,
    architecture: [:architecture],
    fields: fields,
    files: files
  }
rescue ActiveModel::ValidationError => e
  raise ExtractionError, e.message
end