padrino / padrino-framework

Padrino is a full-stack ruby framework built upon Sinatra.
http://www.padrinorb.com
MIT License
3.37k stars 509 forks source link

Refactoring Generators #677

Open DAddYE opened 13 years ago

DAddYE commented 13 years ago

@achiu,

Im planning to add some new features to our generator, but since you are the Lead of this gem I would to know:

1) We need to add the ability to create new components after the project was created i.e.

padrino g foo
cd foo
# ... mmm i forgot testsss!!!
padrino g minitest
# ... WTF I forgot also persistence adapter!
padrino g mini_record
# ... now I need some js!
padrino g jquery

2) We need a -i, --interactive mode, we have 200+ options, so we some like:

padrino g foo -i
Hi Davide D'Agostino,

do you need a persistence adpater? Choose one of:
1) MongoMapper
2) DataMapper
3) MongoID
4) ActiveRecord
5) MiniRecord
6) ...

do you need some js frameworks? Choose one of:
1) jquery
3) mootools

....

@achiu what do you think?? @nesquena?

We can catch the moment also for make a small refactoring on our gen internals, decoupling a rewriting some things... no?

achiurizo commented 13 years ago

@DAddYE i like 1) because that use case happens alot. Some user wants to generate a component aftewards and can't so i agree with this. 2) Is good it fits with the wizard idea sort of and its a 'nice-to-have'.

I'm in the process of finishing the minitest generator. I'll spend some time seeing how the gen's can be clean up and perhaps add these features in.

DAddYE commented 13 years ago

woot, thanks man! I will see your changes! Great!

nesquena commented 13 years ago

Just putting it out there, let's move this discussion to the next point release. There's a lot going on in this release already. We can incoporate the minitest component in this release though. Is that OK?

DAddYE commented 13 years ago

Sure, can we add also mini_record? Requires few code and my staff use it intensively. Is that okey for you guys?

@nate you prefer that I separate DSL/Autorun for the next release? If you want we can create a new branch.

nesquena commented 13 years ago

Just my two cents but I am pretty sure installing mini_record involves this gem 'mini_record'. Are you saying seriously that you can't use the ActiveRecord component and add that one line to the gemfile? To me seems a bit unnecessary. @achiu

@daddye Yeah can we move the dsl and autorun to another branch and then wait for the next release. That way we can properly document and add integration tests, etc.

achiurizo commented 13 years ago

@DAddYE yeah I agree with @nesquena there. It's relatively simple to incorporate mini_record just by using the AR. perhaps it can be a plugin? That would make much more sense to me.

Let's just push minitest and these ideas to 0.10.4 then as this release already seems to have enough.

DAddYE commented 13 years ago

@arthur, mmm not at all, mini_record doesn't need schema and migrations so would be better if we can integrate it in our gen tweaking migrations only for those that need to rename columns.

nesquena commented 13 years ago

If you feel very strongly about it then go ahead, one more component won't hurt us too much even if a single gemfile addition and the skip migration flag is very similar. Maybe in the next release 0.10.4?

DAddYE commented 13 years ago

If isn't unobtrusive I prefer to add it for this release, but the final decision must be taken from @achiu. Feel free to do the best for our gen and our stability.

nesquena commented 13 years ago

Agreed, I will happily defer to your guys decision for generator component stuff. I think we should have minitest this version for sure (in the spirit of the switch) and I am Ok with or without mini_record.

dariocravero commented 11 years ago

What about planning this for 1.0?

ujifgc commented 11 years ago

I agree, there's quite similar #470

achiurizo commented 11 years ago

@dariocravero @ujifgc this most likely will be a 1.0 release. Maybe some of the feature requests for generators can come in before, that way we have some time to feel out how it all fits, and by 1.0, we can better re-factor everything to support them.

dariocravero commented 11 years ago

Great idea @achiu!