GoRuCo Materials Available

Posted by Nick Sieger Thu, 10 May 2007 16:16:06 GMT

Busy times! My apologies for the post-conference talk delay. So, before this stuff becomes completely irrelevant, here are my slides and my demos from my talk at GoRuCo a couple weekends ago. Please let me know if you download the demos and have any problems with them.

From the README included in the demo bundle:

JRuby GoRoCo 2007 Demos

Nick gave these demos at his GoRuCo talk in NYC on April 21, 2007 and at SDForum Silicon Valley Ruby Conference on April 22, 2007.

Requirements

JRuby 0.9.9, Tomcat 5.5.23, RSpec 0.8.2, the MySQL JDBC connector as well as all the demo applications are included with this package. The only prerequisite (other than a Java VM) is that you should have a MySQL database running on localhost, with a password-less root user. If you need to change the user/password for the database server, make the changes in the mephisto/config/database.jruby.yml file.

Setup

Source init.sh or init.bat in your environment to set paths to JRuby.

$ . init.sh
> init.bat

JRBuilder

These examples emphasize the conciseness and structure of Ruby DSLs as a GUI assembly language. Run the following:

$ jrake jrb:hello
$ jrake jrb:tabs

View the source for these (and others) in jrbuilder/examples.

RSpec

This shows a simple RSpec example that exercises a Java ArrayList. The initial specs fails, but is easily fixed.

$ jrake rspec:run

Mephisto

This example shows building and deploying a .war file containing the Mephisto blog engine. It uses a snapshot of the Rails Integration plugin just before version 1.1.1.

MySQL is required for the database. As noted above, the database configuration assumes a password-less root user. If you need to change that assumption, edit the production section of the file mephisto/config/database.jruby.yml.

Several targets are available:

$ jrake meph:clean     # Clean Mephisto database and war file
$ jrake meph:database  # Setup Mephisto database
$ jrake meph:war       # Create Mephisto war

Before you can run the example, the mephisto database must be created.

$ jrake meph:database

Next, create the war file. This target creates the war file and copies it into the Tomcat webapps directory.

$ jrake meph:war

Next, run the Tomcat web container, and observe the war file getting deployed.

$ tomcat/bin/catalina.sh run

Finally, visit http://localhost:8080/ in a web browser, and see Mephisto running in a Java web container.

More information on the Rails Integration plugin (now renamed “Goldspike”) can be found at the JRuby wiki.

Tags ,  | no comments | no trackbacks