Class: Exekutor::Internal::CLI::Manager::DefaultConfigFileValue
- Inherits:
-
DefaultOptionValue
- Object
- DefaultOptionValue
- Exekutor::Internal::CLI::Manager::DefaultConfigFileValue
- Defined in:
- lib/exekutor/internal/cli/manager.rb
Overview
The default value for the config file
Instance Method Summary collapse
-
#initialize ⇒ DefaultConfigFileValue
constructor
A new instance of DefaultConfigFileValue.
-
#to_a(identifier = nil) ⇒ Array<String>
The paths to the configfiles to load.
Methods inherited from DefaultOptionValue
Constructor Details
#initialize ⇒ DefaultConfigFileValue
Returns a new instance of DefaultConfigFileValue.
323 324 325 326 327 |
# File 'lib/exekutor/internal/cli/manager.rb', line 323 def initialize super(<<~DESC) "config/exekutor.yml", overridden by "config/exekutor.%{identifier}.yml" if an identifier is specified DESC end |
Instance Method Details
#to_a(identifier = nil) ⇒ Array<String>
Returns the paths to the configfiles to load.
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 |