Method: Baps::Executor#initialize

Defined in:
lib/baps/executor.rb

#initialize(path:, use_docker: true, publish: true) ⇒ Executor

Returns a new instance of Executor.

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
12
13
# File 'lib/baps/executor.rb', line 5

def initialize(path:, use_docker: true, publish: true)
  raise ArgumentError.new('Given path does not exist.') unless File.exist?(path)
  @path = File.expand_path(path)
  @use_docker = use_docker
  # TODO refactor this!
  @@publish = publish
  @definitions = definitions_from_directory if File.directory?(@path)
  @definitions = [Definition.new(@path)] if File.file?(@path)
end