Sha256: def13cc20d7a3e957df38cd48bfb4f8360751c99c3df7b82244345a70ca1ec69

Contents?: true

Size: 508 Bytes

Versions: 56

Compression:

Stored size: 508 Bytes

Contents

module CLIHelpers
  def cli
    Appsignal::CLI
  end

  def run_cli(command, options = {})
    cli.run(format_cli_arguments_and_options(command, options))
  end

  def format_cli_arguments_and_options(command, options = {})
    [*command].tap do |o|
      options.each do |key, value|
        o << "--#{key}=#{value}"
      end
    end
  end

  def set_input(value)
    $stdin.puts value
  end

  def prepare_input
    # Prepare the input by rewinding the pointer in the StringIO
    $stdin.rewind
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
appsignal-2.6.1-java spec/support/helpers/cli_helpers.rb
appsignal-2.6.1 spec/support/helpers/cli_helpers.rb
appsignal-2.6.0-java spec/support/helpers/cli_helpers.rb
appsignal-2.6.0 spec/support/helpers/cli_helpers.rb
appsignal-2.6.0.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.6.0.beta.1-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.3-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.3 spec/support/helpers/cli_helpers.rb
appsignal-2.5.3.alpha.2 spec/support/helpers/cli_helpers.rb
appsignal-2.5.3.alpha.2-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.3.alpha.1 spec/support/helpers/cli_helpers.rb
appsignal-2.5.3.alpha.1-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.2-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.2 spec/support/helpers/cli_helpers.rb
appsignal-2.5.1-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.1 spec/support/helpers/cli_helpers.rb
appsignal-2.5.1.beta.1-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.1.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.5.0-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.0 spec/support/helpers/cli_helpers.rb