Implement a geddy routes command #215

Closed
Techwraith opened this Issue Oct 7, 2012 · 8 comments

Comments

Projects
None yet
4 participants
Contributor

Techwraith commented Oct 7, 2012

It would be useful to have a way to list routes out on the command line. I think @kieran added a way to get a list of routes to barista, so this should be relatively easy to accomplish.

Contributor

larzconwell commented Oct 8, 2012

Yes from the console you can do geddy.router.routes and it'll list an array of objects with a bunch of different data for each route. That's what we're using to generate the action helpers as well.

Contributor

MiguelMadero commented Oct 8, 2012

@Techwraith were you thinking of something similar to rake routes in Rails? I think the console is perfect for this.

Contributor

Techwraith commented Oct 9, 2012

Yeah, I'd love to see a geddy routes command, or a geddy jake routes command. The console takes too many steps in my opinion.

Contributor

MiguelMadero commented Oct 9, 2012

It's just one extra step, for something that IMO it's not a frequent use
case.

$ geddy console

geddy.router.routes

By the other hand, the output is awful and unreadable, but that's more a
general issue with inspecting objects from the console. It would be nice to
have something like pretty print or awesome print in ruby.

It would be simple to add another command to display the routes. I think
that the cli might needs some cleanup up before adding more commands. That
switch case is already too big, but that's an internal issue.

Miguel

On Mon, Oct 8, 2012 at 10:06 PM, Daniel Erickson
notifications@github.comwrote:

Yeah, I'd love to see a geddy routes command, or a geddy jake routescommand. The console takes too many steps in my opinion.


Reply to this email directly or view it on GitHubhttps://github.com/mde/geddy/issues/215#issuecomment-9245872.

Contributor

kieran commented Oct 13, 2012

I really haven't done anything but made the routes array public in Barista - want something like this?

> console.log(router.toString())
GET      /posts(.:format)                                   posts.index
POST     /posts(.:format)                                   posts.create
GET      /posts/add(.:format)                               posts.add
GET      /posts/:id(.:format)                               posts.show
GET      /posts/:id/edit(.:format)                          posts.edit
PUT      /posts/:id(.:format)                               posts.update
DELETE   /posts/:id(.:format)                               posts.destroy
Contributor

Techwraith commented Oct 13, 2012

That would be great! It would be cool if we could implement geddy routes foo too, where it would filter routes by a certain search term. But we can add that on our side.

Sent from my iPhone

On Oct 13, 2012, at 3:25 PM, Kieran Huggins notifications@github.com wrote:

I really haven't done anything but made the routes array public in Barista - want something like this?

console.log(router.toString())
GET /posts(.:format) posts.index
POST /posts(.:format) posts.create
GET /posts/add(.:format) posts.add
GET /posts/:id(.:format) posts.show
GET /posts/:id/edit(.:format) posts.edit
PUT /posts/:id(.:format) posts.update
DELETE /posts/:id(.:format) posts.destroy

Reply to this email directly or view it on GitHub.

Contributor

kieran commented Oct 13, 2012

ok, this is in Barista v0.0.8 (gh & npm)

Contributor

Techwraith commented Oct 13, 2012

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment