Module: Mutineer::CommandRedact

Defined in:
lib/mutineer/command_redact.rb

Overview

Starts OutputFilter for one --test-command Ruby process (#457).

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.install ⇒ Symbol

Remember dotenv URLs in this working directory and copy stdout and stderr through redaction. A failed install leaves the descriptors where they were, and the command still runs.

Returns:



21
22
23
24
# File 'lib/mutineer/command_redact.rb', line 21

def install
  Redaction.extra_urls = DatabaseUrls.from_files(working_directory)
  OutputFilter.install
end

.working_directory ⇒ String?

The working directory, or nil when it was removed. A command that runs from a deleted directory must still start.

Returns:

  • (String, nil)


30
31
32
33
34
# File 'lib/mutineer/command_redact.rb', line 30

def working_directory
  Dir.pwd
rescue SystemCallError
  nil
end

Instance Method Details

#install ⇒ Symbol (private)

Remember dotenv URLs in this working directory and copy stdout and stderr through redaction. A failed install leaves the descriptors where they were, and the command still runs.

Returns:



21
22
23
24
# File 'lib/mutineer/command_redact.rb', line 21

def install
  Redaction.extra_urls = DatabaseUrls.from_files(working_directory)
  OutputFilter.install
end

#working_directory ⇒ String? (private)

The working directory, or nil when it was removed. A command that runs from a deleted directory must still start.

Returns:

  • (String, nil)


30
31
32
33
34
# File 'lib/mutineer/command_redact.rb', line 30

def working_directory
  Dir.pwd
rescue SystemCallError
  nil
end