Skip to content

Loading…

Rails destroy command #365

Closed
btbinhtran opened this Issue · 4 comments

3 participants

@btbinhtran

Implement a tower destroy command to delete created models, controllers, helpers, and tests that are generated by the generate command.

@edubkendo

I know in chat I said I didn't know where to start, but on this actually, I took a look and this is where I'd start on implementing this : https://github.com/viatropos/tower/tree/master/packages/tower-command

@viatropos will be able to give you better guidance, but this is where I'd start, specifically looking at how https://github.com/viatropos/tower/blob/master/packages/tower-command/server/generate.coffee is implemented, since you'll be essentially reversing this process.

@btbinhtran

I agree edubkendo. There is just one concern that I read in the code comments that said the commands would be switched from classes to their own functions. I could start by making a destroy class, but not sure it will add more work for migrating the Command classes to be only separate functions. My guess is that this refactor improves the commands run speed.

@edubkendo

My gut instinct would be to go ahead and implement it. I dont know when the proposed refactor will occur, but it is probably not in the immediate future. Tower.js has a long to-do list. Also, if you go ahead and implement "destroy", it will be easy to refactor, vs. being unwritten and needing to be written from scratch. Having the feature written, even if it requires refactoring later, would seem to me preferrable to not having it at all.

@lancejpollard
Tower.js member

Will include this in 0.5.0, it will be super optimized :). An early version is here: https://github.com/viatropos/tgen/blob/master/server.js (but it's going to move soon to https://github.com/tower/tower).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.