• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Structured data exchange: Ruby <=> Javascript

Scheduled Pinned Locked Moved Developers' Forum
1 Posts 1 Posters 265 Views
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 10 Oct 2008, 17:50

    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
    1 / 1
    • First post
      1/1
      Last post
    Buy SketchPlus
    Buy SUbD
    Buy WrapR
    Buy eBook
    Buy Modelur
    Buy Vertex Tools
    Buy SketchCuisine
    Buy FormFonts

    Advertisement