addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

NovaRUG/Web Platform DC Message Board The Northern Virginia Ruby Meetup Group Discussion Forum › Slides/Audio/Followup for JRuby Presentation

Slides/Audio/Followup for JRuby Presentation

Keith B.
keithrbennett
Reston, VA
Post #: 49
All -

I just uploaded a tar file containing the audio and slideshow from this week's JRuby presentation. It can be downloaded at:

http://files.meetup.c...­

About some of the points raised at the meeting:

*** Rubinius, REE

I had mentioned that I thought I heard that Rubinius would not be supporting Ruby 1.9. I was confusing Rubinius with REE (Ruby Enterprise Edition), which will indeed be discontinuing development (see http://www.engineyard...­.

Rubinius does support 1.9, but according to their page describing the 2.0 preview edition (http://rubini.us/2011...­, 2.0, which is not out yet, will "...begin adding Ruby 1.9 and Windows support". Strange that this page was published over a year ago (6/7/2011), but the current Rubinius home page (http://rubini.us/...­) lists the current version as 1.2.4. I don't know much about Rubinius -- anyone know what's going on with them?


*** Charlie Nutter's Response About Include

I had mentioned that I discovered that 'include' didn't appear to be necessary for a class to implement an interface, and that I asked the JRuby mailing list for enlightenment. Charlie Nutter responded to me as follows:

"Using include will perform a bit better because we can immediately see the interfaces the object supports and we also can make the Java object representing the Ruby object *actually* implement those interfaces rather than generating/instantiating a separate object attached to the Ruby object.

"I believe dispatch from Java through the interface is faster using a class + include than the "magic" form too."


*** Using the Backtick for Shell Scripting in Ruby

As Nate said, it's easy in Ruby to ask the shell for information and bring it into your program, using the backtick. Any command in backticks will be executed by the OS, and its stdout output will be returned as the value of the backtick expression. Here's an example of how much could be done on one line using the backtick:

`ls -ltr`.split("\n")[1..-1].map { |line| line.split.last }

Not that this particular command is that useful, but I mention it to illustrate Ruby's power. It gets the long directory list, converts it to an array of lines, removes the first ("total") line, and returns an array of the last space separated term in the line (the filename).


*** RubyMine vs. Intellij Idea for JRuby Development

I emailed JetBrains support to get some enlightenment about which IDE would be the best to use for JRuby development (this was brought up at our meeting). The response follows:

"RubyMine has no Java support, when working with JRuby you may also want to work on Java code. If your project is a pure Ruby project with no Java code, RubyMine should be enough."

...to which I asked "Thanks, but if there were no need for Java code support, and someone owned both Intellij Idea and RubyMine, which of the two would provide *better* support for JRuby? Isn't RubyMine a better Ruby IDE than than Idea + its Ruby plugin?"

...and he responded: "If you want to focus on Ruby, RubyMine is better as it has no clutter in the menus for unrelated languages and frameworks and has easier project setup. Featurewise IntelliJ IDEA with Ruby plug-in is not different from RubyMine, Ruby related functionality is the same."


*** Maven and Nailgun

I had had mvn installed on my system, and found that it was a shell script in /usr/bin. I tried to modify it to work with Nailgun, but didn't want to invest much time in it, and was unable to get it to work in the time that I *did* invest. However, I did confirm that mvn is simply calling the Java command with a command line it constructs:

exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "${M2_HOME}"/boot/plexus-class­worlds-*.jar \
"-Dclassworlds.conf=${M2_HOME}/bin/­m2.conf" \
"-Dmaven.home=${M2_HOME}" \
${CLASSWORLDS_LAUNCHER} "$@"

...so it should be possible to figure out where to insert something to get it to use the Nailgun server.


*** Printf

As someone pointed out (Dave Aronson I think) the C-like string formatting can be used without the printf function using the % operator on the String class:

jruby-1.6.7.2 :011 > formatted_string = ("%14.8f" % (31.0/3.0))
=> " 10.33333333"

- Keith
--
http://about.me/keith...­
Keith B.
keithrbennett
Reston, VA
Post #: 50
All -

I posted a blog article with embedded slides and audio of last week's JRuby presentation at:

http://www.bbs-software.com/blog/2012/09/04/jruby-presentation-northern-virginia-ruby-user-group/­.

Cheers,
Keith
Powered by mvnForum

Our Sponsors

  • NationJS Conference

    Join us Sept 16 2016 for an incredible day of JavaScript.

  • Sequoia

    A software consultancy with lots of smart people and great projects!

  • Altamira

    Explore ALTAMIRA, a leading developer of advanced technologies.

  • RubyNation Conference

    Join us June 3-4 2016 for two incredible days of Ruby and Rails.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy