Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyze bundling ri documentation again with RubyInstaller #185

Open
luislavena opened this issue Jul 28, 2013 · 4 comments
Open

Analyze bundling ri documentation again with RubyInstaller #185

luislavena opened this issue Jul 28, 2013 · 4 comments

Comments

@luislavena
Copy link
Member

Is quite common that Ruby books and tutorials around the web suggest the usage of ri <something> to lookup for the documentation of a method, class, etc.

With RubyInstaller, we removed RI documentation because not only was an lengthly process to build, increased the installer size by half and also slowed down installation process due the massive number of files to be installed.

Let's investigate if these statements remain true with latest version (Ruby 2.0) and see the impact on the installation process.

As alternative, perhaps rdoc-data can be used to generate these files and then exported as another package.

@luislavena
Copy link
Member Author

ri docs consume around 60MB and increased installation time. It generates thousands of files and that makes the installer a bit slower, not to mention the building process.

Until RDoc and ri and produce a dbm database to be used, we are not going to ship ri docs with RubyInstaller.

@drbrain
Copy link

drbrain commented Oct 29, 2013

Reading the DBM documentation, this will take more work on the RDoc side than I anticipated, but not much:

Cautions

Before you decide to use DBM, there are some issues you should consider:

  • Each implementation of dbm has its own file format. Generally, dbm libraries will not read each other's files. This makes dbm files a bad choice for data exchange.
  • Even running the same OS and the same dbm implementation, the database file format may depend on the CPU architecture. For example, files may not be portable between PowerPC and 386, or between 32 and 64 bit Linux.

[similar cautions]

This may not be an issue for the one-click installer, but in general, the rdoc-data gem will need to build the DBM file per machine from a standard tarball to ensure compatibility.

@luislavena
Copy link
Member Author

@drbrain thank you for the feedback (and for looking at this issue!)

All the above cautions are just a big ouch to the idea of implementing this with Ruby's built-in dbm support.

Perhaps can we make RDoc's ri have different storage adapters? That way, I can create an adapter for unqlite which from my tests has worked perfectly on Windows, x86 or x64 and using the same file against Linux.

@drbrain
Copy link

drbrain commented Oct 29, 2013

I think this idea will work:

  1. Package individual ruby version specific gems for ri data that the master rdoc-data gem knows how to find and install.
  2. The version-specific gem will contain a .tar.gz with the rdoc data
  3. At install time, convert the .tar.gz into a DBM store for the local platform without unpacking it to disk (using RubyGems tar code)

This has the following benefits:

  1. Doesn't waste bandwidth
  2. Doesn't waste space on disk due to tiny files
  3. Doesn't waste space on disk due to the rdoc-data gem hanging around because it can be deleted by the rdoc-data install process

But the following drawbacks:

  1. Doesn't work on JRuby (doesn't matter to you)
  2. May break for OS upgrades (doesn't matter to you)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants