From: Luis Lavena Date: 2011-01-31T03:02:47+09:00 Subject: Re: how to build gem whose dependencies depend of the platform? On Jan 30, 8:06 am, Uwe Kubosch wrote: > > > RubyGems post_install is not scripts, perhaps you're using extension > > compilation to make that happen, which is intrusive to the user. > > You are right, I use the extension compilation to run the extra install step. > > How is this intrusive? > If user grant RubyGems sudo to install the gem and it's dependencies, you're sneaking something that the user was not aware of. If the user using a gem list find this gem he didn't install, on uninstallation no dependency warning will be triggered, and the original gem will not work because of that. > > You're also bringing Bundler when the user might not want it into the > > mix and slowing down the gem loading process. > > I would rather add Bundler than not have the gem install all its dependencies.  The user experience is what matters, and this way all dependencies install correctly and the gem is ready for use regardless of the users platform. > This is similar case to what Hoe did in the past, as add it as dependency even that you used for development only. Search for it. > > 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. > > Why not?  Bundler is awesome for runtime dependencies as well.  It is the default mechanism for Ruby On Rails runtime dependencies. > http://www.ibrasten.com/articles/2010/11/15/reducing-jruby-startup-by-ditching-bundler > > Also bundler do not handle properly all the platforms, using a > > different concept of "platform" of what RubyGems understand and is > > widely known. > > The platform concept of Bundler is different from RubyGems platform, but Bundler handles all platforms properly and the platform concept of Bundler is as well known and as intuitive as RubyGems. > No, it doesn't, take for example JSON gem, is broken under 1.9.x or 1.8.x for Windows and even when the user decided to fix it manually, bundler always force it's installation. https://github.com/carlhuda/bundler/issues/635 https://github.com/carlhuda/bundler/issues/589 -- Luis Lavena