Closed sam closed 11 years ago
Right. Our generated gemspec for "doubleshotted" packages should address this.
Solution: Don't call Doubleshot within your gem. Only within your tests. Instead of having separate setup and build features, we'll only support the build version. In the context of a distributed Gem or JAR, you'll already have all your dependencies (either within the bundle (JAR), or in the GEM_HOME
since Rubygems will have used the gemspec to download them).
The only thing we have to worry about in that case is ensuring the load-paths and classpaths are correct. The JAR's manifest will address the second, and if we unpack JAR dependencies at the root of the new JAR, the load-path will find them.
Load paths for bundled Rubygems are a little more complex, but those can be added to the gemspec, which will address the Gem packaging issue.
This no longer applies. To use Doubleshot in testing or in a top-level application, just require("doubleshot")
. You wouldn't require doubleshot at all in your actual source code (just tests). Same strategy as Bundler.
If your project has a dependency on a "doubleshotted" project, but you're using Bundler, then we'd need to ensure that
doubleshot/setup
does NOT resolve Gem dependencies, and instead lets the already-loaded Bundler do it's job.If we let doubleshot resolve/download Gem dependencies, we'd be duplicating work already done by a
require("bundler/setup")
since all your gems should already be loaded.Right?