diff options
-rw-r--r-- | History.txt | 10 | ||||
-rw-r--r-- | lib/rake/extensiontask.rb | 5 | ||||
-rw-r--r-- | spec/lib/rake/extensiontask_spec.rb | 4 |
3 files changed, 18 insertions, 1 deletions
diff --git a/History.txt b/History.txt index 9d4ce2c..c0ce2b9 100644 --- a/History.txt +++ b/History.txt @@ -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: diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb index 4fb5412..e33cc3c 100644 --- a/lib/rake/extensiontask.rb +++ b/lib/rake/extensiontask.rb @@ -13,6 +13,7 @@ module Rake 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 @@ module Rake @cross_config_options = [] @cross_compiling = nil @no_native = false + @config_includes = [] end def cross_platform @@ -109,7 +111,8 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile. 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 diff --git a/spec/lib/rake/extensiontask_spec.rb b/spec/lib/rake/extensiontask_spec.rb index 76a5d1a..5ba977c 100644 --- a/spec/lib/rake/extensiontask_spec.rb +++ b/spec/lib/rake/extensiontask_spec.rb @@ -80,6 +80,10 @@ describe Rake::ExtensionTask do @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 |