r7kamura/jdoc — pull request #6 by gfx (2014-06-22 02:50:06+00:00)
Title: Check if a schema resouce has a title

Jdoc::Resource depends strongly on its `title`, and if it has no title Jdoc::Generator raises the following errors:

```
NoMethodError: undefined method `gsub' for nil:NilClass

/Users/gfx/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jdoc-0.1.2/lib/jdoc/resource.rb:21:in `anchor'
/Users/gfx/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jdoc-0.1.2/lib/jdoc/resource.rb:28:in `hyperlink'
(erubis:3:in `block in result'
(erubis:2:in `each'
(erubis:2:in `result'
/Users/gfx/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb:65:in `eval'
/Users/gfx/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb:65:in `result'
/Users/gfx/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jdoc-0.1.2/lib/jdoc/generator.rb:19:in `call'
/Users/gfx/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jdoc-0.1.2/lib/jdoc/generator.rb:8:in `call'
/Users/gfx/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rack-json_schema-1.0.6/lib/rack/json_schema/docs.rb:13:in `initialize'
```

which is hard to debug.

This patch checks titles to make debugging easy.