README.textile in grimen-dry_scaffold-0.2.6 vs README.textile in grimen-dry_scaffold-0.3.0

- old
+ new

@@ -22,19 +22,23 @@ h3. Optional: h4. Controllers/Views -* "*will_paginate*":http://github.com/mislav/will_paginate - Pagination -* "*formtastic*":http://github.com/justinfrench/formtastic - DRY and semantic forms * "*inherited_resources*":http://github.com/josevalim/inherited_resources - DRY/Resourceful controllers +* "*formtastic*":http://github.com/justinfrench/formtastic - DRY and semantic forms +* "*will_paginate*":http://github.com/mislav/will_paginate - Pagination h4. Models * "*factory_girl*":http://github.com/thoughtbot/factory_girl - Fixture-replacement * "*machinist*":http://github.com/notahat/machinist - Fixture-replacement * "*object_daddy*":http://github.com/flogic/object_daddy - Fixture-replacement + +h4. Testing + +* "*Shoulda*":http://github.com/thoughtbot/shoulda - Testing framework h2. Features h3. Overview @@ -45,11 +49,11 @@ * Generates formtastic - very DRY - forms (using "formtastic" by Justin French et. al.) by default. Note: Can be turned off. * Generates resourceful - even DRYer - controllers (using the "inherited_resources" by José Valim) by default. Note: Can be turned off. * Collection pagination using will_paginate by default. Note: Can be turned off. * Optionally specify what actions/views to generate (stubs for specified REST-actions will be generated). * Optionally specify what respond_to-formats to generate (stubs for the most common respond_to-formats will be generated). -* Generates default helpers/models/migrations, and REST-routes. +* Generates default helpers/models/migrations, and REST-routes (if not already defined). h3. Formtastic Forms Quick and dirty; Formtastic makes your form views cleaner, and your life as a Rails developer easier (for real). Formtastic forms can be turned off, but I would recommend any Rails developer to consider using it - there is really no good reason not to if you not running very old version of Rails. @@ -170,11 +174,11 @@ h3. More To Come... (TODO) These are things I have in mind: * Handle belongs_to, i.e. specify MODEL --belongs-to PARENT_MODEL, which generates proper routes, proper before-filters if inherited_resources-controller, adding belongs_to-association in model, and correct form_for arguments. -* Choose test suits: testunit/shoulda/rspec +* RSpec-support? h2. Setup Installing DryScaffold is easy: @@ -209,30 +213,30 @@ h4. Manual Get the gems...you want: <pre>sudo gem install haml -sudo gem install will_paginate +sudo gem install mislav-will_paginate sudo gem install justinfrench-formtastic sudo gem install josevalim-inherited_resources</pre> ...and same for the config config: @config/environments/development.rb@ <pre>config.gem 'haml' config.gem 'will_paginate' -config.gem 'justinfrench-formtastic', :lib => 'formtastic, :source => 'http://gems.github.com' +config.gem 'justinfrench-formtastic', :lib => 'formtastic', :source => 'http://gems.github.com' config.gem 'josevalim-inherited_resources', :lib => 'inherited_resources', :source => 'http://gems.github.com'</pre> h2. Usage -<pre>./script/generate dry_scaffold ModelName [attribute:type attribute:type] [_actions:new,create,...] [_formats:html,json,...] [_indexes:attribute,...] [--skip-pagination] [--skip-resourceful] [--skip-formtastic] [--skip-views] [--skip-helpers] [--skip-tests] [--include-layout] [--fixtures] [--fgirl] [--machinist] [--odaddy] [--skip-migration] [--skip-timestamps]</pre> +<pre>./script/generate dry_scaffold ModelName [attribute:type attribute:type] [_actions:new,create,...] [_formats:html,json,...] [_indexes:attribute,...] [--skip-pagination] [--skip-resourceful] [--skip-formtastic] [--skip-views] [--skip-helpers] [--skip-migration] [--skip-timestamps] [--skip-tests] [--layout] [--tunit] [--shoulda] [--fixtures] [--fgirl] [--machinist] [--odaddy]</pre> ...or use the alias @dscaffold@ instead of @dry_scaffold@. For generating just a *model*, then use: -<pre>./script/generate dry_model ModelName [attribute:type attribute:type] [_indexes:attribute,...] [--fixtures] [--fgirl] [--machinist] [--odaddy] [--skip-migration] [--skip-timestamps] [--skip-tests]</pre> +<pre>./script/generate dry_model ModelName [attribute:type attribute:type] [_indexes:attribute,...] [--skip-migration] [--skip-timestamps] [--skip-tests] [--tunit] [--shoulda] [--fixtures] [--fgirl] [--machinist] [--odaddy]</pre> ...or use the alias @dmodel@ instead of @dry_model@. h3. Model Name @@ -378,28 +382,33 @@ * @--skip-pagination@ - Don't generate pagination of collections in controller and views, i.e. don't use *will_paginate*. * @--skip-resourceful@ - Don't generate resourceful controller, i.e. don't use *inherited_resources*. * @--skip-formtastic@ - Don't generate formtastic forms in views, i.e. don't use *formtastic*. * @--skip-views@ - Don't generate views. * @--skip-helpers@ - Don't generate helpers. -* @--skip-tests@ - Don't generate tests (functional/unit/...). * @--skip-builders@ - Don't generate builders. * @--layout@ - Generate layout. h4. Model These are the options for the model/scaffold-generators. -* @--fixtures@ - Generate fixtures. -* @--fgirl@ - Generate *factory_girl* factories. -* @--machinist@ - Generate *machinist* blueprints (factories). -* @--odaddy@ - Generate *object_daddy* generator/factory methods. * @--skip-timestamps@ - Don't add timestamps to the migration file. * @--skip-migration@ - Skip generation of migration file. + +h4. All +* @--skip-tests@ - Don't generate tests (functional/unit/...). +* @--tunit@ - Generate/Use test_unit tests. Note: Rails default. +* @--shoulda@ - Generate/Use *shoulda* tests. +* @--fixtures@ - Generate/Use fixtures. Note: Rails default. +* @--fgirl@ - Generate/Use *factory_girl* factories. +* @--machinist@ - Generate/Use *machinist* blueprints (factories). +* @--odaddy@ - Generate/Use *object_daddy* generator/factory methods. + As DryScaffold is built upon Rails generator, the default generator options is available as well. For more details; see Rails documentation. -h3. Setting Defaults +h3. Setting Defaults You can set defaults for the generator args/options in @config/scaffold.yml@. To generate this file, simply do: <pre>rake dry_scaffold:config:generate</pre> @@ -408,14 +417,14 @@ No need for more samples here, just create a new Rails project, install DryScaffold and it's dependencies, and try it out! For your inspiration, you could try the following: <pre>./script/generate dry_scaffold Zebra name:string about:text --skip-resourceful -./script/generate dry_scaffold Kangaroo name:string about:text --skip-formtastic +./script/generate dscaffold Kangaroo name:string about:text --skip-formtastic ./script/generate dscaffold Duck name:string about:text _actions:new,create,index,quack ./script/generate dscaffold Parrot name:string about:text _formats:html,xml,yml -./script/generate dscaffold GoldFish name:string about:text _indexes:name --fgirl -./script/generate dry_model Frog name:string about:text _indexes:name,name+about --fixtures</pre> +./script/generate dmodel GoldFish name:string about:text _indexes:name --fgirl +./script/generate dmodel Frog name:string about:text _indexes:name,name+about --fixtures</pre> ...or just go crazy! h2. Bugs & Feedback \ No newline at end of file