• Login
sketchucation logo sketchucation
  • Login
ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

Binary to Ruby Archiver

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 2 Posters 183 Views 2 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.
  • J Offline
    Jim
    last edited by 3 Sept 2009, 16:42

    I'd really like a way to package multiple files - both binary and plain text - into a single plain-text encoded Ruby script archive.

    So when it is first loaded in SketchUp, it decodes the files and writes then to the right files and folders.

    I'm thinking this would make it easier to write a plugins manager with version control and network upgrades. It would be very cool to have a "Check for Plugin Updates" and "Update Selected Plugins" dialog.

    Not a new idea around here, but an idea worth reviewing from time-to-time.

    Hi

    1 Reply Last reply Reply Quote 0
    • T Offline
      tbd
      last edited by 3 Sept 2009, 16:53

      I did something similar with TimeTracker - have a Hash with the name of the file as key and as value a pack('m') like this:

      
      # compress files
      # extensions to have in the archive
      files = Dir["*.{gif,png,jpg,rb}"]
      
      all = Hash.new
      files.each do |x|
        all[x] = [File.open(x,"rb").read].pack("m")
      end
      
      File.open("archive.txt","w") do |f|
        f.write "archive = "+all.inspect
      end
      
      

      SketchUp Ruby Consultant | Podium 1.x developer
      http://plugins.ro

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by 3 Sept 2009, 17:04

        Actually, unix/Linux has a utility named shar - shell archive - that does almost exactly this; except for it is for shell.

        Thanks, TBD. Will need to consider including files and folders in the archive.

        Hi

        1 Reply Last reply Reply Quote 0
        • T Offline
          tbd
          last edited by 3 Sept 2009, 19:39

          @jim said:

          Will need to consider including files and folders in the archive.

          you just need to add the complete path to the filename and a way to create/check for directories. easy 😉

          SketchUp Ruby Consultant | Podium 1.x developer
          http://plugins.ro

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

          Advertisement