Pajk/apipie-rails — pull request #103 by mangelajo (2013-02-27 16:40:55+00:00)
Title: When safe_yaml gem is loaded, apipie will fail to load/use examples

Safe_YAML seems to load the contents of the apipie_examples.yml as an array of hashes, instead of a hash...

Ending in a

Rack::File headers parameter replaces cache_control after Rack 1.5.
/Users/ajo/.rvm/gems/ruby-1.9.3-p286/bundler/gems/apipie-rails-c4a766ecf6e4/lib/apipie/method_description.rb:149:in `[]': can't convert String into Integer (TypeError)
from /Users/ajo/.rvm/gems/ruby-1.9.3-p286/bundler/gems/apipie-rails-c4a766ecf6e4/lib/apipie/method_description.rb:149:in `load_recorded_examples'
from /Users/ajo/.rvm/gems/ruby-1.9.3-p286/bundler/gems/apipie-rails-c4a766ecf6e4/lib/apipie/method_description.rb:41:in `initialize'
from /Users/ajo/.rvm/gems/ruby-1.9.3-p286/bundler/gems/apipie-rails-c4a766ecf6e4/lib/apipie/application.rb:46:in `new'

When you try to view any of the controllers with an example.

This patch fixes it for the people using SafeYAML, and won't do anything for the people using the traditional yaml :)