• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Return values from ruby system calls

Scheduled Pinned Locked Moved Developers' Forum
3 Posts 3 Posters 573 Views 3 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.
  • L Offline
    Lance_Uppercut
    last edited by 17 Jun 2015, 17:31

    This should be really simple, but for some reason I cannot get any return values from simple Ruby system calls from within Sketchup...for example:

    
    puts `echo test`      # nil result
    x = `echo test`       # nil result
    puts x                # nil result
    x.empty?              # true
    
    system('echo test')   # true
    

    Strangely the system('echo test') returns true, indicating that the process was successfully run...does anyone have any ideas? I'd like to avoid having to use txt or csv files as intermediaries.

    Thanks,
    Sebastian

    1 Reply Last reply Reply Quote 0
    • D Offline
      driven
      last edited by 17 Jun 2015, 20:18

      v8 users the really old ruby version...
      so try "test" for your string

      and also try x = %x(echo "test")

      learn from the mistakes of others, you may not live long enough to make them all yourself...

      1 Reply Last reply Reply Quote 0
      • D Offline
        Dan Rathbun
        last edited by 18 Jun 2015, 01:04

        SketchUp 2014 was bugged in this regard. The workaround was to pipe to a text file, I think.
        I think it was fixed in SketchUp 2015.

        I recall having written a patch script that overrode the Kernel.backquote method. (I have to have a look for it.)

        I'm not here much anymore.

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

        Advertisement