You probably know all my answers to this already, but I’ll just add it here for public record:
I have used it for internal development tools.
No.
Yes - rubyprof for instance. Which I had to compile in a compatible standalone Ruby installation and copy over the compiled gem.
Had to build it myself.
For released “public” extensions I don’t want to use gems. At least not as they appear out of the box. Due to risk of clashing with other extensions. I would only use a gem if I modified it and bundled it with my own extension. (Forcing the user to have to wait to install and possible compile a gem isn’t ideal user experience.)
Good question. I’ll be keeping an eye on the response for this.
I tried using it for one extension some time back. I had SketchUp install the gem if it was missing and only load the extension when the Gem was available but that was messy and slow. I quickly changed my plugin to simply icnclude the Gem but wrapped into my own namespace.
Thank you for the replies. I have to think about this some more, but maybe a RubyGems utility might be helpful, since, as you know, RubyGems is really designed to be a CLI (command line) tool.
I’ve got gem code here and there that runs in scripts, and I think @DanRathbun has posted a few snippets. Regardless, if I do anything with it, I’m sure I’ll ask some really stupid MacOS questions, as I’m windows only.
The gem @tt_su mentioned, (ruby-prof) looks like it can be very helpful for development. From time to time, I’ve thought nokogiri would be helpful, as it makes creating/querying/updating xml and html very easy.
Note:
To clarify for people that may be unfamiliar with gems, they can be divided into two types –
The first are pure ruby gems, and should install into any version of ruby that they support.
The second, which are often called extension gems, have c code that must be compiled to use them. Re SU and plugins, the issue is that the compiled code is ruby major/minor version specific, as it links to the ruby dll or so file. IOW, code compiled for Ruby 2.2.x will not run on Ruby 2.3.x.
I’ve used this in standalone Ruby - as part of development tool. Parsing and extracting strings from HTML pages. But not needed from SU itself. I think XML would have been more relevant a few years ago - but these days it appear that most APIs consume JSON (which is a good thing for SU extensions since JSON is part of StdLib.)