Permalink
Browse files

Add the possibility to pass include flags to ruby in an ExtensionTask.

  • Loading branch information...
1 parent 273d9d7 commit 62c84228b86c33a58f1e889ec29d53e82dd0d06c @jfinkhaeuser jfinkhaeuser committed with luislavena Feb 11, 2011
Showing with 18 additions and 1 deletion.
  1. +10 −0 History.txt
  2. +4 −1 lib/rake/extensiontask.rb
  3. +4 −0 spec/lib/rake/extensiontask_spec.rb
View
@@ -1,3 +1,13 @@
+=== (In Git)
+
+* Enhancements:
+ * ExtensionTask now support config_includes to load additional directories.
+ [jfinkhaeuser]
+
+ Rake::ExtensionTask.new("myext", GEM_SPEC) do |ext|
+ ext.config_includes << File.expand_path("my", "custom", "dir")
+ end
+
=== 0.7.7 / 2011-04-04
* Bugfixes:
@@ -13,6 +13,7 @@ class ExtensionTask < BaseExtensionTask
attr_accessor :cross_platform
attr_accessor :cross_config_options
attr_accessor :no_native
+ attr_accessor :config_includes
def init(name = nil, gem_spec = nil)
super
@@ -22,6 +23,7 @@ def init(name = nil, gem_spec = nil)
@cross_config_options = []
@cross_compiling = nil
@no_native = false
+ @config_includes = []
end
def cross_platform
@@ -109,7 +111,8 @@ def define_compile_tasks(for_platform = nil, ruby_ver = RUBY_VERSION)
options = @config_options.dup
# include current directory
- cmd = [Gem.ruby, '-I.']
+ include_dirs = ['.'].concat(@config_includes).uniq.join(File::PATH_SEPARATOR)
+ cmd = [Gem.ruby, "-I#{include_dirs}"]
# if fake.rb is present, add to the command line
if t.prerequisites.include?("#{tmp_path}/fake.rb") then
@@ -80,6 +80,10 @@
@ext.config_options.should be_empty
end
+ it "should have no includes preset to delegate" do
+ @ext.config_includes.should be_empty
+ end
+
it 'should default to current platform' do
@ext.platform.should == RUBY_PLATFORM
end

0 comments on commit 62c8422

Please sign in to comment.