0

Ruby libraries & extensions

Having a ruby interpreter in the browser is exiting, even more so if service authors can leverage Ruby's many libraries and/or extensions. To what extend is it possible to 'require' ruby libraries in a service?

by
3 Replies
  • QUOTE (=bartt @ Mar 9 2009, 09:42 PM) <{POST_SNAPBACK}>
    Having a ruby interpreter in the browser is exiting, even more so if service authors can leverage Ruby's many libraries and/or extensions. To what extend is it possible to 'require' ruby libraries in a service?


    yo bartt,

    good to hear from you. currently, version 4.2.4 of the RubyInterpreter allows you to use any number of _pure_ ruby libraries inside your service. The only, rather annoying, trick is that you must use replace require() calls with bp_require() to consume source relative to the directory into which your service is installed.

    This bit of invented syntax exists for implementation reasons, which now with BrowserPlus 2.2.0 can be resolved. I've started working on the next version of the ruby interpreter service and will continue chipping away at it in the open.

    The source lives here: http://github.com/lloyd/bp-ruby/tree/master

    and the top level readme contains some of the desired features in this next version, reproduced here for convenience (notice numbers 1 and 2 :)lloyd
    0
  • QUOTE (Lloyd Hilaiel @ Mar 11 2009, 08:59 AM) <{POST_SNAPBACK}>
    yo bartt,

    good to hear from you. currently, version 4.2.4 of the RubyInterpreter allows you to use any number of _pure_ ruby libraries inside your service. The only, rather annoying, trick is that you must use replace require() calls with bp_require() to consume source relative to the directory into which your service is installed.

    This bit of invented syntax exists for implementation reasons, which now with BrowserPlus 2.2.0 can be resolved. I've started working on the next version of the ruby interpreter service and will continue chipping away at it in the open.

    The source lives here: http://github.com/lloyd/bp-ruby/tree/master


    Very cool Lloyd.

    I assume that __pure__ ruby libraries will have to be bundled with the extension. Any plans to add gem support down the line? So that a browserplus extension could use Gem to check for the availability of required gems and pull missing ones in?

    I understand that this might be asking too much. Any pointers how to bundle __pure__ ruby libraries with an extension mean while would be much appreciated.

    =bartt
    0
  • QUOTE (=bartt @ Mar 11 2009, 01:12 PM) <{POST_SNAPBACK}>
    Very cool Lloyd.

    I assume that __pure__ ruby libraries will have to be bundled with the extension. Any plans to add gem support down the line? So that a browserplus extension could use Gem to check for the availability of required gems and pull missing ones in?

    I understand that this might be asking too much. Any pointers how to bundle __pure__ ruby libraries with an extension mean while would be much appreciated.

    =bartt


    Hey bartt,

    I actually hadn't thought of that (the gem tactic)... I believe, but would have to check, that 1.9.1 has gem support more tightly integrated. I'll keep this in mind while workin' on the next version of the ruby interpreter service.

    Pointers on howto bundle pure ruby libs?

    sure, here's a service that interacts with iphoto. I dropped the source of a plist parser into the service, and changed require to bp_require:
    http://github.com/lloyd/bp-photos/tree/4a3.../iphoto_service

    best,
    lloyd
    0
This forum is locked.

Recent Posts

in Service Authors