Simon Strandgaard wrote:
> I want to install 'shift_until_kind_of' in the global Array class
> so that I can do like this:
> 
>     ary = [1, 2, "a", 3, 4, "b", 5, 6]
>     assert_equal([1, 2], ary.shift_until_kind_of(String))
> 
> But extending the Array class does not work.
> How should I extend the global Array class ?

You need to _include_ the module for #shift_until_kind_of to be found 
among the instance methods of Array.

By contrast, if you _extend_ Array with your module, its methods will be 
added as methods of the Array object itself (an instance of Class).

However, calling Array.include will not work, since include is private. 
You can always get around this with something like:

	Array.send :include, ArrayMisc

Or you can use class_eval (or module_eval, which is the same), or simply

class Array; include ArrayMisc; end