Module | Rudy::Utils |
In: |
lib/rudy/utils.rb
|
A motley collection of methods that Rudy loves to call!
msg The message to return as a banner size One of: :normal (default), :huge colour a valid Returns a string with styling applying
Generates a canonical tag name in the form:
2009-12-31-USER-SUFFIX
where USER is equal to the user executing the Rudy process and SUFFIX is equal to suffix (optional)
Return the local IP address which receives external traffic from: coderrr.wordpress.com/2008/05/28/get-your-local-ip-address/ NOTE: This does not open a connection to the IP address.
Is the given string str an ID of type identifier?
require a glob of files.
and then to Dir.glob. The list of files found are sent to require. Nothing is returned but LoadError exceptions are caught. The message is printed to STDERR and the program exits with 7.
Checks whether something is listening to a socket.
Returns true if host allows a socket connection on port. Returns false if one of the following exceptions is raised: Errno::EAFNOSUPPORT, Errno::ECONNREFUSED, SocketError, Timeout::Error
Generates a string of random alphanumeric characters.
i l o 1 0
Wait for something to happen.
The check block must return false while waiting. Once it returns true the waiter will return true too.
Returns str with the leading indentation removed. Stolen from github.com/mynyml/unindent/ because it was better.