Class: UffizziCore::ComposeFile::ServicesOptions::EnvFileService

Inherits:
Object
  • Object
show all
Defined in:
app/services/uffizzi_core/compose_file/services_options/env_file_service.rb

Class Method Summary collapse

Class Method Details

.parse(env_file) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/services/uffizzi_core/compose_file/services_options/env_file_service.rb', line 5

def parse(env_file)
  env_files = case env_file
              when String
                [prepare_file_path(env_file)]
              when Array
                env_file.map { |env_file_path| prepare_file_path(env_file_path) }
              else
                raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.invalid_type', option: :env_file)
  end

  check_duplicates(env_files)

  env_files
end