Class: Gitlab::ImportExport::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/import_export/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(config: Gitlab::ImportExport.config_file) ⇒ Config

Returns a new instance of Config.



6
7
8
9
10
11
12
13
14
15
# File 'lib/gitlab/import_export/config.rb', line 6

def initialize(config: Gitlab::ImportExport.config_file)
  @config = config
  @hash = parse_yaml
  @hash.deep_symbolize_keys!
  @ee_hash = @hash.delete(:ee) || {}

  @hash[:tree] = normalize_tree(@hash[:tree])
  @hash[:import_only_tree] = normalize_tree(@hash[:import_only_tree] || {})
  @ee_hash[:tree] = normalize_tree(@ee_hash[:tree] || {})
end

Instance Method Details

#to_hObject

Returns a Hash of the YAML file, including EE specific data if EE is used.



19
20
21
22
23
24
25
# File 'lib/gitlab/import_export/config.rb', line 19

def to_h
  if merge_ee?
    deep_merge(@hash, @ee_hash)
  else
    @hash
  end
end