Module: Clack

Defined in:
lib/clack.rb,
lib/clack/box.rb,
lib/clack/log.rb,
lib/clack/note.rb,
lib/clack/group.rb,
lib/clack/utils.rb,
lib/clack/colors.rb,
lib/clack/stream.rb,
lib/clack/symbols.rb,
lib/clack/testing.rb,
lib/clack/version.rb,
lib/clack/task_log.rb,
lib/clack/validators.rb,
lib/clack/core/cursor.rb,
lib/clack/core/prompt.rb,
lib/clack/environment.rb,
lib/clack/core/ci_mode.rb,
lib/clack/prompts/date.rb,
lib/clack/prompts/path.rb,
lib/clack/prompts/text.rb,
lib/clack/transformers.rb,
lib/clack/core/settings.rb,
lib/clack/prompts/range.rb,
lib/clack/prompts/tasks.rb,
lib/clack/prompts/select.rb,
lib/clack/core/key_reader.rb,
lib/clack/prompts/confirm.rb,
lib/clack/prompts/spinner.rb,
lib/clack/prompts/password.rb,
lib/clack/prompts/progress.rb,
lib/clack/core/fuzzy_matcher.rb,
lib/clack/core/scroll_helper.rb,
lib/clack/prompts/select_key.rb,
lib/clack/core/options_helper.rb,
lib/clack/prompts/multiselect.rb,
lib/clack/prompts/autocomplete.rb,
lib/clack/core/selection_manager.rb,
lib/clack/core/text_input_helper.rb,
lib/clack/prompts/multiline_text.rb,
lib/clack/prompts/group_multiselect.rb,
lib/clack/prompts/autocomplete_multiselect.rb

Overview

Clack - Beautiful CLI prompts for Ruby

A faithful Ruby port of @clack/prompts, bringing delightful terminal aesthetics to your Ruby projects.

Examples:

Basic usage

Clack.intro "Welcome to my-app"
name = Clack.text(message: "What's your name?")
exit 1 if Clack.cancel?(name)
Clack.outro "Nice to meet you, #{name}!"

Using prompt groups

result = Clack.group do |g|
  g.prompt(:name) { Clack.text(message: "Name?") }
  g.prompt(:confirm) { Clack.confirm(message: "Continue?") }
end

See Also:

Defined Under Namespace

Modules: Box, Colors, Core, Environment, Log, Note, Prompts, Stream, Symbols, Testing, Transformers, Utils, Validators Classes: Group, TaskLog, TaskLogGroup, Warning

Constant Summary collapse

CANCEL =

Sentinel value returned when user cancels a prompt (Escape or Ctrl+C)

Object.new.tap { |o| o.define_singleton_method(:inspect) { "Clack::CANCEL" } }.freeze
VERSION =

Current gem version.

"0.6.0"

Class Method Summary collapse

Class Method Details

.autocomplete(message:, options:, **opts) ⇒ Object, CANCEL

Prompt with type-to-filter autocomplete.

Parameters:

  • message (String)

    the prompt message

  • options (Array<Hash, String>)

    list of options to filter

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :placeholder (String, nil)

    placeholder text

  • :filter (Proc, nil)

    custom filter proc receiving (option_hash, query_string) and returning true/false. Defaults to fuzzy matching across label, value, and hint, sorted by relevance score.

  • :max_items (Integer, nil)

    max visible items (enables scrolling, default: 5)

Returns:

  • (Object, CANCEL)

    selected value or CANCEL if cancelled



283
284
285
# File 'lib/clack.rb', line 283

def autocomplete(message:, options:, **opts)
  Prompts::Autocomplete.new(message:, options: options, **opts).run
end

.autocomplete_multiselect(message:, options:, **opts) ⇒ Array, CANCEL

Prompt with type-to-filter autocomplete and multiselect.

Parameters:

  • message (String)

    the prompt message

  • options (Array<Hash, String>)

    list of options to filter

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :placeholder (String, nil)

    placeholder text

  • :required (Boolean)

    require at least one selection (default: true)

  • :initial_values (Array, nil)

    initially selected values

  • :filter (Proc, nil)

    custom filter proc receiving (option_hash, query_string) and returning true/false. Defaults to fuzzy matching across label, value, and hint, sorted by relevance score.

  • :max_items (Integer, nil)

    max visible items (enables scrolling, default: 5)

