On Dec 3, 2008, at 10:27 AM, _why wrote:
On Fri, Nov 28, 2008 at 04:58:48PM -0600, Daniel Zepeda wrote:
* Automatic loading of libraries in the ‘/vendor’ directory
Hey, good work, DZ.
Thanks! That means a lot to me.
How do you deal with keeping the app cross-platform for binary
gems? Like say you want to bundle Mongrel with your app. How do
vendor the win32 and source stuff and then trigger extconf.rb?
Um, I don't at the moment. That falls under the 'haven't had to deal
with it yet' category, so I don't have a solution at this point. All
the gems I've had to use are pure Ruby, and don't need any
installation. When I was requiring them manually I had thought about
just packing all platforms and testing RUBY_PLATFORM, which might
work for OS X and Windows, but after thinking about the plethora of
Linux distros, it doesn't seem feasible.
I think what I'll probably do is to not unpack the gems and just
have them install when the app runs, but I'll take some advice on
the matter.
As I said, I haven't thought about it since I haven't run into that
yet, but yeah, doing what you suggest is the best approach. Right
now, I've just relied on them being required from the application's
directory structure, but it's a better approach to put them in
~/.shoes like you've been doing and add that to the LOAD_PATH and use
gem to get them pulled in. I think you are way ahead of me on the
library/gem part, probably in the end the template will just be
useful for the "user" classes (those written by the template user),
because my approach as far as the libraries/gems is not general
enough. You could just loop through everything it finds in a vendor
directory and 'gem install' them from the local file into ~/.shoes
(and the other platform counterparts for ~/.shoes), that way, you
have the best of both worlds, you get to pack everything up in your
application still, _and_ you get the cross-platform goodness that gem
provides.
Anyway, I have an early full day tomorrow, so I can't think about it
anymore tonight, I'll give it some thought over the weekend, but you
are probably way ahead of me on that score anyway.
DZ