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

Extension rbz maker

Scheduled Pinned Locked Moved Developers' Forum
38 Posts 7 Posters 4.1k Views 7 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.
  • I Offline
    inteloide
    last edited by 23 Nov 2014, 16:47

    Hello,

    I would like to propose you my new plugin : BGSketchup_RBZ_maker
    The purpose of this plugin is to make the process of extension rbz creation easier.
    Note : This plugin is for extension authors.

    screenshot

    Once sketchup launched, click on the toolbar icon or through menu (Plugins >> BGSketchup >> RBZ maker)
    You can then choose your extension, then choose wich files to scramble/encrypt, then destination file name (currently plugin propose you the plugin name + version), then generate !

    May I have your help on :

    • the installation of gem rubyzip, to make it easier for user
    • MAC tests as I'm a PC user

    The plugin :

    Version 1.0.1

    Thank you.
    Inteloide (BGSketchup)

    Restrictions :
    -You must have Sketchup 2015 (because of rubyzip gem installation, or is there another way ???)
    -You must have the gem rubyzip installed (the rbz contains one version of it) to install it, just run in Ruby console Gem.install 'c:\toto\rubyzip', where c:\toto\ is the directory name of the gem file.
    -Your extension file structure contain a sub-folder with the same name that root extension file. Example :

    @unknownuser said:

    extension_toto.rb
    extension_toto/main.rb
    extension_toto/second.rb

    -This plugin require BGSketchup_Library extension (you can find it on the Pluginstore )

    Informations :
    This plugin send anonymous data to my website (just for statistic analysis). Data can be consult at BGSketchup website . If this is a problem, I can remove the feature. I include this to know how often my plugins are used, to keep motivation in creating new plugins.

    Humanity will do a huge step when the IT professionals will understand that computers are tools...

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dan Rathbun
      last edited by 25 Nov 2014, 06:12

      Gem.install "rubyzip"
      will install the latest version of rubyzip from the rubygems.org server.

      Pure Ruby gems (those that do not contain compiled binaries,) should work on SketchUp 2014, as it has Ruby 2.0.0 also.

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • T Offline
        TNTDAVID
        last edited by 25 Nov 2014, 15:20

        Hello

        I want to blur my fichiers.rb to protect my work, so I downloaded the Plugin BGSketchup_RBZ_maker v1.0.1.rbz

        Then I installed all additional Plugin:
        BGSketchup_Bill_of_material
        BGSketchup_Comments
        BGSketchup_Components_manager
        BGSketchup_Library

        I work with SketchUp 2014 under Windows 7 and the Plugin does not work 😕

        When I click on "Generate" nothing happens


        http://nsa33.casimages.com/img/2014/11/25/141125034946464116.jpg

        I tried to SketchUp 8 but the result is even worse because the "BGSketchup_Library_v2.0.7.rbz" file, crashes the from Sketchup startup .

        How to make the plugin work ?

        Thank you for your help.

        [b:8wt9py2i]* Nouveau !!![/b:8wt9py2i] Découvrez notre nouveau Plugin [url=http://www.composant-dynamique.com/:8wt9py2i][color=#40FF00:8wt9py2i]C[/color:8wt9py2i][color=#77FF00:8wt9py2i]l[/color:8wt9py2i][color=#ADFF00:8wt9py2i]i[/color:8wt9py2i][color=#E4FF00:8wt9py2i]c[/color:8wt9py2i][color=#FFDB09:8wt9py2i]k[/color:8wt9py2i][color=#FF921B:8wt9py2i]-[/color:8wt9py2i][color=#FF492E:8wt9py2i]C[/color:8wt9py2i][color=#FF0040:8wt9py2i]u[/color:8wt9py2i][color=#ED2577:8wt9py2i]i[/color:8wt9py2i][color=#DA49AD:8wt9py2i]s[/color:8wt9py2i][color=#C86EE4:8wt9py2i]i[/color:8wt9py2i][color=#AD77FF:8wt9py2i]n[/color:8wt9py2i][color=#8965FF:8wt9py2i]e[/color:8wt9py2i] [color=#4040FF:8wt9py2i]2[/color:8wt9py2i][/url:8wt9py2i], pour créer vos cuisines 3D !

        1 Reply Last reply Reply Quote 0
        • D Offline
          driven
          last edited by 25 Nov 2014, 15:36

          hi David,
          did you instal rubyzip?

          as Dan posted above, you can do it in Ruby Console with

          Gem.install "rubyzip"
          

          john

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

          1 Reply Last reply Reply Quote 0
          • T Offline
            TNTDAVID
            last edited by 25 Nov 2014, 17:36

            I downloaded the file rubyzip2-2.0.2.gem

            To decompress the contents I renamed the extension zip:


            http://nsa34.casimages.com/img/2014/11/25/141125063403401324.jpg

            What now for all these files ?

            [b:8wt9py2i]* Nouveau !!![/b:8wt9py2i] Découvrez notre nouveau Plugin [url=http://www.composant-dynamique.com/:8wt9py2i][color=#40FF00:8wt9py2i]C[/color:8wt9py2i][color=#77FF00:8wt9py2i]l[/color:8wt9py2i][color=#ADFF00:8wt9py2i]i[/color:8wt9py2i][color=#E4FF00:8wt9py2i]c[/color:8wt9py2i][color=#FFDB09:8wt9py2i]k[/color:8wt9py2i][color=#FF921B:8wt9py2i]-[/color:8wt9py2i][color=#FF492E:8wt9py2i]C[/color:8wt9py2i][color=#FF0040:8wt9py2i]u[/color:8wt9py2i][color=#ED2577:8wt9py2i]i[/color:8wt9py2i][color=#DA49AD:8wt9py2i]s[/color:8wt9py2i][color=#C86EE4:8wt9py2i]i[/color:8wt9py2i][color=#AD77FF:8wt9py2i]n[/color:8wt9py2i][color=#8965FF:8wt9py2i]e[/color:8wt9py2i] [color=#4040FF:8wt9py2i]2[/color:8wt9py2i][/url:8wt9py2i], pour créer vos cuisines 3D !

            1 Reply Last reply Reply Quote 0
            • T Offline
              TNTDAVID
              last edited by 25 Nov 2014, 18:22


              http://nsa33.casimages.com/img/2014/11/25/14112507281221315.jpg

              I have not all inclusive 😕

              Can you detail the procedure ?

              thank you

              [b:8wt9py2i]* Nouveau !!![/b:8wt9py2i] Découvrez notre nouveau Plugin [url=http://www.composant-dynamique.com/:8wt9py2i][color=#40FF00:8wt9py2i]C[/color:8wt9py2i][color=#77FF00:8wt9py2i]l[/color:8wt9py2i][color=#ADFF00:8wt9py2i]i[/color:8wt9py2i][color=#E4FF00:8wt9py2i]c[/color:8wt9py2i][color=#FFDB09:8wt9py2i]k[/color:8wt9py2i][color=#FF921B:8wt9py2i]-[/color:8wt9py2i][color=#FF492E:8wt9py2i]C[/color:8wt9py2i][color=#FF0040:8wt9py2i]u[/color:8wt9py2i][color=#ED2577:8wt9py2i]i[/color:8wt9py2i][color=#DA49AD:8wt9py2i]s[/color:8wt9py2i][color=#C86EE4:8wt9py2i]i[/color:8wt9py2i][color=#AD77FF:8wt9py2i]n[/color:8wt9py2i][color=#8965FF:8wt9py2i]e[/color:8wt9py2i] [color=#4040FF:8wt9py2i]2[/color:8wt9py2i][/url:8wt9py2i], pour créer vos cuisines 3D !

              1 Reply Last reply Reply Quote 0
              • T Offline
                TNTDAVID
                last edited by 25 Nov 2014, 19:05

                This does not work yet :


                http://nsa33.casimages.com/img/2014/11/25/141125081338514942.jpg

                [b:8wt9py2i]* Nouveau !!![/b:8wt9py2i] Découvrez notre nouveau Plugin [url=http://www.composant-dynamique.com/:8wt9py2i][color=#40FF00:8wt9py2i]C[/color:8wt9py2i][color=#77FF00:8wt9py2i]l[/color:8wt9py2i][color=#ADFF00:8wt9py2i]i[/color:8wt9py2i][color=#E4FF00:8wt9py2i]c[/color:8wt9py2i][color=#FFDB09:8wt9py2i]k[/color:8wt9py2i][color=#FF921B:8wt9py2i]-[/color:8wt9py2i][color=#FF492E:8wt9py2i]C[/color:8wt9py2i][color=#FF0040:8wt9py2i]u[/color:8wt9py2i][color=#ED2577:8wt9py2i]i[/color:8wt9py2i][color=#DA49AD:8wt9py2i]s[/color:8wt9py2i][color=#C86EE4:8wt9py2i]i[/color:8wt9py2i][color=#AD77FF:8wt9py2i]n[/color:8wt9py2i][color=#8965FF:8wt9py2i]e[/color:8wt9py2i] [color=#4040FF:8wt9py2i]2[/color:8wt9py2i][/url:8wt9py2i], pour créer vos cuisines 3D !

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by 25 Nov 2014, 19:16

                  I only just tried it myself and I had to use

                  require('zip')
                  

                  than that returns true...

                  I'll have a look at the plugins code to see what it uses

                  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
                    driven
                    last edited by 25 Nov 2014, 19:37

                    the plugin uses require 'zip' so that bit should work...

                    the other thing I'd point out is you should not include the .skb files in your rbz...

                    john

                    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
                      driven
                      last edited by 25 Nov 2014, 19:40

                      @tntdavid said:

                      ...
                      What now for all these files ?

                      you don't need them,
                      do it from 'Ruby Console' in Sketchup, it's much easier...
                      then to test it's working type

                      require("zip")
                      #EDIT; had rubyzip
                      

                      it should => true
                      then try this plugin again...
                      john

                      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
                        driven
                        last edited by 25 Nov 2014, 19:41

                        1: open "Ruby Console"
                        2: paste in this

                        Gem.install "rubyzip"
                        

                        and enter...
                        3: if no errors paste in this

                        require("zip")
                        #EDIT; had rubyzip
                        

                        and enter...
                        4: if no errors, try this plugin...

                        or report back...

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

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          TNTDAVID
                          last edited by 25 Nov 2014, 20:25

                          thank you

                          require ('zip') worked well

                          I can now run Extension RBZ maker !

                          My plugin does not contain files Skb but SKP.

                          I noticed that the ruby script codes are protected but not the components used by my Plugin.

                          Is there a way to protect the SKP files ?

                          [b:8wt9py2i]* Nouveau !!![/b:8wt9py2i] Découvrez notre nouveau Plugin [url=http://www.composant-dynamique.com/:8wt9py2i][color=#40FF00:8wt9py2i]C[/color:8wt9py2i][color=#77FF00:8wt9py2i]l[/color:8wt9py2i][color=#ADFF00:8wt9py2i]i[/color:8wt9py2i][color=#E4FF00:8wt9py2i]c[/color:8wt9py2i][color=#FFDB09:8wt9py2i]k[/color:8wt9py2i][color=#FF921B:8wt9py2i]-[/color:8wt9py2i][color=#FF492E:8wt9py2i]C[/color:8wt9py2i][color=#FF0040:8wt9py2i]u[/color:8wt9py2i][color=#ED2577:8wt9py2i]i[/color:8wt9py2i][color=#DA49AD:8wt9py2i]s[/color:8wt9py2i][color=#C86EE4:8wt9py2i]i[/color:8wt9py2i][color=#AD77FF:8wt9py2i]n[/color:8wt9py2i][color=#8965FF:8wt9py2i]e[/color:8wt9py2i] [color=#4040FF:8wt9py2i]2[/color:8wt9py2i][/url:8wt9py2i], pour créer vos cuisines 3D !

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            driven
                            last edited by 25 Nov 2014, 20:36

                            @tntdavid said:

                            My plugin does not contain files Skb but SKP.

                            your image above shows both in the folder

                            @tntdavid said:

                            Is there a way to protect the SKP files ?
                            No, even if there was, once it's in the model people can do anything they want...

                            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 25 Nov 2014, 22:47

                              @tntdavid said:

                              I downloaded the file rubyzip2-2.0.2.gem

                              Do not use that. It is actually an older code fork than just plain rubyzip v1.1.6.

                              (Not sure why the author left it up on rubygems.org . It is a kind of beta version for Ruby higher than 1.8, but was abandoned. The original v1 code trunk was fixed to run in 1.9+ Ruby.)

                              I'm not here much anymore.

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                driven
                                last edited by 25 Nov 2014, 22:52

                                @dan what's happening with require 'rubyzip' v require 'zip' ?

                                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 26 Nov 2014, 01:50

                                  @driven said:

                                  @dan what's happening with require 'rubyzip' v require 'zip' ?

                                  The RubyGems extension modifies the global require() method so that it can load gems (and push their paths into $LOAD_PATH,) and if need be, install them first from whatever gem servers are registered. (By default only rubygems.org is registered.)
                                  So [important], this: require 'rubyzip', is actually saying "require the gem named 'rubyzip'", not "require the file named 'rubyzip.rb'".

                                  Once the gem library is installed and loaded, it can be used as it normally would, had it been a standard extension, in Ruby's library.
                                  Hence, the require("zip") which actually makes sure that the
                                  "#{ENV['GEM_PATH']}/gems/rubyzip-v1.1.6/lib/zip.rb" file is loaded.
                                  This works because the override of the global require(), by the RubyGems extension, has push the rubyzip lib into the $LOAD_PATH array. Ie:
                                  "#{ENV['GEM_PATH']}/gems/rubyzip-v1.1.6/lib/"

                                  But I like to wrap in begin. .. rescue, just in case.

                                  I'm not here much anymore.

                                  1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    driven
                                    last edited by 26 Nov 2014, 01:59

                                    cheers dan,
                                    another ?
                                    in your example code wont require 'rubyzip' always fail, even when require 'zip' returns true?

                                    john

                                    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 26 Nov 2014, 04:46

                                      @driven said:

                                      in your example code wont require 'rubyzip' always fail, even when require 'zip' returns true?

                                      Hmmm.. OH I see.. even though, given the following:
                                      Ref:

                                      @unknownuser said:

                                      When RubyGems is required, Kernel#require is replaced with our own which

                                      is capable of loading gems on demand.

                                      When you call require 'x', this is what happens:

                                      * If the file can be loaded from the existing Ruby loadpath, it is.

                                      * Otherwise, installed gems are searched for a file that matches.

                                      If it's found in gem 'y', that gem is activated (added to the

                                      loadpath).

                                      The normal require functionality of returning false if

                                      that file has already been loaded is preserved.

                                      Something I overlooked was, that in most gems, the gem "name" is the same as the gem loader script name.

                                      But in this gem, the name is "rubyzip", but the loader script name is "zip.rb".

                                      So what the overridden require does is, look for a loader script named "rubyzip.rb" and it will NEVER find it, so a LoadError exception will be raised, always, even if the gem is already installed, and even if it is already loaded.

                                      And then my rescue LoadError clause will be fired.

                                      This doesn't hurt the first time, as if SketchUp is started normally and Rubygems is loaded and working.. the "rubyzip" gem will get installed and/or initialized by my LoadError clause.

                                      OK I need to change things a bit. I used to have a bail out " return true if defined?(Zip)" as the first line, removed it when I tried to load the "zip/filesystem" extension in the same methoid. I moved that to it's own method, so I'll put the short-circuit return line back in.

                                      Then I may need a different basic test other than require("rubyzip").
                                      I am not actually using the return value of require("rubyzip") to make any boolean decisions.
                                      Perhaps just require("zip") ?

                                      I'm not here much anymore.

                                      1 Reply Last reply Reply Quote 0
                                      • P Offline
                                        pgarmyn
                                        last edited by 26 Nov 2014, 06:24

                                        @tntdavid said:

                                        I want to blur my fichiers.rb to protect my work, so I downloaded the Plugin BGSketchup_RBZ_maker v1.0.1.rbz

                                        RBZ-files are not intended to protect code. Any unzip program can be used the convert them back to the original files.
                                        Only the scrambler will give limited protection.

                                        1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          TNTDAVID
                                          last edited by 27 Nov 2014, 09:54

                                          pgarmyn

                                          I can assure you that RBZ maker convert my file "rb" in "rbs" !

                                          Although the RBZ file can be decompressed the code is protected 👍

                                          driven

                                          You're right for the skb! This is fixed now 😉

                                          [b:8wt9py2i]* Nouveau !!![/b:8wt9py2i] Découvrez notre nouveau Plugin [url=http://www.composant-dynamique.com/:8wt9py2i][color=#40FF00:8wt9py2i]C[/color:8wt9py2i][color=#77FF00:8wt9py2i]l[/color:8wt9py2i][color=#ADFF00:8wt9py2i]i[/color:8wt9py2i][color=#E4FF00:8wt9py2i]c[/color:8wt9py2i][color=#FFDB09:8wt9py2i]k[/color:8wt9py2i][color=#FF921B:8wt9py2i]-[/color:8wt9py2i][color=#FF492E:8wt9py2i]C[/color:8wt9py2i][color=#FF0040:8wt9py2i]u[/color:8wt9py2i][color=#ED2577:8wt9py2i]i[/color:8wt9py2i][color=#DA49AD:8wt9py2i]s[/color:8wt9py2i][color=#C86EE4:8wt9py2i]i[/color:8wt9py2i][color=#AD77FF:8wt9py2i]n[/color:8wt9py2i][color=#8965FF:8wt9py2i]e[/color:8wt9py2i] [color=#4040FF:8wt9py2i]2[/color:8wt9py2i][/url:8wt9py2i], pour créer vos cuisines 3D !

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

                                          Advertisement