How to read and write a sketchup project file using Ruby?

How to read and write a sketchup project file using Ruby?

Your profile says you are using SketchUp free which has no embedded Ruby interpreter, so I’ll guess you mean using an external Ruby interpreter, not the one embedded in SketchUp. If that’s right, Trimble only provides a SDK to read/write SketchUp files using C. You would have to access that C library using something like the Ruby Fiddle library or wrap it with a Ruby interface using something like SWIG. Either way it would get sufficiently complicated that unless you are expert at Ruby but ignorant of C it would be easier to just write a C program.