Buying Options
JRuby Cookbook
Print $34.99
Add to Cart
Print+Ebook $38.49
Add to Cart
Ebook $27.99
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £26.99
Add to Cart
What is this?
Description
This Cookbook offers practical solutions for using the JRuby, the Java implementation of the Ruby language. Targeted recipes help you deploy Rails web applications on Java servers, integrate JRuby code with Java technologies, develop JRuby desktop applications with Java toolkits, and more. Using numerous reusable code samples, JRuby Cookbook demonstrates how you can take advantage of JRuby's potential.
Full Description
Table of Contents
  1. Chapter 1 Getting Started

    1. Introduction

    2. Installing JRuby

    3. Managing Packages with RubyGems

    4. Using Both Ruby and JRuby

    5. Sharing RubyGems

    6. Referencing Java Classes from Ruby

    7. Converting a Ruby Array into a Java Array

    8. Adding JAR Files to the Classpath

    9. Extending a Java Class in Ruby

    10. Implementing a Java Interface in Ruby

    11. Opening Java Classes with JRuby

    12. Setting Up Eclipse for JRuby Development

    13. Setting Up NetBeans for JRuby Development

    14. Platform Detection in a JRuby Application

  2. Chapter 2 JRuby on Rails

    1. Introduction

    2. Installing and Setting Up Rails

    3. Packaging Rails As a Java EE Web Application

    4. Using an External Gem Repository with a Web Application

    5. Configuring the JRuby-Rack Servlet

    6. Packaging Rails with a JNDI DataSource

    7. Deploying Rails on Tomcat

    8. Deploying Rails on JBoss

    9. Deploying Rails on Jetty

    10. Deploying Rails with jetty_rails

    11. Deploying Rails with Mongrel

    12. Deploying Rails on the GlassFish v2 Server

    13. Using the GlassFish v3 Gem

    14. Using ActiveRecord Outside of Rails

    15. Accessing Common Java Servlet Information

    16. Configuring Session Storage

    17. Controlling the Classes, Directories, and Other Files Packaged into a Rails WAR File

    18. Changing the Name of the WAR File and the Staging Area

    19. Deploying a Rails Application to the Root Context

    20. Creating a Rails Application with Aptana Studio

    21. Accessing Static Files in Your Rails Java EE Application

  3. Chapter 3 Java Integration

    1. Introduction

    2. Executing Ruby from Java

    3. Invoking JRuby Through the Bean Scripting Framework

    4. Invoking JRuby Through Java Scripting Support

    5. Logging from Ruby with Jakarta Commons Logging

    6. Using the Java Concurrency Utilities

    7. Creating JavaBean Style Accessor Methods

    8. Writing Consistent Code

    9. Transforming XML with TrAX

    10. Creating a Pool of JRuby Runtimes

    11. Performing Remote Management with JMX

    12. Accessing Native Libraries with JRuby

  4. Chapter 4 Enterprise Java

    1. Introduction

    2. Creating a JNDI Context

    3. Sending JMS Messages

    4. Receiving JMS Messages

    5. Implementing an Enterprise JavaBean with JRuby

    6. Defining Spring Beans in JRuby

    7. Creating Refreshable JRuby Spring Beans

    8. Defining JRuby Spring Beans Inline

    9. Applying Spring-Aware Interfaces to JRuby Objects

    10. Creating Spring MVC Controllers with JRuby

    11. Using Hibernate with JRuby

    12. Using the Java Persistence API with JRuby

    13. Making SOAP Calls

    14. Simplifying LDAP Access

  5. Chapter 5 User Interface and Graphics

    1. Introduction

    2. Creating Swing Applications

    3. Swing Event Handling

    4. Long-Running Tasks in Swing Applications

    5. Packaging Standalone Applications

    6. Packaging JRuby Web Start Applications

    7. Creating JRuby Applets

    8. Manipulating Images

    9. Creating SWT Applications

    10. Accessing the Native Desktop

    11. Accessing the System Tray

    12. Swing Development with JRuby Domain-Specific Languages

    13. Using the Monkeybars Framework for Swing Development

    14. Creating Qt Applications with JRuby

  6. Chapter 6 Build Tools

    1. Introduction

    2. Adding Ruby Scripting to Ant Builds

    3. Using Ruby in Ant Conditions

    4. Writing an Ant Task in Ruby

    5. Adding Ruby Scripting to Maven Builds

    6. Writing a Maven Plugin with JRuby

    7. Building Java Projects with Raven

    8. Referencing Libraries with Raven

    9. Hosting a Private Raven Repository

    10. Running JUnit Tests with Raven

    11. Building Java Projects with Buildr

    12. Referencing Libraries with Buildr

    13. Building with Rake Inside Hudson

    14. Adding Ruby Script to a Hudson Job

  7. Chapter 7 Testing

    1. Introduction

    2. Unit Testing Java Code with Test/Unit

    3. Unit Testing Java Code with dust

    4. Unit Testing Java Code with Expectations

    5. Testing Java Code with RSpec

    6. Creating Mock Objects with Mocha

    7. Modifying the JtestR Classpath

    8. Grouping Tests for JtestR

    9. Using the JtestR Command-Line Options

    10. Running JtestR with Ant

    11. Running JtestR with Maven

    12. Improving JtestR Performance

  8. Chapter 8 The JRuby Community

    1. Introduction

    2. Building JRuby from Source

    3. Submitting an Issue Report for JRuby

    4. Using the JRuby Mailing Lists

  1. Colophon

View Full Table of Contents
Product Details
Title:
JRuby Cookbook
By:
Justin Edelson, Henry Liu
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
November 2008
Ebook Release:
November 2008
Pages:
224
Print ISBN:
978-0-596-51980-3
| ISBN 10:
0-596-51980-X
Ebook ISBN:
978-0-596-15647-3
| ISBN 10:
0-596-15647-2
Customer Reviews
About the Authors
  1. Justin Edelson

    Justin Edelson is the Vice President of Platform Engineering for MTV Networks. He was the co-author (with Brett McLaughlin) of Java & XML, 3rd Edition, published in December 2006.

    View Justin Edelson's full profile page.

  2. Henry Liu

    Henry Liu is an experienced software developer and game designer. He is currently a Senior Software Developer at MTV Networks. He maintains an Open Source Ruby project for collaborative filtering named slopeone-gem and is an active member of the New York City Ruby Users Group.

    View Henry Liu's full profile page.

Colophon

The animal on the cover of JRuby Cookbook is an African civet (Civettictis civetta). Unlike the other members of the Viverridae family, which resemble cats, the African civet is a dog-like animal with large hindquarters and a low-head stance. Its coat is gray with black stripes and spots, and it has a gray face, a white snout, and dark markings around its eyes like a raccoon. Along its back runs a short mane of stiff hairs that stand on end when the civet is alarmed. From head to tail, an African civet is about 4 feet long, and it weighs 30 to 40 pounds.

The African civet ranges across sub-Saharan Africa in forests and savannas. Solitary and nocturnal, it hides in caves or tree hollows during the day. It eats anything edible, including insects, plants, and carrion, and it preys on small animals such as hares and moongooses. Like all civets, the African civet has glands that produce a scented fluid, which it uses to mark its territory. This musk, known as civetone or simply civet, is one of the oldest known ingredients in perfumes. Although it is still used in the perfume industry today, the trade for civet musk has been on the decline since synthetic musk was introduced in the mid-1900s.

The cover image is from Richard Lydekker's Royal Natural History. The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSansMonoCondensed.

  • Book cover of JRuby Cookbook