String#indent: Know your definitions!

Posted About 10 years ago. Visible to the public.

String#indent is not a standard Ruby method. When you use it, be sure to know where this method comes from. Many Gems shamelessly define this method for internal usage, and you'll never know when it may be removed (since it's usually not part of the Gem's API).

Unless you're using Rails 4 (which brings String#indent in ActiveSupport), you'll be best of defining it yourself. This card has it for you.

Gems that define String#indent (incomplete)

Dominik Schöler
Last edit
About 10 years ago
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2014-03-06 10:28)