Class: Datadog::CI::CLI::Command::Exec

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/ci/cli/command/exec.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Exec

Returns a new instance of Exec.



9
10
11
12
13
# File 'lib/datadog/ci/cli/command/exec.rb', line 9

def initialize(args)
  super()

  @args = args
end

Instance Method Details

#execObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/datadog/ci/cli/command/exec.rb', line 15

def exec
  rubyopts = [
    "-rdatadog/ci/auto_instrument"
  ]

  existing_rubyopt = ENV["RUBYOPT"]
  ENV["RUBYOPT"] = existing_rubyopt ? "#{existing_rubyopt} #{rubyopts.join(" ")}" : rubyopts.join(" ")

  Kernel.exec(*@args)
end