The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
RubyInject

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Laurent Sansonetti

Posts: 134
Nickname: lrz
Registered: Jun, 2006

Laurent Sansonetti is a software engineer at Apple Computer and a longtime Ruby enthusiast.
RubyInject Posted: Oct 9, 2007 4:46 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Laurent Sansonetti.
Original Post: RubyInject
Feed Title: lrz's diary
Feed URL: http://www.chopine.be/lrz/diary/xml/rss/feed.xml
Feed Description: lrz's diary
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Laurent Sansonetti
Latest Posts From lrz's diary

Advertisement

I have been recently hacking on my spare time on a new small project, called RubyInject.

As you can probably imagine from the name, it's a way to inject ruby. It comes as an Objective-C framework with only one API, [RubyInject +injectProcess:], which will thanks to the excellent mach_star stuff inject a small bundle in the given process, start a new thread, initialize a Ruby interpreter, and start a DRb local server. You can then remotely evaluate expressions from another Ruby process. The DRb local server URI is advertised on Bonjour if you have the Ruby DNSSD library installed, which makes the potential clients easier to connect.

The project comes with an inject.rb script that takes a pid and optionally a Ruby script that will be remotely executed. If no Ruby script is given, an IRB session is started instead and allows you to interactively talk with the application. There is also an example that transforms the first TextEdit window as a Ruby evaluator.

Get the code! It's covered by the Creative Commons Attribution 2.0 Generic, which is the same license the mach_star bits are also covered by (I wanted to make it simple).

svn co https://rubycocoa.svn.sourceforge.net/svnroot/rubycocoa/branches/users/lrz/RubyInject

It requires RubyCocoa trunk to work. This was the first time I started RubyCocoa not in the main thread, and there were some problems with the code that redirects calls from other threads to the thread where RubyCocoa was initialized. We need this facility because Ruby 1.8 isn't thread-safe, sigh :-(

Read: RubyInject

Topic: Ruby: Convention is Important Previous Topic   Next Topic Topic: Would you go to a Fake Steve party?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use