radar / guides

Guides for Ruby and Elixir and whatever else I feel like
1.52k stars 166 forks source link

clarification about Bundler.require #3

Open ericgj opened 14 years ago

ericgj commented 14 years ago

Thanks for this useful write-up.

One thing I'm not clear on is if you want your gem to be used either with or without bundler, it's great that bundler now picks up on the .gemspec dependencies but don't you still need to rescue every time you require 'bundler' and Bundler.require() ? I think it would be helpful to have an example of that here. Unless I'm missing something.

radar commented 14 years ago

There should only be one require 'bundler' anywhere in the gem, and that would be in the Rakefile, which is only used for developing the gem. In this case, anybody attempting to do any development work on the gem should have Bundler installed since without it they'll be unable to build the gem.

Does this answer your question?

ericgj commented 14 years ago

So if I understand, in your examples, activesupport and thor are not managed through Bundler at all (you don't call Bundler.setup :default before they are required)? In which case what is the advantage of bundle installing them?

Not sure I like the sound of requiring Bundler to build the gem. I guess I'm kind of left scratching my head whether the advantage of Bundler over plain old rubygems in this case (sandboxing the development gems) is really worth it.