ruby-grape/grape ? reverse-engineered prompt
Reverse engineered prompt
Build me a Ruby gem for creating REST like APIs with a clean, easy DSL. I want it to run on Rack, and also fit nicely into Rails or Sinatra apps, so I can define API classes, add routes like get, post, put, and delete, and organize them with resources, namespaces, and mounted sub APIs.
It should support things people expect from an API framework, like JSON responses, versioning, prefixes, content negotiation, route params, simple helpers for shared logic, and basic error handling. I’d also like it to handle common API behavior automatically, like HEAD and OPTIONS, and make it easy to precompile routes when needed.
Please include a couple of simple examples in the README, and set it up so I can run the test suite and work on it locally without much hassle. If you need to check current Ruby or Rails docs while wiring it up, go ahead and look them up online.
Are you gonna build this?
make sure you review the code using coderabbit