On Jan 29, 9:55=A0am, Uwe Kubosch <u... / kubosch.no> wrote:
> On 2011-01-29, at 12:21, Jarmo Pertman wrote:
>
> >>> I need to build a gem whose dependencies are dependent of the platfor=
m
> >>> itself. For example when `gem install my_gem` is issued under Windows=
,
> >>> then in gemspec i have to have spec.add_dependency("gemX"), but if th=
e
> >>> command is executed under linux then i need to have
> >>> spec.add_dependency("gemY").
>
> I have solved this by making the gem depend on the "bundler" gem, and the=
n put the gem dependecies into a Gemfile, and run the equivalent of "bundle=
 install" as a post-install script. =A0This takes care of everything. =A0Th=
e only thing I am missing is that the dependencies are visible when inspect=
ing the gem.
>

RubyGems post_install is not scripts, perhaps you're using extension
compilation to make that happen, which is intrusive to the user.

You're also bringing Bundler when the user might not want it into the
mix and slowing down the gem loading process.

Bundler is awesome for development, but is awful for runtime
dependency. You should not be imposing bundler to the user and even
less for runtime execution.

Also bundler do not handle properly all the platforms, using a
different concept of "platform" of what RubyGems understand and is
widely known.

--
Luis Lavena