Returns:

  • (Array, CANCEL)

    selected values or CANCEL if cancelled



299
300
301
# File 'lib/clack.rb', line 299

def autocomplete_multiselect(message:, options:, **opts)
  Prompts::AutocompleteMultiselect.new(message:, options: options, **opts).run
end

.box(message = "", title: "", **opts) ⇒ void

This method returns an undefined value.

Display content in a customizable box.

Parameters:

  • message (String) (defaults to: "")

    the box content

  • title (String, nil) (defaults to: "")

    optional title

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :content_align (:left, :center, :right)

    content alignment

  • :title_align (:left, :center, :right)

    title alignment

  • :width (Integer, :auto)

    box width

  • :rounded (Boolean)

    use rounded corners



422
423
424
# File 'lib/clack.rb', line 422

def box(message = "", title: "", **opts)
  Box.render(message, title: title, **opts)
end

.cancel(message = nil, output: $stdout) ⇒ void

This method returns an undefined value.

Display a cancellation message (typically after user presses Escape).

Parameters:

  • message (String, nil) (defaults to: nil)

    optional cancellation message

  • output (IO) (defaults to: $stdout)

    output stream (default: $stdout)



146
147
148
149
150
# File 'lib/clack.rb', line 146

def cancel(message = nil, output: $stdout)
  output.puts Colors.gray(Symbols::S_BAR)
  output.puts "#{Colors.gray(Symbols::S_BAR_END)}  #{Colors.red(message)}"
  output.puts
end

.cancel?(value) ⇒ Boolean Also known as: cancelled?

Check if a prompt result was cancelled by the user.

Parameters:

  • value (Object)

    the result from a prompt

Returns:

  • (Boolean)

    true if the user cancelled



92
93
94
# File 'lib/clack.rb', line 92

def cancel?(value)
  value.equal?(CANCEL)
end

.ci?Boolean

Check if running in a CI environment

Returns:

  • (Boolean)


467
468
469
# File 'lib/clack.rb', line 467

def ci?
  Environment.ci?
end

.columns(output = $stdout, default: 80) ⇒ Integer

Get terminal columns (width)

Parameters:

  • output (IO) (defaults to: $stdout)

    Output stream

  • default (Integer) (defaults to: 80)

    Default if detection fails

Returns:

  • (Integer)


488
489
490
# File 'lib/clack.rb', line 488

def columns(output = $stdout, default: 80)
  Environment.columns(output, default: default)
end

.confirm(message:, **opts) ⇒ Boolean, CANCEL

Prompt for yes/no confirmation.

Parameters:

  • message (String)

    the prompt message

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :active (String)

    label for “yes” option (default: “Yes”)

  • :inactive (String)

    label for “no” option (default: “No”)

  • :initial_value (Boolean)

    default selection (default: true)

Returns:

  • (Boolean, CANCEL)

    true/false or CANCEL if cancelled



199
200
201
# File 'lib/clack.rb', line 199

def confirm(message:, **opts)
  Prompts::Confirm.new(message:, **opts).run
end

.date(message:, **opts) ⇒ Date, CANCEL

Prompt for date selection with inline segmented input.

Navigate between segments with Tab/arrow keys, adjust with up/down, or type digits directly.

Parameters:

  • message (String)

    the prompt message

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :format (Symbol)

    date format (:iso, :us, :eu)

  • :initial_value (Date, Time, String, nil)

    initial date value (default: today)

  • :min (Date, nil)

    minimum allowed date

  • :max (Date, nil)

    maximum allowed date

  • :validate (Proc, nil)

    custom validation proc

  • :help (String, nil)

    help text shown below the message

Returns:

  • (Date, CANCEL)

    selected date or CANCEL if cancelled



367
368
369
# File 'lib/clack.rb', line 367

def date(message:, **opts)
  Prompts::Date.new(message:, **opts).run
end

