0

I always find it useful to extend ruby's core, such as Object or String classes.

What is the correct and most organized way to extend the core? should i make files for each class i extend in the initializers or libs directory?

CodeOverload
  • 47,274
  • 54
  • 131
  • 219
  • Have a look at this question and its answers: http://stackoverflow.com/questions/5654517/in-ruby-on-rails-to-extend-the-string-class-where-should-the-code-be-put-in I'd say this question is a duplicate. – pje Sep 22 '12 at 15:16

1 Answers1

1

For this sort of thing, I would treat the code for the extensions like a local gem that is located in your lib/ directory, but required from an initializer called something like "core_extensions.rb".

rossta
  • 11,394
  • 1
  • 43
  • 47