I'm using rdoc to generate API documentation for my Ruby program, but it's pulling in lots of files I don't care to include in the documentation. I see that there is an option to exclude files by pattern, but it would really be better for me to simply provide an explicit list of files and directories to include.
Is there an option to do this, or am I out of luck?
Related
I'm investigating what it might take to add Sorbet RBI files to gems that I maintain, and I'm trying to figure out the proper process for this. I don't want to have Sorbet as a runtime dependency for the gems, though, so that means having all the type information in a separate RBI file.
My current queries around this are:
Do I add my own rbi file at, say, ./sorbet/rbi/gemname.rbi? And is that where Sorbet will look by default if I package that into the published gem file?
Should I include the other auto-generated RBI files (in ./sorbet/rbi/sorbet-typed and ./sorbet/rbi/hidden-definitions) in the published gem file?
Should I include the typed pragma comment in my gem's files, even though the type information is separated into an RBI file? If so, should it reflect the type information that's present in the file the comment is in, or should it reflect the type information available via the RBI file?
My understanding (I'm in a similar boat) based reading through the custom RBI content is that they recommend writing the definitions in a rbi directory in the gem root directory. I don't think they should go in the the sorbet directory since that file gets quite large (and you don't want to have gem users having to download MBs of repeated definitions).
I've been putting the typed sigils in the library files that I have definitions for and having the RBI files separate. The srb tc picks up the definitions (and complains as appropriate). This means that I don't need to add sorbet as a gem dependency (other than for development).
Sublime Text's Find in Files feature is handy, but I often wish there were a method (or perhaps a plugin I cannot find) to include only files under version control—or, inversely, to exclude files not under version control.
Ideally I'd cherish a <git tracked files> tag, similar to the <open files> and <current file> tags you can use.
Is there a method I could use to achieve this search scope, or a plugin which would allow it?
Sublime's internal Find in Files functionality can be used to search any folder or folders including the ability to add filters to reject or add particular files or file sets, but those filters operate on the path only, not on the contents of the file or any metadata. There is also not an API endpoint for adding new filters to the list or any way for a plugin to interact with the search at all (except to do something to the results once they're generated).
As such, the only way to pull something like this off would be a package/plugin that creates a replacement Find in Files functionality that is more extensible. I'm not aware of any package that does that myself and I've never come across anyone asking about one previously, but there may be something on Package Control that does this.
Depending on your use case you might be able to mostly get what you want by excluding untracked files and/or folders from the search. For example a common notion is to redact node_modules as largely uninteresting in the general case. That's not really a solution to your particular problem, though.
My primary documentation for a project is Sphinx. I also have a large amount of JavaDocs that I'd like to integrate. The basic setup is:
sphinx_source/
javadocs_built/
Before building the Sphinx documents, I can copy the JavaDocs into a directory under sphinx_source.
How can I reference this directory with non-reST files in it from within Sphinx and have them be brought along during the build process?
You probably need to reference the files using the :download: directive.
See: here.
Note that you'll need to reference the files individually, so you may want to set up some kind of script to generate the references for you.
I'm working on a project that needs to get a file list from a variety of different archives files (tar.gz, rar, tar.bz2, and zip) without expanding the archive. Rubyzip works well for zip files, but I can't find any equivalent for the other formats. Any suggestions?
Edit: I forgot to mention that this needs to be cross-platform, so I can't fall back on outside tools.
I don't know of something which handles all formats, but you could do this with a shell call and a little bit of parsing of the result.
Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script?
Background: I've a project with two extension modules, foo.so and bar.so which currently live in their own subdirectories like so:
myproject/ext/foo/extconf.rb
myproject/ext/foo/foo.c
myproject/ext/foo/foo.h
myproject/ext/bar/extconf.rb
myproject/ext/bar/bar.c
myproject/ext/bar/bar.h
I'd prefer that all .c and .h sources simply reside under ext/ under the control of a single extconf.rb file, but I don't know how to get mkmf play along.
With mkmf, you will need to use separate directories; it's not designed for putting multiple extensions in the same directory.
You may be able to use one of the mkmf alternatives (e.g. mkrf) to put the extensions in the same directory; I don't know whether or not this will work. I once wanted to do the same thing, but eventually discovered that as my library grew, having multiple directories for my extensions became desirable for keeping the project organized.