CSC/ECE 517 Fall 2011/ch2 2f mm: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
==Rails Application Scripts==
==Rails Application Scripts==


When you create a new Rails application, a directory named <tt>script</tt> is generated. In Rails 2, this directory is populated with a set of scripts that can be executed by the programmer. A few of the more important ones are as follows:
When you create a new Rails application, a directory named <tt>script</tt> is generated. In Rails 2, this directory is populated with a set of scripts that can be executed by the programmer. A few of the more important ones are as follows<ref>Ruby 2009, pp 257-258 </ref>:
*<tt>generate</tt>: Used to generate code for controllers, mailers, models, scaffolds and other sets of code.
*<tt>generate</tt>: Used to generate code for controllers, mailers, models, scaffolds and other sets of code.
*<tt>destroy</tt>: Used to destroy code created by the <tt>generate</tt> method.
*<tt>destroy</tt>: Used to destroy code created by the <tt>generate</tt> method.
Line 14: Line 14:
*<tt>performance</tt> directory: Contains scripts used by the programmer to help understand the performance characteristics of the application being built.
*<tt>performance</tt> directory: Contains scripts used by the programmer to help understand the performance characteristics of the application being built.


Rails 3 does away with all of these scripts and compiles them all into a single script named <tt>rails</tt>. With this script, the programmer can access all of the functionality that was available with the separate scripts. To make things even easier, the necessity to call this script outright is even unnecessary. By using the operating systems installed <tt>''rails''</tt> command (ie, <tt>/usr/bin/rails</tt> on Linux systems) in the root of any Rails 3 application, it will know to call this script.
Rails 3 does away with all of these scripts and compiles them all into a single script named <tt>rails</tt>. With this script, the programmer can access all of the functionality that was available with the separate scripts. To make things even easier, the necessity to call this script outright is even unnecessary. By using the operating systems installed <tt>'''rails'''</tt> command (ex, <tt>/usr/bin/rails</tt> on Linux systems) in the root of any Rails 3 application, it will know to call this script.
 
 


=References=
=References=
==Citation Notes==
<references/>
==Full Reference Information==
Ruby, Sam, Dave Thomas and David Hansson. ''Agile Web Development with Rails: Third Edition'': The Pragmatic Programmers LLC, 2009.

Revision as of 03:45, 21 September 2011

Introduction

Rails 2 vs. Rails 3

A lot changed in the update from Rails 2 to Rails 3. We will explore a few of the key areas that will affect a programmer's everyday coding.

Rails Application Scripts

When you create a new Rails application, a directory named script is generated. In Rails 2, this directory is populated with a set of scripts that can be executed by the programmer. A few of the more important ones are as follows<ref>Ruby 2009, pp 257-258 </ref>:

  • generate: Used to generate code for controllers, mailers, models, scaffolds and other sets of code.
  • destroy: Used to destroy code created by the generate method.
  • server: Starts up the Rails application in a self-contained web server.
  • plugin: Helps with the installation and administration of plug-ins to the Rails framework.
  • performance directory: Contains scripts used by the programmer to help understand the performance characteristics of the application being built.

Rails 3 does away with all of these scripts and compiles them all into a single script named rails. With this script, the programmer can access all of the functionality that was available with the separate scripts. To make things even easier, the necessity to call this script outright is even unnecessary. By using the operating systems installed rails command (ex, /usr/bin/rails on Linux systems) in the root of any Rails 3 application, it will know to call this script.


References

Citation Notes

<references/>

Full Reference Information

Ruby, Sam, Dave Thomas and David Hansson. Agile Web Development with Rails: Third Edition: The Pragmatic Programmers LLC, 2009.