Skip to main content


Showing posts from July, 2016

How to remove the first character of a ruby string

Recently, I had to remove the first character of string in a private nanoc-powered project. I easily found a quick and elegant way to achieve this and according to this stackoverflow answer it seems the fastest.

path="_theString" path[1..-1] # => "theString"
And to complete this post, if you plan to use this often, you may want to override the String class to remove the first n characters :
class String def removeFirstChars!(how_many = 1) self.replace self[how_many..-1] end end
The stackoverflow answer also gives the code and benchmark results to achieve this with an Array.

RainbruRPG's client is now in src/

Like this previous post, today's commit #826 is also on code reorganization.

This time, the client binary code was moved from the client/ subdirectory to the new src/ development tree.

This change includes C++ source code and  Ogre3D configuration files templates ( files) , used  by cmake to generate plugins.cfg and resources.cfg. The m4-based autotools  files were deleted while the remaining files, including TODO and ChangeLog, were moved to the OLD/client directory.

To make the whole project consistent, the last to-be-moved directory is services/.