Class: Exekutor::Internal::CLI::Manager::DefaultConfigFileValue

Inherits:
DefaultOptionValue show all
Defined in:
lib/exekutor/internal/cli/manager.rb

Overview

The default value for the config file

Instance Method Summary collapse

Methods inherited from DefaultOptionValue

#to_s, #value

Constructor Details

#initializeDefaultConfigFileValue



323
324
325
326
327
# File 'lib/exekutor/internal/cli/manager.rb', line 323

def initialize
  super("    \"config/exekutor.yml\", overridden by \"config/exekutor.%{identifier}.yml\" if an identifier is specified\n  DESC\nend\n")

Instance Method Details

#to_a(identifier = nil) ⇒ Array<String>



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/exekutor/internal/cli/manager.rb', line 331

def to_a(identifier = nil)
  files = []
  %w[config/exekutor.yml config/exekutor.yaml].each do |path|
    path = Rails.root.join(path)
    if File.exist? path
      files.append path
      break
    end
  end
  if identifier.present?
    %W[config/exekutor.#{identifier}.yml config/exekutor.#{identifier}.yaml].each do |path|
      path = Rails.root.join(path)
      if File.exist? path
        files.append path
        break
      end
    end
  end
  files
end