.demovoid

This method returns an undefined value.

Run the interactive demo showcasing all Clack features. The demo implementation is in examples/demo.rb.



504
505
506
507
508
# File 'lib/clack.rb', line 504

def demo
  demo_path = File.expand_path("../examples/demo.rb", __dir__)
  load demo_path
  run_demo
end

.group(on_cancel: nil) {|group| ... } ⇒ Hash, Clack::CANCEL

Run a group of prompts and collect their results.

If any prompt is cancelled, the entire group returns Clack::CANCEL. The on_cancel callback receives partial results collected so far.

Examples:

result = Clack.group do |g|
  g.prompt(:name) { Clack.text(message: "Name?") }
  g.prompt(:confirm) { Clack.confirm(message: "Continue?") }
end

if Clack.cancel?(result)
  Clack.cancel("Cancelled")
else
  puts "Name: #{result[:name]}"
end

Parameters:

  • on_cancel (Proc, nil) (defaults to: nil)

    Callback when a prompt is cancelled

Yields:

  • (group)

    Block to define prompts

Yield Parameters:

Returns:

Raises:

  • (ArgumentError)


92
93
94
95
96
97
98
# File 'lib/clack/group.rb', line 92

def group(on_cancel: nil, &block)
  raise ArgumentError, "Block required for Clack.group" unless block_given?

  group = Group.new(on_cancel: on_cancel)
  block.call(group)
  group.run
end

.group_multiselect(message:, options:, **opts) ⇒ Array, CANCEL

Prompt to select multiple options organized in groups.

Parameters:

  • message (String)

    the prompt message

  • options (Array<Hash>)

    groups with :label and :options

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :initial_values (Array, nil)

    initially selected values

  • :required (Boolean)

    require at least one selection (default: true)

  • :cursor_at (Object, nil)

    value of initially focused option

  • :selectable_groups (Boolean)

    allow toggling entire groups (default: false)

  • :group_spacing (Integer)

    lines between groups (default: 0)

Returns:

  • (Array, CANCEL)

    selected values or CANCEL if cancelled



350
351
352
# File 'lib/clack.rb', line 350

def group_multiselect(message:, options:, **opts)
  Prompts::GroupMultiselect.new(message:, options: options, **opts).run
end

.handle_cancel(value, message = "Cancelled", output: $stdout) ⇒ Boolean

Check if cancelled and show cancel message if so. Useful for guard clauses in CLI scripts.

Examples:

Guard clause pattern

name = Clack.text(message: "Name?")
return if Clack.handle_cancel(name)  # Shows "Cancelled" and returns true

With custom message

return if Clack.handle_cancel(name, "Aborted by user")

Parameters:

  • value (Object)

    the result from a prompt

  • message (String) (defaults to: "Cancelled")

    message to display if cancelled

  • output (IO) (defaults to: $stdout)

    output stream

Returns:

  • (Boolean)

    true if cancelled



114
115
116
117
118
119
# File 'lib/clack.rb', line 114

def handle_cancel(value, message = "Cancelled", output: $stdout)
  return false unless cancel?(value)

  cancel(message, output: output)
  true
end

.intro(title = nil, output: $stdout) ⇒ void

This method returns an undefined value.

Display an intro banner at the start of a CLI session.

Parameters:

  • title (String, nil) (defaults to: nil)

    optional title text

  • output (IO) (defaults to: $stdout)

    output stream (default: $stdout)



126
127
128
# File 'lib/clack.rb', line 126

def intro(title = nil, output: $stdout)
  output.puts "#{Colors.gray(Symbols::S_BAR_START)}  #{title}"
end

.logModule

Access the Log module for styled console output.

Returns:

  • (Module)

    the Log module



393
394
395
# File 'lib/clack.rb', line 393

def log
  Log
end

.multiline_text(message:, **opts) ⇒ String, CANCEL

Prompt for multi-line text input.

Enter inserts a newline, Ctrl+D submits. Useful for commit messages, notes, or any multi-line content.

