sketchucation logo sketchucation
    • Login
    1. Home
    2. pedrobaracho
    ⚠️ Attention | Having issues with Sketchucation Tools 5? Report Here
    P
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Groups 1

    pedrobaracho

    @pedrobaracho

    10
    Reputation
    1
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    pedrobaracho Unfollow Follow
    registered-users

    Latest posts made by pedrobaracho

    • RE: SU Ruby + XML

      Today I finally got Nokigiri working.

      Summarizing everything that I had to do:

      1- First attempt with LibXML failed, parsing process was halting inside the C code of libxml-ruby.
      2- Switched to Nokigiri project. It was as fast as libxml and apparently, had less dependencies.
      3- First attempt with Nokigiri failed. I couldn't find ilibgcj_s.dll
      4- Second attempt with libxml-ruby: Failed... I wanted to debug the dll but that was too difficult to be achieved. Also I posted on this forum asking for help.

      5- Still trying to solve the problem, I found out http://www.rubyinstaller.org on some random ruby-forum and got rubygems working under windows (I had never achieved that before).

      6- Tried installing libxml the regular way: "gem install libxml-ruby"
      7- Ran into a problem while compiling some of libxml-ruby`s dll.

      8- Tried installing nokogiri the regular way: "gem install nokogiri"
      9- Successfully installed nokogiri.
      10- Build some ruby script to run over Ruby, using Nokogiri.
      11- Ran ProcessMonitor (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) and ProcessExplorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) while using nokogiri objects over Ruby, so I could see what dlls it required.
      11.2- Another good tool for tracing DLL dependencies is Dependency Viewer (http://www.foxprogramming.co.uk/freetools.html)

      12- Copied these dlls to Sketchup folder and msvcrt-ruby18.dll from Ruby/bin. Sketchup folder is equivalent to Ruby/bin for Sketchup's Ruby interpreter. (This is a guess)
      13- Put everything about Nokogiri on Sketchup's Plugin Folder (so it was loaded together with sketchup)
      14- Started Sketchup.
      15- Got lots of errors, due to dependencies. These errors were caused because Sketchup's Ruby Interpreter is not fully equipped with everything Ruby's own interpreter has.
      16- Through the error messages of Sketchup, copied the rest of the .rb's and .so's needed for Nokogiri (that were installed by default on a regular Ruby installation).
      17- No more errors. Successfully instantiated a Nokogiri::XML::Document object.

      18- Rewrote my code so they would use Nokogiri instead of REXML.

      My old parser, using REXML, was about 3 times slower than the new one using Nokogiri.
      My library took 30-40 seconds to load with REXML and it takes 11 seconds to load with Nokogiri.
      These weren't scientifically tests though. But they were good enough, and I measured it on at least 5 different computers.

      Hope this helps anyone.

      posted in Developers' Forum
      P
      pedrobaracho
    • RE: SU Ruby + XML

      I got LibXML-Ruby working with SU.
      What I needed to get it working was:
      Get http://rubyforge.org/frs/download.php/53633/libxml-ruby-1.1.3-x86-mswin32-60.gem
      From lib folder
      libxml folder
      xml folder
      libxml.rb
      xml.rb
      From ext/mingw folder
      libiconv-2.dll
      libxml_ruby.so
      libxml2-2.dll
      From Ruby folder:
      stringio.rb
      zlib1.dll

      I succeeded parsing a big file, although I couldn't parse multiple files in a row.
      The problem is when I parse 4 files in a row, libxml stucks while creating the Document object.

      LibXML::XML::Document.new(file).root

      And it gets non-responsive. Also it blocks the SU process and it doesn't finish when I close SU.

      I also didn't get any times to compare rexml and libxml running over SU.

      If anybody has any hints to my problem, I would appreciate it. Right now I am trying to compile libxml-ruby and set up some breakpoints so I can see where it is halting the execution.

      posted in Developers' Forum
      P
      pedrobaracho
    • RE: OpenSSL and SU

      Just for the record.

      I found this: http://www.rubyonrailsftw.com/lessons/28, after posting.

      @unknownuser said:

      If you get this error, you need to install 2 openSSL .dlls:

      Get openssl
      Download openssl windows binary from
      http://gnuwin32.sourceforge.net/packages/openssl.htm

      1. Unzip “libeay32.dll” to ruby\bin.
      2. Unzip “libssl32.dll” to ruby\bin and rename it to ssleay32.dll

      In some systems, you need to put those dlls by force on windows/system32, or on ruby/bin, if you are not running SU's ruby interpreter.

      posted in Developers' Forum
      P
      pedrobaracho
    • OpenSSL and SU

      Has anyone successfully loaded OpenSSL in SU?

      I tried everything I could already.
      Copying ruby's msvcrt-ruby18.dll.
      Installing and loading ruby itself, by setting $LOAD_PATH.

      The funny thing is, sometimes it works, and sometimes it doesn't.

      In fact, in my computer it fails at the first run and then it always works, but on my virtual machines it doesn't.

      The error I am getting is:
      specified module not found (OpenSSL)

      The line it fails is:
      aes = OpenSSL::Cipher::Cipher.new("AES-256-ECB")

      I have traced the error already, and it seems openssl is failing to load.

      Do you guys have any suggestions?

      posted in Developers' Forum
      P
      pedrobaracho