sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Structured data exchange: Ruby <=> Javascript

    Scheduled Pinned Locked Moved Developers' Forum
    1 Posts 1 Posters 265 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      herodes
      last edited by

      In Sketchup we have Ruby within it we have WebDialogs through which we have Javascript (through the Safari or IE Javascript VMs). I've always heard that if you need to exchange structured information like arrays, hashes, objects between Ruby and Javascript you should be emitting JSON strings back and forth. I run across this post by "why" entitled "YAML is JSON" and it got me thinking that maybe its YAML we should be working on.

      There is a pure Javascript YAML emitter class ( probably you don't need a parser,... JSON is a proper Javascript subset and JSON.almost_equal?(YAML) == true
      and a pure Ruby YAML class (emitter&parser) too!

      I haven't done any testing so someone with some more time,... please do the honours πŸ˜‰

      I am pretty sure this isn't as easy I present it to be and I assume a 30% possibility of it working with minimal effort, although I think that we need to come up with a ruby library for Sketchup and deal with it once and for all.

      %(#BFBFBF)[http://arhitektonas.blogspot.com
      I know me,... I am that guy...
      ]

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement