andremedeiros/ruby-deepclone — pull request #1 by antw (2013-04-04 13:09:48+00:00)
Title: Don't clone "singletons" like Float, nil, true, false.

This fixes errors when trying to clone a Float ("TypeError - allocator undefined for Float") and adds additional exceptions for other "singleton" objects like Symbols, `nil`, `true`, and `false`.

I also added tests for Date, Time, Datetime, and Regexp. Ruby disallows cloning literal regexps (`/thing/.clone`) but allows non-literals to be cloned (`Regexp.new('thing').clone`). DeepClone clones both types; I'm not sure of the best way to handle this so I added tests for each, and marked the failing one as pending.

There are other classes which cannot be cloned (BigDecimal and Rational come to mind) but complain by raising an exception; I'm not sure what to do about those either...

```ruby
BigDecimal.new(1).clone
# => TypeError: can't copy BigDecimal
```