INNER CODE UNIT · Ruby

initialize

EugenMayer/docker-sync · lib/docker-sync/compose.rb:8

  def initialize(global_options)
    @global_options = global_options

    ### production docker-compose.yml
    compose_files = [File.expand_path('docker-compose.yml')]
    if @global_options.key?('compose-file-path')
      compose_files = [] # replace
      apply_path_settings(compose_files, @global_options['compose-file-path'], 'compose-file-path')
    end

    ### development docker-compose-dev.yml
    if @global_options.key?('compose-dev-file-path')
      # explicit path given
      apply_path_settings(compose_files, @global_options['compose-dev-file-path'], 'compose-dev-file-path')
      say_status 'ok',"Found explicit docker-compose-dev.yml and using it from #{@global_options['compose-dev-file-path']}", :green
    else
      # try to find docker-compose-dev.yml
      e = compose_files.to_enum

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…