Paul Adams of Webmonkey is getting your feet wet with Ruby on Rails . So, I thought we could just compare how the same exercise would play out in Mocha.
Paul starts by pointing you to the installation instructions so you can install Ruby and Rails. He says "However you get your RoR on your system, the procedure is pretty simple once it's installed", whatever that means ;-) Next, he points out that you also need to install a database system such as MySQL or PostgreSQL.
Then he creates a "bookmarker" database and adds a "bookmarks" table. Then he types "rails Bookmarker" to create a new Rails app. Then a "config/database.yml" file to point to the previously created database. Then he types "ruby ./Bookmarker/script/generate scaffold Bookmark" to create the app's components based on that database. Then he starts the server and goes to http://oursite.org:3000/bookmarks. Finally he edits a template to add links to the bookmarked URLs.
Now let's see what we have to do in order to get there with Mocha:
-
You need to have Java installed
- download OpenMocha
- extract the downloaded archive
- execute ./start.sh (or start.bat on Windows)
- create an admin account at http://oursite.org:8080/register
- copy the authentication code to the server.properties file
- login at http://oursite.org:8080/login
Actually, this already completes our exercise, but lets say you want to add a new, separate Bookmarks application.
- copy apps/main to apps/bookmarks
-
add "bookmarks" on a new line to the apps.properties file
- restart OpenMocha
- go to http://oursite.org:8080/bookmarks/login
Done. Don't believe me? Try it!
Ok, I admit this turned out to be a silly exercise. But hey, I only promised to get your feet wet - and believe me, that you did more than you realise.
Welcome to OpenMocha!
You really do have a working web application without writing a single line of code. And as you will see in a forthcoming example, you can now customize this application further by adding code, extending its functionality or overriding any default behavior.
25.07.2005, 13:22