Given some library that implements some widespread protocol or something similar (for instance FTP), how would I keep my standard compliant code separate from code that is only needed to be able to cooperate with not so standard compliant systems?
A nice example where this would make sense too IMHO are libraries like jQuery that have to consider all those browser peculiarities. Projects that have to keep legacy compatibility would probably also be a good target audience for such techniques.
I'm especially interested in ruby solutions but language independent patterns or good examples from other languages are welcome too.
I already found a related question here on stackoverflow, but are there any other approaches?
Small Ruby example: