Skip to content

Instantly share code, notes, and snippets.

@mitchty
Created November 22, 2011 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchty/1384856 to your computer and use it in GitHub Desktop.
Save mitchty/1384856 to your computer and use it in GitHub Desktop.
main> [[:a], nil, :b, nil, nil].collect!{|x| Array(x)}
=> [[:a], [], [:b], [], []]
@mitchty
Copy link
Author

mitchty commented Nov 22, 2011

[[:a], nil, :b, nil, nil].collect!{|x| Array(x)} # all
1.8.6 => [[:a], [], [:b], [], []]
1.8.7 => [[:a], [], [:b], [], []]
1.9.2 => [[:a], [], [:b], [], []]
1.9.3 => [[:a], [], [:b], [], []]
jruby => [[:a], [], [:b], [], []]
rbx => [[:a], [], [:b], [], []]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment