D/Code - smells like IRB spirit (1.0 RC1)
-
you must disable the load button until you finish the eval of the code as SU Ruby is not reentrant
export html I think is for exporting the code highlighting and encode/decode for script encryption
I also did something similar for SU5, before WebDialogs, with tab completion and aliases. if you want I can share the source as I dont have time to finish it
-
@unknownuser said:
you must disable the load button until you finish the eval of the code as SU Ruby is not reentrant
export html I think is for exporting the code highlighting and encode/decode for script encryption
I also did something similar for SU5, before WebDialogs, with tab completion and aliases. if you want I can share the source as I dont have time to finish it
I don't think there is a need to disable the Load button, because there is less Javascript. So I build the page every time the user loads a file, changes the view or sends/executes his code. I know what will happen, if the user enters a infinite loop (or maybe a time consuming one) but still haven't tried it.It's a simple action that causes the error:
- Run Sketchup
- Call the d/Code console (click the Button or menu entry)
- Click the Load button -> BOOM!
That means, everything is done in the window when I can click the Load button. But maybe Sketchup is a bit slower and hasn't registered the callbacks. Really don't know.
Export HTML is for exporting the current view without buttons and input field. If you have the "decoded" view and the output field, both will get exported.
Encode/decode is simple. You know. For a bit more comfort.
I'm interested in your code, if it is Ruby (I guess it's not)
azuby
-
OK, here we go again. I've uploaded d/Code 1.0 RC1 to my server.
Download it from http://www.errorinitus.de/ > Software > d/Code
Features
- Load and show file
- Syntax beautifying for Ruby files
- Syntax highlighting for Ruby, C, YAML, RHTML, HTML, XHTML, XML files
- Views for encoded, decoded, beautifyed and raw code
- Encryption if Sketchup Ruby Scrambler is availble
- Export current view as HTML file
- Open current file with system preferences
- Write current code to source file
- Write current code to new file
- Reset code field
- Clear complete view
- Select all code in input field
- Select all code in output field
- Encode current Ruby code
- Decode current Ruby code
- Step-by-step evaluate current (Ruby) code
- Mulitlanguage support (English and German at the moment)
- Toolbar icon for fast access
- Menu position configurable
- Separate shortcut definition files for each language
- Resizable window
- Set window back to defined position and size
- Toggling on and off via Sketchup "Windows > Preferences" possible
There also are help files included in the download, but you also can reach them directly:
d/Code help file (English)
d/Code-Hilfe-Datei (German)There now is one more button to encrypt files if you have access to the Sketchup Ruby Scrambler.
Hope it runs on Windows and Mac. Should ... but only have tried it on Windows XP pro.
azuby
-
Thank you, Azuby! Step by step..! testing
-
It's not a step-by-step like a Debugger! One short example:
class Foo def bar puts "baz" end end # First step finished. Foo.new.bar # Second step finished
So it's not line by line like in IRB:
irb(main);001;0> class Foo irb(main);002;1> def bar irb(main);003;2> puts "baz" irb(main);004;2> end irb(main);005;1> end => nil irb(main);006;0> Foo.new.bar baz => nil
Maybe I can do the "debuggish" way a bit later.
edit: So you can't write a piece of a class without closing the class. This will result in a SyntaxError.
azuby
-
Ok. Understood.
My first thought was that it is a sort of debugger First thing I have done - I have loaded 'real' script too check how it goesI am testing it and it is excellent for learning Ruby
and testing some small procedures.1st bug - when I press 'Select all' beside Input browser displays Page Cannot be dispayed.
Firefox, SU6
Tomasz -
Firefox in Sketchup? I thought they integrated only Internet Explorer. How have you done this?
Thanks for the bug report.
azuby
-
@azuby said:
Firefox in Sketchup?
It is my default browser.. but you are right - message comes from IE.
-
2nd 'bug': when thread.new has been initiated in following manner
Thread.new do system(`program arg`) end
then d/Code will wait with displaying its window till the program closed.
btw. Thread works well with passing arguments to exe. Thanks again.
Tomasz -
First of all - it is fantastic to be able to test scripts direct inside Sketchup
Would it be possible to have the input(Select all) window in the top and Code (Raw) window
windows at the bottom - for me it is difficult to se long linesDoes one have to have two windows ?
Could Code(RAW) do it ?
Sorry, if my questions are noob - byt i'm a noob
Jorgensen
-
@unknownuser said:
2nd 'bug': when thread.new has been initiated in following manner
Thread.new do > system(`program arg`) > end
then d/Code will wait with displaying its window till the program closed.
btw. Thread works well with passing arguments to exe. Thanks again.
Tomasz
OK, have to write this again, because I kicked my postingI've tried it with threads and
- Windows Calculator - system "calc"
- Ruby interpreter - system "ruby -ne 'gets'"
and it immediately came back to the Plugin while the called executables were still running. Maybe it depends on the executable? Don't know.
@Jorgensen
This also was possible with the built-in Ruby Console, but it was a pain writing all code in one lineChanging the layout is possible. At the moment there is no HTML template to edit, it's hard-coded. Also a two-window version could be made, yes. Because I'm not that wise in writing modern HTML and JavaScript code, I have to dive deeper into the possibilities.
This one I do not understand:
@unknownuser said:Could Code(RAW) do it ?
Do "what"?azuby
-
Hi azuby
The problem is, that I have so sidescroll the window to see long lines.
It might be just me (noob), but to me a "code window" and "a output" would be fine - does there have to be three ?
Jorgensen
-
A I see, Kinder Surprise - three wishes at once. Yes, you are right, long lines seem to be a bit complicated. Also three windows would be possible - not at the moment (just want to listen for bugs), but for the future. I add it to the todo list.
azuby
-
hmm, cannot access the site - gives me 212.162.44.242 reports: Destination protocol unreachable on traceroute. in Firefox it just timeouts
-
That's not cool, but it's not the server my website is hosted:
tracert errorinitus.de Routenverfolgung zu errorinitus.de [62.67.235.128] über maximal 30 Abschnitte; 1 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2 * * * Zeitüberschreitung der Anforderung. 3 6 ms 6 ms 6 ms 217.0.82.86 4 6 ms 6 ms 6 ms 217.5.72.138 5 22 ms 21 ms 20 ms 62.156.138.178 6 22 ms 21 ms 21 ms ae-0-56.mp2.Berlin1.Level3.net [4.68.108.162] 7 13 ms 12 ms 12 ms so-1-0-0.mp1.Hamburg1.Level3.net [4.68.128.37] 8 12 ms 13 ms 13 ms ge-4-1.hsa1.Hamburg1.Level3.net [195.122.140.163] 9 13 ms 13 ms 13 ms 212.162.44.242 10 13 ms 15 ms 15 ms s28.evanzo-server.de [62.67.235.128]
Hope, this helps. For now, try this one.
azuby
-
tried from two providers - still not working
later edit: finally made it work via proxy -
OK, next try with proxy: http://www.behidden.com/ - you have to enable JavaScript checkbox on this website where to put the url.
azuby
-
Hi azuby
Any news on the development ?
-
Not at the moment. Unfortunately I'm a bit too busy with German law
azuby
-
oh - hmmmm sounds a bit boring - that might be the reason for the quite quick reply from you
Advertisement