Cuprum::Cli

A command-line utility powered by Cuprum that provides tools and utilities for defining command-line tools.

Module: Cuprum::Cli::Dependencies::StandardIo::Helpers

Parent Namespace
Cuprum::Cli::Dependencies::StandardIo
Defined In
lib/cuprum/cli/dependencies/standard_io/helpers.rb

Table Of Contents

Overview

Helper methods for reading from and writing to standard inputs and outputs.

Back To Top

Constants

FALSY_VALUES

= Set.new(%w[f false n no]).freeze

String input values that will be mapped to a boolean false.

INTEGER_PATTERN

= /\A-?\d+([\d_,]+\d)?\z/

Pattern matching a valid integer input.

TRUTHY_VALUES

= Set.new(%w[t true y yes]).freeze

String input values that will be mapped to a boolean true.

Back To Top

Instance Methods

#ask(prompt = nil, caret: true, format: nil, strip: true, **options) => String, Integer, true, false, nil

Requests an input from the input stream.

Parameters

Options Hash (options)

Returns

#say(message, newline: true, quiet: false, verbose: false, **options) => nil

Prints a message to the output stream.

Parameters

Options Hash (options)

Returns

#warn(message, **options) => nil

Prints a message to the error stream.

Parameters

Options Hash (options)

Returns

Back To Top


Back to Documentation | Reference | Cuprum | Cuprum::Cli | Cuprum::Cli::Dependencies | Cuprum::Cli::Dependencies::StandardIo