Does anyone know of a program that has support for code completion for Sketchup Ruby API?
Here are some Ruby IDEs that have code completion:
JetBrains RubyMine: http://www.jetbrains.com/ruby/
NetBeans Ruby plugin: http://wiki.netbeans.org/Ruby
Unfortunately, it looks like you might need to do some work to get the Sketchup API symbols loaded into your IDE of choice. If I come across anything, I'll edit this answer.
You might also try posting to their mailing list to see if they have any ideas: http://groups.google.com/group/google-sketchup-developers
I found a code-completion addon for Notepad++. I added the SketchUp Ruby API methods to the Ruby code completion. Though I think it needs updating to support SU8's methods. I don't remember where I found it, but pretty sure it was somewhere on the SketchUcation forum: http://forums.sketchucation.com/
I'll post back if I find it.
Related
I'm trying to bulk scan some jpg files with barcodes on them. I've used the ruby bindings for the c++ port of xzing. When I have this file:
scanned by the Web-Version of Xzing (https://zxing.org/w/decode.jspx) everything turns out fine. When I try to scan this one in ruby (using https://github.com/glassechidna/zxing_cpp.rb) nothing is recognized. I already tried cranking up the contrast, but it did not help. It's not my ruby setup because it works for loads of other nearly identical codes. The only thing I can think of is any difference between the Java version and the C++ port, but this is absolute poking in the dark, I've started using zxing just today.
Could anyone get this code recognized in ruby? Thank you very much.
The gem you're using and/or it's dependencies our out of date. If you want to still use Ruby for your project, you can try using one of the online services in the comments for the decoding. You could either try to use the
mechanize gem or roll your own using other http ruby tools such as httparty or Ruby's Net::HTTP
This is a very noobie question. I hope I still can get some help. I normally use references for the languages I use. Like Tag and Syntax references so I know what they do. A example would be If I was doing HTML I would have this site open http://www.w3schools.com/tags/default.asp
I do this because I can't remember anything. It seems like w3school does not have dart yet so I was wondering if any other Dart coders found something similar?
If there is none what do you guys do to know all the syntaxes/tags? Do you remember everything?
Dartlang.org only has the API reference and some code samples which is good but not enough for me
https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/home
Dart cheat sheet is a concise and clearly arranged summary of the Dart language.
Try Chapter 2. A Tour of the Dart Language from the web version of Dart Up and Running.
It's concise but quite useful, and published as a single we page so it can be searched with the browser search function.
I'd like to have all the Ruby documentation locally.
I've seen this accessing ruby standard library documentation locally
but none of the answers give a clear, simple solution (as far as I can see).
Any suggestions?
Here's the easiest way I've found.
Go to http://www.ruby-doc.org/downloads/ and download your version
Unpack (click on it)
Open index.html
The only tip I got to debug ruby plugins in SketchUp is the use of puts.
I tried to launch SketchUp this way: sketchup.exe > log.txt 2> errors.txt, but it only shows logs / errors from SketchUp app, not from its plugins.
Does anyone knows how to:
Execute step by step inside SketchUp
Get an execution stack when a plugin crashes SketchUp
Any other idea that woul be helpfull to debug ruby plugins in this context
SketchUp released an open source debugger for the SketchUp Ruby API on April 15th, 2014:
https://github.com/SketchUp/sketchup-ruby-debugger
Update: As of SketchUp 2014 you can use Ruby IDE's to step through Ruby code. Follow the instructions at this GitHub repository: https://github.com/SketchUp/sketchup-ruby-debugger
No more puts debugging!
TBD has written and released a bridge to debug SketchUp Ruby plugins: http://labs.plugins.ro/
That's probably what you're looking for. I haven't used it myself yet - so can't elaborate too much on it.
I often use a call to the WIN32 api to OutputDebugString which allows me to see the output (in DebugView) I send to it regardless if SU craches - and it doesn't slow down the execution as much as outputting lots of stuff to the SketchUp Ruby Console:
http://www.thomthom.net/software/sketchup/tt_lib2/doc/TT.html#debug-class_method
(I meant to give a direct link to the BitBucket source code, but the site is down a the moment. Repo: https://bitbucket.org/thomthom/tt-library-2/ )
EDIT: Site back online - direct link: https://bitbucket.org/thomthom/tt-library-2/src/tip/TT_Lib2/debug.rb?at=Version%202.8
One could also reroute puts to OutputDebugString if you wanted a quick catch all solution.
On a slight sidenote, there is also the Developers Tools utility released by the SketchUp team with an enhanced Ruby Console and unit test framework: https://github.com/SketchUp/sketchup-developer-tools
It looks like the SketchUp folks released a new unit testing framework in October 2014. I've not tried using it yet, but will give it a shot and report back with what I find:
https://github.com/SketchUp/testup-2
Does an (experimental) class browser exist for Ruby?
I am talking about a class browser/editor combination similar to that of most Smalltalk implementations (i.e. focused on [runtime] classes/objects instead of .rb files)
P.S.: it looks like pry is already able to do a lot of the things that would be needed by a smalltalk style class browser? https://speakerdeck.com/u/rahult/p/pry-an-irb-alternative-on-steroids
P.S.2: Looks like the Seaside Smalltalk framework has a web browser based class browser
P.S.3: MagLev/Webtools is the closest I have found yet:
P.S.4: Apparently http://tibleiz.net/code-browser/index.html has Ruby support and is able to present a Smalltalk like class browser:
Check out the maglev/webtools project on github, as well as the rubymirrors gem. It already provides a class browser and workspace for multiple Ruby implementations, and a graphical debugger works on MagLev as well (not so much on MRI).
If you want to build one, the easiest would be to use MOOSE and build the browser with Glamour, on top of a Ruby parser written in PetitParser. Then you could use Pharo as your Ruby IDE.
You can have a look at the Maglev Database Explorer [1, 2] as well.
[1] Video: http://www.youtube.com/watch?v=27mS1BNP7wQ
[2] Gem: https://github.com/matthias-springer/maglev-database-explorer-gem
There is. It is called Reflexive. https://github.com/dolzenko/reflexive
(I've never taken the time to try it though, so I am curious about other experiences with it.)
I have no experience with it (and it is old), but may be rbbr still works.