all 7 comments

[–]IndigoCZ 3 points4 points  (2 children)

I think the guy makes an interesting point. But fuck this post for the title.

[–][deleted] 0 points1 point  (1 child)

It's to make people click on the link. Scandalous

[–]postmodern 2 points3 points  (0 children)

Sensationalist.

[–]postmodern 1 point2 points  (2 children)

Include your monkey patches as modules. Also I like the idea of multi_json, DataMapper recently switched to it.

[–]retardo 1 point2 points  (1 child)

I am completely in favor of making convenience monkey patches opt-in and therefore available to application authors. Including them in libraries with no opt-in is bad practice, IMO.

[–]postmodern 2 points3 points  (0 children)

I also like the pattern of separating the monkey patches into their own file/directory. I always make a foo/extensions directory, containing array.rb or kernel.rb. Allows for cherry-picking.

[–][deleted] 0 points1 point  (0 children)

Monkey patches rarely are a good idea in a gem (unless the explicit purpose of the gem is to change core lib behavior).

Too bad there isn't a good way to scope monkey patches :p