tower-archive / tower

UNMAINTAINED - Small components for building apps, manipulating data, and automating a distributed infrastructure.
http://tower.github.io
MIT License
1.79k stars 120 forks source link

Rails destroy command #365

Closed btbinhtran closed 11 years ago

btbinhtran commented 11 years ago

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

edubkendo commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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).