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.5.0.beta.1-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.0.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.5.0.alpha.1-java spec/support/helpers/cli_helpers.rb
appsignal-2.5.0.alpha.1 spec/support/helpers/cli_helpers.rb
appsignal-2.4.3 spec/support/helpers/cli_helpers.rb
appsignal-2.4.2 spec/support/helpers/cli_helpers.rb
appsignal-2.4.1 spec/support/helpers/cli_helpers.rb
appsignal-2.4.0 spec/support/helpers/cli_helpers.rb
appsignal-2.4.0.alpha.1 spec/support/helpers/cli_helpers.rb
appsignal-2.3.7 spec/support/helpers/cli_helpers.rb
appsignal-2.3.6 spec/support/helpers/cli_helpers.rb
appsignal-2.3.6.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.3.4 spec/support/helpers/cli_helpers.rb
appsignal-2.3.3 spec/support/helpers/cli_helpers.rb
appsignal-2.3.3.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.3.2 spec/support/helpers/cli_helpers.rb
appsignal-2.3.1 spec/support/helpers/cli_helpers.rb
appsignal-2.3.0 spec/support/helpers/cli_helpers.rb
appsignal-2.3.0.beta.3 spec/support/helpers/cli_helpers.rb
appsignal-2.3.0.beta.2 spec/support/helpers/cli_helpers.rb