Parameters:

  • message (String)

    the prompt message

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :initial_value (String, nil)

    pre-filled editable text (can contain newlines)

  • :validate (Proc, nil)

    validation function returning error string, Warning, or nil

  • :help (String, nil)

    help text shown below the message

Returns:

  • (String, CANCEL)

    user input (lines joined with n) or CANCEL if cancelled



177
178
179
# File 'lib/clack.rb', line 177

def multiline_text(message:, **opts)
  Prompts::MultilineText.new(message:, **opts).run
end

.multiselect(message:, options:, **opts) ⇒ Array, CANCEL

Prompt to select multiple options from a list.

Parameters:

  • message (String)

    the prompt message

  • options (Array<Hash, String>)

    list of options

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :initial_values (Array, nil)

    initially selected values

  • :required (Boolean)

    require at least one selection (default: true)

  • :max_items (Integer, nil)

    max visible items (enables scrolling)

  • :cursor_at (Object, nil)

    value of initially focused option

Returns:

  • (Array, CANCEL)

    selected values or CANCEL if cancelled



223
224
225
# File 'lib/clack.rb', line 223

def multiselect(message:, options:, **opts)
  Prompts::Multiselect.new(message:, options: options, **opts).run
end

.note(message = "", title: nil, **opts) ⇒ void

This method returns an undefined value.

Display a note box with optional title.

Parameters:

  • message (String) (defaults to: "")

    the note content

  • title (String, nil) (defaults to: nil)

    optional title



409
410
411
# File 'lib/clack.rb', line 409

def note(message = "", title: nil, **opts)
  Note.render(message, title: title, **opts)
end

.outro(message = nil, output: $stdout) ⇒ void

This method returns an undefined value.

Display an outro banner at the end of a CLI session.

Parameters:

  • message (String, nil) (defaults to: nil)

    optional closing message

  • output (IO) (defaults to: $stdout)

    output stream (default: $stdout)



135
136
137
138
139
# File 'lib/clack.rb', line 135

def outro(message = nil, output: $stdout)
  output.puts Colors.gray(Symbols::S_BAR)
  output.puts "#{Colors.gray(Symbols::S_BAR_END)}  #{message}"
  output.puts
end

.password(message:, **opts) ⇒ String, CANCEL

Prompt for password input (masked display).

Parameters:

  • message (String)

    the prompt message

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :mask (String)

    character to display for each input character (default: ▪)

  • :validate (Proc, nil)

    validation function returning error string, Warning, or nil

  • :help (String, nil)

    help text shown below the message

Returns:

  • (String, CANCEL)

    password or CANCEL if cancelled



188
189
190
# File 'lib/clack.rb', line 188

def password(message:, **opts)
  Prompts::Password.new(message:, **opts).run
end

.path(message:, **opts) ⇒ String, CANCEL

Prompt for file/directory path with filesystem navigation.

Parameters:

  • message (String)

    the prompt message

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :root (String)

    starting directory (default: “.”)

  • :only_directories (Boolean)

    only show directories (default: false)

  • :max_items (Integer, nil)

    max visible items (enables scrolling, default: 5)

Returns:

  • (String, CANCEL)

    selected path or CANCEL if cancelled



310
311
312
# File 'lib/clack.rb', line 310

def path(message:, **opts)
  Prompts::Path.new(message:, **opts).run
end

.progress(total:, **opts) ⇒ Prompts::Progress

Create a progress bar for measurable operations.

Parameters:

  • total (Integer)

    total number of steps

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :message (String, nil)

    optional message

Returns:



319
320
321
# File 'lib/clack.rb', line 319

def progress(total:, **opts)
  Prompts::Progress.new(total: total, **opts)
end

.range(message:, **opts) ⇒ Numeric, CANCEL

Prompt for a numeric value using a slider.

Navigate with left/right or up/down arrow keys. Press Enter to confirm.

Examples:

Basic usage

volume = Clack.range(message: "Volume", min: 0, max: 100, step: 5)

Parameters:

  • message (String)

    the prompt message

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :min (Numeric)

    minimum value (default: 0)

  • :max (Numeric)

    maximum value (default: 100)

  • :step (Numeric)

    increment size (default: 1)

  • :initial_value (Numeric, nil)

    initial value (defaults to min)

  • :validate (Proc, nil)

    validation proc

  • :help (String, nil)

    help text shown below the message

Returns:

  • (Numeric, CANCEL)

    selected value or CANCEL if cancelled



386
387
388
# File 'lib/clack.rb', line 386

def range(message:, **opts)
  Prompts::Range.new(message:, **opts).run
end

.rows(output = $stdout, default: 24) ⇒ Integer

Get terminal rows (height)

Parameters:

  • output (IO) (defaults to: $stdout)

    Output stream

  • default (Integer) (defaults to: 24)

    Default if detection fails

Returns:

  • (Integer)


496
497
498
# File 'lib/clack.rb', line 496

def rows(output = $stdout, default: 24)
  Environment.rows(output, default: default)
end

.select(message:, options:, **opts) ⇒ Object, CANCEL

Prompt to select one option from a list.

Parameters:

  • message (String)

    the prompt message

  • options (Array<Hash, String>)

    list of options

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :initial_value (Object, nil)

    value of initially selected option

  • :max_items (Integer, nil)

    max visible items (enables scrolling)

Returns:

  • (Object, CANCEL)

    selected value or CANCEL if cancelled



210
211
212
# File 'lib/clack.rb', line 210

def select(message:, options:, **opts)
  Prompts::Select.new(message:, options: options, **opts).run
end

.select_key(message:, options:, **opts) ⇒ Object, CANCEL

Prompt to select an option by pressing a key.

Parameters:

  • message (String)

    the prompt message

  • options (Array<Hash>)

    options with :value, :label, and :key

Returns:

  • (Object, CANCEL)

    selected value or CANCEL if cancelled



328
329
330
# File 'lib/clack.rb', line 328

def select_key(message:, options:, **opts)
  Prompts::SelectKey.new(message:, options: options, **opts).run
end

.settingsHash

Access global settings

Returns:

  • (Hash)

    Current configuration

See Also:



440
441
442
# File 'lib/clack.rb', line 440

def settings
  Core::Settings.config
end

.setup!void

This method returns an undefined value.

Install signal handlers for clean terminal cleanup. Call this once in your CLI entry point. Handles INT, TERM, and SIGWINCH. Without calling this, Ctrl+C may leave the cursor hidden.



515
516
517
518
519
520
521
522
# File 'lib/clack.rb', line 515

def setup!
  return if @setup_done

  @setup_done = true
  install_signal_handlers
  install_at_exit
  Core::Prompt.setup_signal_handler
end

.setup?Boolean

Returns whether setup! has been called.

Returns:

  • (Boolean)

    whether setup! has been called



525
# File 'lib/clack.rb', line 525

def setup? = !!@setup_done

.spin(message, success: nil, error: nil, **opts) ⇒ Object

Run a block with a spinner, handling success/error automatically.

Examples:

Basic usage

result = Clack.spin("Installing dependencies...") { system("npm install") }

With custom success message

Clack.spin("Compiling...", success: "Build complete!") { build_project }

Access spinner inside block

Clack.spin("Working...") do |s|
  s.message "Step 1..."
  do_step_1
  s.message "Step 2..."
  do_step_2
end

Parameters:

  • message (String)

    initial spinner message

  • success (String, nil) (defaults to: nil)

    message on success (defaults to message)

  • error (String, nil) (defaults to: nil)

    message on error (defaults to exception message)

Returns:

  • (Object)

    the block’s return value

Raises:

  • (Exception)

    re-raises any exception from the block



260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/clack.rb', line 260

def spin(message, success: nil, error: nil, **opts)
  s = spinner(**opts)
  s.start(message)
  begin
    result = yield(s)
    s.stop(success || message)
    result
  rescue => exception
    s.error(error || exception.message)
    raise
  end
end

.spinner(**opts) ⇒ Prompts::Spinner

Create an animated spinner for async operations.

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :indicator (:dots, :timer)

    animation style (default: :dots)

  • :frames (Array<String>, nil)

    custom animation frames

  • :delay (Float, nil)

    seconds between frames

  • :style_frame (Proc, nil)

    proc to style each frame

  • :output (IO)

    output stream (default: $stdout)

