[Code] YARC – yet another ruby console

Re: [Code] YARC – yet another ruby console

Postby Dan Rathbun » Tue Jun 19, 2012 10:55 pm

thomthom wrote:... creating new instance isn't ideal in many of my cases because I want to preserve the content throughout the session. :/

Yepper... you (and Aerilius,) would have to write to a log, and restore it on open.

Actually, Aerilius is already saving the commands... he could just iterate them, and re-eval them to restore the output.
And perhaps the snippets are already saved in a "snippet" directory ??
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: [Code] YARC – yet another ruby console

    Postby Dan Rathbun » Tue Jun 19, 2012 11:57 pm

      Updated again to ver 0.6.3

      (It REALLY now remembers where it the user puts it and it's size. We let Sketchup do the work here.)

      !! Closing the dialog will clear it contents, and wipe out command snippets !!
      So use minimize, instead of close, if you wish to keep these things.

      See second post for d/l
      0
        I'm not here much anymore. But a PM will fire email notifications.
        User avatar
        Dan Rathbun 
        PluginStore Author
        PluginStore Author
         

        Re: [Code] YARC – yet another ruby console

        Postby Anton_S » Wed Jun 20, 2012 9:55 pm

        Dan Rathbun wrote:
        Code: Select all
        unless file_loaded?(File.basename(__FILE__))
        ...
        file_loaded(File.basename(__FILE__))



        I recommend putting the whole __FILE__ instead of a File.basename(__FILE__). That way you would eliminate same filenames that are in different folders.

        EX:
        Plugins/Anton_Lib/core.rb
          that statement would be true
          unless file_loaded?(File.basename(__FILE__))
            ...
            file_loaded(File.basename(__FILE__))
          end
        Plugins/TT_Lib/core.rb
          that statement would be false, preventing vital parts to be called
          unless file_loaded?(File.basename(__FILE__))
            ...
            file_loaded(File.basename(__FILE__))
          end
        0

        Anton_S 
        PluginStore Author
        PluginStore Author
         

        Re: [Code] YARC – yet another ruby console

        Postby thomthom » Wed Jun 20, 2012 11:17 pm

        Anton_S wrote:I recommend putting the whole __FILE__ instead of a File.basename(__FILE__). That way you would eliminate same filenames that are in different folders.

        +1

        I have adopted the same pattern myself. Just using the filename is not a unique ID - full path is. It doesn't even have to be a filename you feed file_loaded - just any unique string.
        0
        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund
        User avatar
        thomthom 
        PluginStore Author
        PluginStore Author
         

        Re: [Code] YARC – yet another ruby console

        Postby Dan Rathbun » Thu Jun 21, 2012 12:18 am

        Yup we've talked a bit about this before. (I didn't change what he had in his code. I thot it might be too far off topic.)

        I've posted a new topic on this subject:
        [ Code ] custom file_loaded() and file_loaded?()

        @Anton_S: I sent you a personal edition via PM, check your inbox.
        0
          I'm not here much anymore. But a PM will fire email notifications.
          User avatar
          Dan Rathbun 
          PluginStore Author
          PluginStore Author
           

          Re: [Code] YARC – yet another ruby console

          Postby Anton_S » Thu Jun 21, 2012 6:57 am

          yep, sure
          0

          Anton_S 
          PluginStore Author
          PluginStore Author
           

          Re: [Code] YARC – yet another ruby console

          Postby Aerilius » Thu Jun 21, 2012 7:41 am

          Anton_S wrote:I recommend putting the whole __FILE__

          That's very reasonable. I'll fix it.

          I just wanted to let you all know that I'm working on improvements (esp. the snippets should have been saved over sessions) but I'm a bit busy at the moment. I'll publish a next version when I'm ready.
          0

          Aerilius 
          PluginStore Author
          PluginStore Author
           

          SketchUcation One-Liner Adverts

          by Ad Machine » 5 minutes ago



          Ad Machine 
          Robot
           



           

          Return to Developers' Forum

          Who is online

          Users browsing this forum: bugaetz and 8 guests

          Visit our sponsors: