Project

supplement

0.0
A long-lived project that still receives updates
Simple methods that didn't manage to become part of standard Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 2.18
~> 13.0
 Project Readme

supplement 2.29 -- Useful Ruby enhancements

Some simple Ruby extensions.

Motivation

The original motivation was my conviction that a language that has a Numeric#nonzero? method induces a programming style that as well demands for a String#notempty? method.

Description

These are methods on standard classes that didn't manage to become part of the Ruby interpreter. (Although, some did in the meantime.)

They are all very small, most of them have less than 15 lines of code. So they would not be a weight in the Ruby interpreter but it is very difficult to convince a majority that they belong there.

The methods won't be useful for everybody but some programmers may like to make them part of their programming style.

If you like to get taunted, then go to the Ruby mailing list and propose one of them to be included into the Ruby standard.

Contents (uncomplete)

  • String#notempty?
  • String#head
  • String#tail
  • String#rest
  • String#starts_with?/ends_with?
  • Array#notempty?
  • Array#first=/last=
  • Hash#notempty?
  • Struct.[]
  • Integer.roman
  • Date.easter
  • TCPServer/UNIXServer.accept with a code block
  • File system stats
  • Process.renice
  • Interval timer
  • LockedFile

Copyright