hoxworth/json-schema — pull request #147 by iainbeeston (2014-10-27 09:00:55+00:00)
Title: Validator tidy

I was looking through some of the metrics on code climate and decided to tidy up some duplicate code. Here's a summary:

1. Right now, when we check for the presence of optional gems (yajl, uuidtools etc) we have a big ugly if statement whose condition is a `begin... rescue` block (for backwards compatibility reasons). I've updated it to use a more up-to-date api which doesn't need the block (should work on ruby 1.9+)
2. The code for generating a uri (or file uri) is duplicated in three places in Validator. I've refactored that out to a new `normalized_uri` method
3. I've renamed `fake_uri` to `fake_uuid` as it returns a uuid (created from a uri) - it does not return a uri