Module Hirb::Util
In: lib/hirb/util.rb

Group of handy utility functions used throughout Hirb.

Methods

Public Instance methods

Returns a constant like Module#const_get no matter what namespace it‘s nested in. Returns nil if the constant is not found.

From Rails ActiveSupport, converting undescored lowercase to camel uppercase.

Captures STDOUT of anything run in its block and returns it as string.

Used by Hirb::Menu to select items from an array. Array counting starts at 1. Ranges of numbers are specified with a ’-’ or ’..’. Multiple ranges can be comma delimited. Anything that isn‘t a valid number is ignored. All elements can be returned with a ’*’. Examples:

   1-3,5-6 -> [1,2,3,5,6]
   *   -> all elements in array
   ''  -> []

Determines if a shell command exists by searching for it in ENV[‘PATH’].

Returns [width, height] of terminal when detected, nil if not detected. Think of this as a simpler version of Highline‘s Highline::SystemExtensions.terminal_size()

From Rubygems, determine a user‘s home.

Recursively merge hash1 with hash2.

[Validate]