Ruby extra library: some useful non-core functions