We’d like to introduce Relevance’s latest open source project, Vasco. Vasco is a route explorer for Rails projects. As we develop applications with explicit requirements for RESTful APIs for integration purposes, our clients need some way to visually accept that the stories are complete. It is also helpful for the developers to have a way to manually interact with the APIs as a second avenue for testing, verifying whether our routes end in gold and silk, or pain and death. So, we wrote Vasco.
Vasco is a simple plugin, with a single rake task. Once installed and initialized, it creates a web interface that knows about all your RESTful routes and the models at the far end of them. It lets you play with the GETs, POSTs, PUTs and DELETEs and see the responses. If your APIs are protected by BASIC auth, no worries, since the plugin runs from inside your app. And if you are lucky, it will expand your colonial footprint and lead to Empire.
To install, just run:> script/plugin install git://github.com/relevance/vasco.gitOnce installed:
> rake vasco:explore

After that, launch your app and point your browser to http://localhost:3000/vasco (or wherever you home your dev apps). You’ll be treated to a simple interface. On the left is a list of all the controllers in the app with RESTful routes associated with them. On the right are two boxes, one for viewing the request, one for the response. Click any controller to expand its list of available routes. If you click on something like, in this example, GET /ports, Vasco will send the request to your app and display the results immediately.

If you click on a route that requires user input, like PUT /ships/:id, a dialog will appear with a form you can fill in. The :id field will be prepopulated with a known ID from the database, assuming your database had fixture or other data loaded when you ran the vasco:explore task. You can fill in the rest of the form and either commit the request, or cancel.

After PUTting the request, the results will again be displayed. When a call only returns a status code, the results will be displayed as a simple success or failure message.


We’ve got docs on the GitHub wiki, as well as a list of upcoming features. We hope you enjoy SeƱor de Gama.
Comments
Hi Justin,
very good idea, highly appreciated ! My first attempt to run it failed because of a javascript error, ‘console not defined’. Once I commented that line out (59 in extension.js) everything worked fine. Before vasco I used to check my routes via the console and for sure vasco is much more agreeable :-) The ability for immidiate testing is a great plus. I hope that a future version will work with nested routes too. So thanks a lot for your work and vasco and have a good time!
Joachim
joachim—thanks! I’ve updated the code to remove the debugging line (good ol’ Firebug). I’ll post here again when the nested routes are supported. I’ve got experimental code for it, but I need to flesh it out.
worked for me. neat tool. thanks!
Looks very usefull, especially when something going wrong with out app we can check what is going on.
Hey,
nice plugin! After the rake task i get the error: “The file data.js seems to be too large (2Mb) to safely open.”
My IDE is Netbeans 6.5 RC1.
greetings
Using Rails 2.1.2 After sudo script/plugin install git://github.com/relevance/vasco.git and rake vasco:explore
rake aborted! No such file or directory – .../public/vasco/js/data.js
”> script/plugin install git://github.com/relevance/vasco.git”
I get ‘sh:git command not found’
(Red Had Linux ES release 4 (Nahant Update 7)
- rails 2.10
Mike
Ok, I figured out the missing ‘git’ ;)
I installed git, installed vasco, ran ‘rake vasco:explore’, opened http://mstram.webfactional.com/rclog/vasco, it just says :
Vasco
To explore your routes, run:
Format: Request
Response
=============
My routes file : ActionController::Routing::Routes.draw do |map| map.resources :logs end