Archive for September 2008

Set JVM parameters in JRuby

Use -J options. For example, to increase Java heap space for JRuby, use

jruby -J-Xmx512m some_ruby.rb

See more at JRuby Wiki Performance Tuning

Comments

Library: JS.Class – Ruby-style Javascript

JS.Class – Ruby-style Javascript by James Coglan

JS.Class is a library designed to facilitate object-oriented development in JavaScript. It implements Ruby’s core object, module and class system and some of its metaprogramming facilities, giving you a powerful base to build well-structured OO programs.

Comments

Article: Automated integration testing with Selenium, Maven and Jetty

Automated integration testing with Selenium, Maven and Jetty by Kevin McCormack

Putting all of this together, we’d like to share with you the Maven configurations and Java code that we use to accomplish automated one-step Selenium integration testing for a web application running in Jetty using Maven.

Comments (1)

Rails plugin: Asset Packager

Asset Packager plugin by Scott Becker

JavaScript and CSS Asset Compression for Production Rails Apps.

When it comes time to deploy your new web application, instead of sending down a dozen JavaScript and CSS files full of formatting and comments, this Rails plugin makes it simple to merge and compress JavaScript and CSS down into one or more files, increasing speed and saving bandwidth.

Comments

Article: A First Take at InvokeDyanmic

A First Take at InvokeDyanmic by Charles Nutter

JSR-292 started out life as a proposal for a new bytecode, "invokedynamic", to accompany the four other "invoke" bytecodes by allowing for dynamic invocation. When it was announced, the early concept provided only for invocation without a static-typed signature. It still required a call to eventually reach a real method on a real type, and it did not provide (or did not specify) a way to alter the JVM's normal logic for looking up what method it should actually invoke. For languages like JRuby and Groovy, which store method tables in their own structures, this meant the original concept was essentially useless: most dynamic languages have "open" types whose methods can be added, removed, and redefined later, so it was impossible to ever present a normal type invokedynamic could call.

Comments

Article: 5 Ways to Optimize AJAX in Ruby on Rails

5 Ways to Optimize AJAX in Ruby on Rails by Shanti Braford

What we’ll be addressing today, though, is optimizing ever more complex AJAX requests that might involve a multitude of SQL calls and JavaScript rendering techniques

Comments

Project: HyperactiveResource for Rails

HyperactiveResource from github

Many have said that ActiveResource is not really “complete”. On the surface, this means that some features that are documented aren’t implemented. Digging a little deeper, we find that some features that should exist don’t.

Arguably, a “complete” ActiveResource would behave like ActiveRecord or, as the rdoc for ActiveResource states “very similarly to Active Record”.

Hyperactive Resource is MDL’s extension to ActiveResource::Base written to support our Patient Registry and goes a long way towards the goal of an ActiveResource that behaves like ActiveRecord.

Comments

Article: Rails Migrations

Migrations by Frederick Cheung

Migrations are a convenient way for you to alter your database in a structured and organised manner. You could edit fragments of SQL by hand but you would then be responsible for telling other developers that they need to go and run it. You'd also have to keep track of which changes need to be run against the production machines next time you deploy. Active Record tracks which migrations have already been run so all you have to do is update your source and run rake db:migrate. Active Record will work out which migrations should be run.

Comments

Article: Rails Routing from the Outside In

Rails Routing from the Outside In by Mike Gunderloy

This guide covers the user-facing features of Rails routing. By referring to this guide, you will be able to:

* Understand the purpose of routing
* Decipher the code in routes.rb
* Construct your own routes, using either the classic hash style or the now-preferred RESTful style
* Identify how a route will map to a controller and action

Comments

Article: Build Java projects with Raven

Build Java projects with Raven by Paul Duvall

Ant is arguably the de facto build tool for the Java™ platform; however, other build tools, which support a more expressive paradigm that XML lacks, are entering the scene. In this installment of Automation for the people, automation expert Paul Duvall describes how Raven, a build platform built on top of Ruby, leverages the power of a full-featured programming language with the simplicity of a build-centric Domain Specific Language.

Comments