rails/globalid — pull request #17 by kaspth (2014-08-18 10:49:23+00:00)
Title: Add URI::GID class

Fixes #6.

I've added methods to extract gid related information and create a conforming uri to `URI::GID`.

The tests I removed didn't raise a `BadURIError` because `gid://` is now a valid URI.

I copied over the first error message, since Ruby didn't seem to do any validation when parsing.

This error happens because I can't figure how to get it to parse the path on creation:

```
1) Error:
GlobalLocatorTest#test_by_invalid_GID_URI_returns_nil:
NameError: wrong constant name 1
/Users/kasperhansen/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:238:in `const_get'
/Users/kasperhansen/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:238:in `block in constantize'
/Users/kasperhansen/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:236:in `each'
/Users/kasperhansen/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:236:in `inject'
/Users/kasperhansen/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:236:in `constantize'
/Users/kasperhansen/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
/Users/kasperhansen/Documents/code/globalid/lib/global_id/global_id.rb:38:in `model_class'
/Users/kasperhansen/Documents/code/globalid/lib/global_id/global_id.rb:34:in `find'
/Users/kasperhansen/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/core_ext/object/try.rb:45:in `public_send'
/Users/kasperhansen/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/core_ext/object/try.rb:45:in `try'
/Users/kasperhansen/Documents/code/globalid/lib/global_id/global_id.rb:17:in `find'
/Users/kasperhansen/Documents/code/globalid/lib/global_id/locator.rb:6:in `locate'
/Users/kasperhansen/Documents/code/globalid/test/cases/global_locator_test.rb:44:in `block in '
```