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

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:

主站蜘蛛池模板: 马公市| 军事| 梁平县| 彰化县| 苍南县| 乌审旗| 临漳县| 阿拉善右旗| 剑阁县| 广南县| 平乐县| 大余县| 沈阳市| 武定县| 桑植县| 佳木斯市| 崇明县| 眉山市| 邯郸县| 石首市| 朝阳县| 德格县| 都安| 商河县| 毕节市| 左权县| 庆元县| 靖西县| 汝南县| 裕民县| 温宿县| 玛纳斯县| 芜湖县| 乃东县| 天峻县| 吴旗县| 囊谦县| 婺源县| 常州市| 库车县| 阿坝县|