I'm working on a project that uses S3 in one place. Fog seems to be
the standard way to interface with AWS from ruby these days, so I gave
it whirl. It works great, but I noticed that the tests that load fog
seem sluggish getting started compared to those tests that don't load
fog. (Note that I keep my tests quite isolated; my spec_helper.rb
doesn't load the entire environment, and each test file loads just the
dependencies it needs).
Knowing of the relative slowness of `require` on 1.9, I threw together
a little test script [1] to see how many files are being loaded when I
`require 'fog'`...and it's over 400 files. It makes sense it could
take a half second or so to load fog.
Looking at the source, I can see why...fog interfaces with tons of
cloud providers. Fog is starting to feel like a very heavy dependency
to pull in for just interfacing with S3. Is there a way to load and
use just a small subset of fog? Can I load just the S3 bits of fog
and use those without incurring the cost of loading the rest of fog?
Thanks,
Myron
[1]
https://gist.github.com/2829415