官术网_书友最值得收藏!

Time for action – Creating an employee application

To create a Rhodes Application, we can either use Rhogen or its alias; Rhodes commands. Virtually all Rhodes applications start the same way; with the Rhogen command. This handy program creates a skeleton of a Rhodes application in a directory of your choice. To get started, make a directory for your Rhodes projects and then run the command rhogen app <application_name> to make the initial sample application.

For our employee application, we'll run the following commands:

$ mkdir Rhodes_app
$ cd Rhodes_app
$ rhogen app employee_application

Generating with app generator:

     [ADDED]  employee_application/rhoconfig.txt
     [ADDED]  employee_application/build.yml
     [ADDED]  employee_application/app/application.rb
     [ADDED]  employee_application/app/index.erb
     [ADDED]  employee_application/app/index.bb.erb
     [ADDED]  employee_application/app/layout.erb
     [ADDED]  employee_application/app/loading.html
     [ADDED]  employee_application/Rakefile
     [ADDED]  employee_application/app/helpers
     [ADDED]  employee_application/icon
     [ADDED]  employee_application/app/Settings
     [ADDED]  employee_application/public
     [ADDED]  employee_application/app/loading.png

Notice the output, how many files and directories the Rhogen command creates. This automatic generation of standard directories and file structure is one of the many advantages of Rhodes. It immediately gets you from zero to a basic functional application. Moreover, since the structure is common to all the Rhodes apps, you can immediately get your bearings when looking at someone else's code. We'll learn about most of these files and the directories in the rest of this book.

What just happened?

We just created an employee application using the Rhogen command. This command automatically generates a basic skeleton for your application, which can be enhanced easily according to your needs.

Have a go hero – Exploring the Rhogen command

Now, we will explore the capabilities of the Rhogen command. To get a list of all the options available for this command, type the following in the command prompt:

$ rhogen

The following output should be generated:

主站蜘蛛池模板: 莱西市| 贺兰县| 大竹县| 兴义市| 华容县| 正定县| 乳山市| 马山县| 思南县| 文安县| 开化县| 澄迈县| 香格里拉县| 商河县| 千阳县| 长海县| 桐庐县| 长葛市| 闽侯县| 湖北省| 长葛市| 古田县| 郎溪县| 连山| 北宁市| 栾城县| 和政县| 彭山县| 泰宁县| 突泉县| 岚皋县| 蓬溪县| 沙洋县| 土默特左旗| 新绛县| 崇礼县| 基隆市| 田东县| 遂宁市| 舞阳县| 斗六市|