Pat Maddox
2006-Nov-03 23:38 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator ======================= By Pat Maddox Use this generator to generate RESTful scaffolding with RSpec specifications. Syntax is exactly the same as the scaffold_resource generator: ./script/generate rspec_resource ModelName [field:type field:type] When you run this generator, it will create a migration, model, and model spec file. In addition, it gives you a RESTful controller with all the actions filled in, and a complete specification for the controller. Views are all hooked up too. Generate the code, run the migration, and you''ve got 26 passing RESTful controller specifications. Salt and hot sauce to taste. http://svn.flpr.org/public/plugins/rspec_resource_generator/ Most code shamelessly jacked from the scaffold_resource plugin. I did, however, write all the specs. This code released under the DoWhatYouWantWithIt license.
Luke Redpath
2006-Nov-04 02:40 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
Ah Pat...so is this why you were quizzing me on speccing controllers today huh? ;) Looks good mate. I''ll give it a bash when I''m next in the office. Cheers, Luke Redpath contact at lukeredpath.co.uk On 3 Nov 2006, at 23:38, Pat Maddox wrote:> rspec_resource_generator > =======================> > By Pat Maddox > > Use this generator to generate RESTful scaffolding with RSpec > specifications. > > Syntax is exactly the same as the scaffold_resource generator: > ./script/generate rspec_resource ModelName [field:type field:type] > > When you run this generator, it will create a migration, model, and > model spec file. In addition, it gives you a RESTful controller with > all the actions filled in, and a complete specification for the > controller. Views are all hooked up too. > > Generate the code, run the migration, and you''ve got 26 passing > RESTful controller specifications. Salt and hot sauce to taste. > > http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > Most code shamelessly jacked from the scaffold_resource plugin. I > did, however, write all the specs. This code released under the > DoWhatYouWantWithIt license. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
aslak hellesoy
2006-Nov-04 09:29 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote:> rspec_resource_generator > =======================> > By Pat Maddox > > Use this generator to generate RESTful scaffolding with RSpec specifications. > > Syntax is exactly the same as the scaffold_resource generator: > ./script/generate rspec_resource ModelName [field:type field:type] > > When you run this generator, it will create a migration, model, and > model spec file. In addition, it gives you a RESTful controller with > all the actions filled in, and a complete specification for the > controller. Views are all hooked up too. > > Generate the code, run the migration, and you''ve got 26 passing > RESTful controller specifications. Salt and hot sauce to taste. >That is awesome!> http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > Most code shamelessly jacked from the scaffold_resource plugin. IThe generators in Rails *will* evolve and copying/forking its code will inevitably result in a maintenance nightmare (or obsoletion). That''s why the existing RSpec generators (rspec_model and rspec_controller) _reuse_ the templates from Rails instead of forking them. The only templates we wrote ourselves are the ones that generate the specs. Maintaining that is easy - it''s *our* code. Would you consider refactoring your code according to this principle and delete all the duplicated (copied) code? In that case we''ll include your contribution into RSpec on Rails. There is already an RFE for it here: http://rubyforge.org/tracker/index.php?func=detail&aid=6098&group_id=797&atid=9464 Cheers, Aslak> did, however, write all the specs. This code released under the > DoWhatYouWantWithIt license. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Benjamin Curtis
2006-Nov-04 15:03 UTC
Re: [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
Posted at http://www.agilewebdevelopment.com/plugins/ rspec_resource_generator :) -- Building an e-commerce site with Rails? http://www.agilewebdevelopment.com/rails-ecommerce On Nov 3, 2006, at 3:38 PM, Pat Maddox wrote:> > rspec_resource_generator > =======================> > By Pat Maddox > > Use this generator to generate RESTful scaffolding with RSpec > specifications. > > Syntax is exactly the same as the scaffold_resource generator: > ./script/generate rspec_resource ModelName [field:type field:type] > > When you run this generator, it will create a migration, model, and > model spec file. In addition, it gives you a RESTful controller with > all the actions filled in, and a complete specification for the > controller. Views are all hooked up too. > > Generate the code, run the migration, and you''ve got 26 passing > RESTful controller specifications. Salt and hot sauce to taste. > > http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > Most code shamelessly jacked from the scaffold_resource plugin. I > did, however, write all the specs. This code released under the > DoWhatYouWantWithIt license.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pat Maddox
2006-Nov-04 16:42 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
Well I was just writing specs for one RESTful controller, then I started writing nearly the exact same specs..obviously then it was time for a plugin. Sorry for not giving you credit earlier, I was at the end of a long coding session and just wanted to get rid of it. You''re in there now :) Pat On 11/3/06, Luke Redpath <contact at lukeredpath.co.uk> wrote:> Ah Pat...so is this why you were quizzing me on speccing controllers > today huh? ;) > > Looks good mate. I''ll give it a bash when I''m next in the office. > > Cheers, > Luke Redpath > contact at lukeredpath.co.uk > > > > On 3 Nov 2006, at 23:38, Pat Maddox wrote: > > > rspec_resource_generator > > =======================> > > > By Pat Maddox > > > > Use this generator to generate RESTful scaffolding with RSpec > > specifications. > > > > Syntax is exactly the same as the scaffold_resource generator: > > ./script/generate rspec_resource ModelName [field:type field:type] > > > > When you run this generator, it will create a migration, model, and > > model spec file. In addition, it gives you a RESTful controller with > > all the actions filled in, and a complete specification for the > > controller. Views are all hooked up too. > > > > Generate the code, run the migration, and you''ve got 26 passing > > RESTful controller specifications. Salt and hot sauce to taste. > > > > http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > > > Most code shamelessly jacked from the scaffold_resource plugin. I > > did, however, write all the specs. This code released under the > > DoWhatYouWantWithIt license. > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Pat Maddox
2006-Nov-04 16:46 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > > > Most code shamelessly jacked from the scaffold_resource plugin. I > > The generators in Rails *will* evolve and copying/forking its code > will inevitably result in a maintenance nightmare (or obsoletion). > > That''s why the existing RSpec generators (rspec_model and > rspec_controller) _reuse_ the templates from Rails instead of forking > them. The only templates we wrote ourselves are the ones that generate > the specs. Maintaining that is easy - it''s *our* code. > > Would you consider refactoring your code according to this principle > and delete all the duplicated (copied) code? In that case we''ll > include your contribution into RSpec on Rails. > > There is already an RFE for it here: > http://rubyforge.org/tracker/index.php?func=detail&aid=6098&group_id=797&atid=9464All done. The only template remaining is the controller_spec template. Everything else is pulled from the standard Rails generators, and the rspec_model generator for the model spec. Anything else that should be done with that? Pat
aslak hellesoy
2006-Nov-04 21:10 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote:> On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > > http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > > > > > Most code shamelessly jacked from the scaffold_resource plugin. I > > > > The generators in Rails *will* evolve and copying/forking its code > > will inevitably result in a maintenance nightmare (or obsoletion). > > > > That''s why the existing RSpec generators (rspec_model and > > rspec_controller) _reuse_ the templates from Rails instead of forking > > them. The only templates we wrote ourselves are the ones that generate > > the specs. Maintaining that is easy - it''s *our* code. > > > > Would you consider refactoring your code according to this principle > > and delete all the duplicated (copied) code? In that case we''ll > > include your contribution into RSpec on Rails. > > > > There is already an RFE for it here: > > http://rubyforge.org/tracker/index.php?func=detail&aid=6098&group_id=797&atid=9464 > > All done. The only template remaining is the controller_spec > template. Everything else is pulled from the standard Rails > generators, and the rspec_model generator for the model spec. > > Anything else that should be done with that? >Not that I know of - sounds great! I''ll take a look at it tonight. Thanks a lot! Aslak> Pat > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2006-Nov-05 06:45 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > > On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > > > http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > > > > > > > Most code shamelessly jacked from the scaffold_resource plugin. I > > > > > > The generators in Rails *will* evolve and copying/forking its code > > > will inevitably result in a maintenance nightmare (or obsoletion). > > > > > > That''s why the existing RSpec generators (rspec_model and > > > rspec_controller) _reuse_ the templates from Rails instead of forking > > > them. The only templates we wrote ourselves are the ones that generate > > > the specs. Maintaining that is easy - it''s *our* code. > > > > > > Would you consider refactoring your code according to this principle > > > and delete all the duplicated (copied) code? In that case we''ll > > > include your contribution into RSpec on Rails. > > > > > > There is already an RFE for it here: > > > http://rubyforge.org/tracker/index.php?func=detail&aid=6098&group_id=797&atid=9464 > > > > All done. The only template remaining is the controller_spec > > template. Everything else is pulled from the standard Rails > > generators, and the rspec_model generator for the model spec. > > > > Anything else that should be done with that? > > > > Not that I know of - sounds great! I''ll take a look at it tonight. > > Thanks a lot!Agreed that this is great stuff. We''re about to do a release that has changed some things about which there seem to be some assumptions in the controller_spec template. What I''d propose is that we wait until after the release for this. We can tweak it to fit the newer approaches and then add it to rspec for the next release. David> > Aslak > > > Pat > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
aslak hellesoy
2006-Nov-05 09:01 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
On 11/5/06, David Chelimsky <dchelimsky at gmail.com> wrote:> On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > > On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > > > On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > > > > http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > > > > > > > > > Most code shamelessly jacked from the scaffold_resource plugin. I > > > > > > > > The generators in Rails *will* evolve and copying/forking its code > > > > will inevitably result in a maintenance nightmare (or obsoletion). > > > > > > > > That''s why the existing RSpec generators (rspec_model and > > > > rspec_controller) _reuse_ the templates from Rails instead of forking > > > > them. The only templates we wrote ourselves are the ones that generate > > > > the specs. Maintaining that is easy - it''s *our* code. > > > > > > > > Would you consider refactoring your code according to this principle > > > > and delete all the duplicated (copied) code? In that case we''ll > > > > include your contribution into RSpec on Rails. > > > > > > > > There is already an RFE for it here: > > > > http://rubyforge.org/tracker/index.php?func=detail&aid=6098&group_id=797&atid=9464 > > > > > > All done. The only template remaining is the controller_spec > > > template. Everything else is pulled from the standard Rails > > > generators, and the rspec_model generator for the model spec. > > > > > > Anything else that should be done with that? > > > > > > > Not that I know of - sounds great! I''ll take a look at it tonight. > > > > Thanks a lot! > > Agreed that this is great stuff. > > We''re about to do a release that has changed some things about which > there seem to be some assumptions in the controller_spec template. > > What I''d propose is that we wait until after the release for this. We > can tweak it to fit the newer approaches and then add it to rspec for > the next release. >Agreed. Pat, is it ok for you if we steal your code and check it into RSpec''s svn when time is ripe? You''ll be credited here: http://rspec.rubyforge.org/team.html Aslak> David > > > > > Aslak > > > > > Pat > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Pat Maddox
2006-Nov-05 13:31 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
On 11/5/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On 11/5/06, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > > On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > > > On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > > > > On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > > > > > http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > > > > > > > > > > > Most code shamelessly jacked from the scaffold_resource plugin. I > > > > > > > > > > The generators in Rails *will* evolve and copying/forking its code > > > > > will inevitably result in a maintenance nightmare (or obsoletion). > > > > > > > > > > That''s why the existing RSpec generators (rspec_model and > > > > > rspec_controller) _reuse_ the templates from Rails instead of forking > > > > > them. The only templates we wrote ourselves are the ones that generate > > > > > the specs. Maintaining that is easy - it''s *our* code. > > > > > > > > > > Would you consider refactoring your code according to this principle > > > > > and delete all the duplicated (copied) code? In that case we''ll > > > > > include your contribution into RSpec on Rails. > > > > > > > > > > There is already an RFE for it here: > > > > > http://rubyforge.org/tracker/index.php?func=detail&aid=6098&group_id=797&atid=9464 > > > > > > > > All done. The only template remaining is the controller_spec > > > > template. Everything else is pulled from the standard Rails > > > > generators, and the rspec_model generator for the model spec. > > > > > > > > Anything else that should be done with that? > > > > > > > > > > Not that I know of - sounds great! I''ll take a look at it tonight. > > > > > > Thanks a lot! > > > > Agreed that this is great stuff. > > > > We''re about to do a release that has changed some things about which > > there seem to be some assumptions in the controller_spec template. > > > > What I''d propose is that we wait until after the release for this. We > > can tweak it to fit the newer approaches and then add it to rspec for > > the next release. > > > > Agreed. Pat, is it ok for you if we steal your code and check it into > RSpec''s svn when time is ripe? > > You''ll be credited here: http://rspec.rubyforge.org/team.html > > AslakI''m not sure...that DoWhatYouWantWithIt license is pretty stringent :) Feel free to put it in whenever you think is good, and make whatever changes you feel appropriate as David mentioned. Pat
David Chelimsky
2006-Nov-05 17:01 UTC
[rspec-users] [PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
On 11/5/06, Pat Maddox <pergesu at gmail.com> wrote:> On 11/5/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > On 11/5/06, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > > > On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > > > > On 11/4/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > > > > > On 11/4/06, Pat Maddox <pergesu at gmail.com> wrote: > > > > > > > http://svn.flpr.org/public/plugins/rspec_resource_generator/ > > > > > > > > > > > > > > Most code shamelessly jacked from the scaffold_resource plugin. I > > > > > > > > > > > > The generators in Rails *will* evolve and copying/forking its code > > > > > > will inevitably result in a maintenance nightmare (or obsoletion). > > > > > > > > > > > > That''s why the existing RSpec generators (rspec_model and > > > > > > rspec_controller) _reuse_ the templates from Rails instead of forking > > > > > > them. The only templates we wrote ourselves are the ones that generate > > > > > > the specs. Maintaining that is easy - it''s *our* code. > > > > > > > > > > > > Would you consider refactoring your code according to this principle > > > > > > and delete all the duplicated (copied) code? In that case we''ll > > > > > > include your contribution into RSpec on Rails. > > > > > > > > > > > > There is already an RFE for it here: > > > > > > http://rubyforge.org/tracker/index.php?func=detail&aid=6098&group_id=797&atid=9464 > > > > > > > > > > All done. The only template remaining is the controller_spec > > > > > template. Everything else is pulled from the standard Rails > > > > > generators, and the rspec_model generator for the model spec. > > > > > > > > > > Anything else that should be done with that? > > > > > > > > > > > > > Not that I know of - sounds great! I''ll take a look at it tonight. > > > > > > > > Thanks a lot! > > > > > > Agreed that this is great stuff. > > > > > > We''re about to do a release that has changed some things about which > > > there seem to be some assumptions in the controller_spec template. > > > > > > What I''d propose is that we wait until after the release for this. We > > > can tweak it to fit the newer approaches and then add it to rspec for > > > the next release. > > > > > > > Agreed. Pat, is it ok for you if we steal your code and check it into > > RSpec''s svn when time is ripe? > > > > You''ll be credited here: http://rspec.rubyforge.org/team.html > > > > Aslak > > I''m not sure...that DoWhatYouWantWithIt license is pretty stringent :) > > Feel free to put it in whenever you think is good, and make whatever > changes you feel appropriate as David mentioned.Great! Thank you Pat. This will actually serve as a great example of how we think these specs should look. Cheers, David> > Pat > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >