padrino-framework
padrino-framework copied to clipboard
Refactoring Generators
- [ ] fix #1963
@achiu,
Im planning to add some new features to our generator, but since you are the Lead of this gem I would to know:
- 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
- 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?
@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.
woot, thanks man! I will see your changes! Great!
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?
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.
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.
@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.
@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.
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?
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.
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.
What about planning this for 1.0?
I agree, there's quite similar #470
@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.
Great idea @achiu!