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

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:

主站蜘蛛池模板: 琼海市| 合肥市| 苏州市| 正阳县| 泰宁县| 商城县| 济阳县| 克什克腾旗| 和龙市| 克东县| 海城市| 米易县| 安化县| 晋中市| 始兴县| 两当县| 广汉市| 和平区| 汕尾市| 元朗区| 德州市| 陇川县| 章丘市| 潮州市| 靖江市| 玛曲县| 开平市| 泾源县| 永修县| 紫金县| 石首市| 宜宾市| 五峰| 金华市| 和顺县| 合作市| 银川市| 依兰县| 饶阳县| 辽阳市| 富川|