Returns:

  • (Prompts::Spinner)

    spinner instance (call #start, #stop, #error, #cancel, #clear)



235
236
237
# File 'lib/clack.rb', line 235

def spinner(**opts)
  Prompts::Spinner.new(**opts)
end

.streamModule

Access the Stream module for streaming output.

Returns:

  • (Module)

    the Stream module



400
401
402
# File 'lib/clack.rb', line 400

def stream
  Stream
end

.task_log(title:, **opts) ⇒ TaskLog

Create a streaming task log that clears on success, shows on error. Useful for build output, npm install style streaming, etc.

Parameters:

  • title (String)

    title displayed at the top

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :limit (Integer, nil)

    max lines to show (older lines scroll out)

  • :retain_log (Boolean)

    keep full log history for display on error

Returns:



433
434
435
# File 'lib/clack.rb', line 433

def task_log(title:, **opts)
  TaskLog.new(title: title, **opts)
end

.tasks(tasks:, **opts) ⇒ Array<Hash>

Run multiple tasks with progress indicators.

Parameters:

  • tasks (Array<Hash>)

    tasks with :title, :task (Proc), and optional :enabled (Boolean, default: true)

Returns:

  • (Array<Hash>)

    task results



336
337
338
# File 'lib/clack.rb', line 336

def tasks(tasks:, **opts)
  Prompts::Tasks.new(tasks: tasks, **opts).run
end

.text(message:, **opts) ⇒ String, CANCEL

Prompt for single-line text input.

Parameters:

  • message (String)

    the prompt message

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :placeholder (String, nil)

    dim text shown when input is empty

  • :default_value (String, nil)

    value used if submitted empty

  • :initial_value (String, nil)

    pre-filled editable text

  • :completions (Array<String>, Proc, nil)

    tab completion candidates (array or proc)

  • :validate (Proc, nil)

    validation function returning error string, Warning, or nil

  • :transform (Symbol, Proc, nil)

    transform function to normalize the value

  • :help (String, nil)

    help text shown below the message

Returns:

  • (String, CANCEL)

    user input or CANCEL if cancelled



163
164
165
# File 'lib/clack.rb', line 163

def text(message:, **opts)
  Prompts::Text.new(message:, **opts).run
end

.tty?(output = $stdout) ⇒ Boolean

Check if stdout is a TTY

Parameters:

  • output (IO) (defaults to: $stdout)

    Output stream to check

Returns:

  • (Boolean)


480
481
482
# File 'lib/clack.rb', line 480

def tty?(output = $stdout)
  Environment.tty?(output)
end

.update_settings(**opts) ⇒ Hash

Update global settings

Examples:

Custom key bindings

Clack.update_settings(aliases: { "y" => :enter, "n" => :cancel })

Disable guide bars

Clack.update_settings(with_guide: false)

Enable CI mode (auto-submit with defaults)

Clack.update_settings(ci_mode: true)

Auto-detect CI mode (non-TTY or CI environment)

Clack.update_settings(ci_mode: :auto)

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (**opts):

  • :aliases (Hash, nil)

    Custom key to action mappings

  • :with_guide (Boolean, nil)

    Whether to show guide bars

  • :ci_mode (Boolean, Symbol, nil)

    CI mode: true (always), :auto (detect non-TTY/CI env), false (never)

Returns:

  • (Hash)

    Updated configuration



461
462
463
# File 'lib/clack.rb', line 461

def update_settings(**opts)
  Core::Settings.update(**opts)
end

.warning(message) ⇒ Warning

Create a validation warning that allows the user to proceed with confirmation.

Examples:

validate: ->(v) { Clack.warning("Unusual value") if v.length > 100 }

Parameters:

  • message (String)

    the warning message

Returns:



84
85
86
# File 'lib/clack.rb', line 84

def warning(message)
  Warning.new(message)
end

.windows?Boolean

Check if running on Windows

Returns:

  • (Boolean)


473
474
475
# File 'lib/clack.rb', line 473

def windows?
  Environment.windows?
end