Created
February 18, 2010 23:45
-
-
Save stouset/308241 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From af2fbd424f2b766dfb1a45f8fd1690aa60bd8eb9 Mon Sep 17 00:00:00 2001 | |
From: Stephen Touset <[email protected]> | |
Date: Thu, 18 Feb 2010 18:23:08 -0500 | |
Subject: [PATCH] Generate gems through gemspec, so C extensions are built | |
--- | |
lib/bundler/source.rb | 25 ++++++++++++++----------- | |
1 files changed, 14 insertions(+), 11 deletions(-) | |
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb | |
index 75da44f..7e17413 100644 | |
--- a/lib/bundler/source.rb | |
+++ b/lib/bundler/source.rb | |
@@ -188,18 +188,21 @@ module Bundler | |
private | |
def generate_bin(spec) | |
- # HAX -- Generate the bin | |
- bin_dir = "#{Gem.dir}/bin" | |
- gem_dir = spec.full_gem_path | |
- installer = Gem::Installer.allocate | |
- installer.instance_eval do | |
- @spec = spec | |
- @bin_dir = bin_dir | |
- @gem_dir = gem_dir | |
- @wrappers = true | |
- @env_shebang = false | |
- @format_executable = false | |
+ gem_dir = spec.full_gem_path | |
+ gem_file = nil # so we have access once after it's set in the block | |
+ | |
+ Dir.chdir(gem_dir) do | |
+ gem_file = Gem::Builder.new(spec).build | |
end | |
+ | |
+ installer = Gem::Installer.new File.join(gem_dir, gem_file), | |
+ :bin_dir => "#{Gem.dir}/bin", | |
+ :wrappers => true, | |
+ :env_shebang => false, | |
+ :format_executable => false | |
+ | |
+ installer.instance_eval { @gem_dir = gem_dir } | |
+ | |
installer.generate_bin | |
end | |
-- | |
1.6.6.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment