summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2019-05-25 15:38:50 -0800
committerRyan Davis <ryand@zenspider.com>2019-05-25 15:38:50 -0800
commitfc4d3bbfa7923f4388424ce1a9ee66a5b99d363b (patch)
tree863214ca7bcf22b10ab705c24acde2f57945866e
parent2a2156fa6faadb52d60d9034d17e6aa55a336c31 (diff)
downloadhoe-fc4d3bbfa7923f4388424ce1a9ee66a5b99d363b.tar.gz
+ Added Hoe.include_dirs to allow tasks to probe directly.
[git-p4: depot-paths = "//src/hoe/dev/": change = 12061]
-rw-r--r--lib/hoe.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/hoe.rb b/lib/hoe.rb
index a7befe8..bd5bdcb 100644
--- a/lib/hoe.rb
+++ b/lib/hoe.rb
@@ -275,11 +275,22 @@ class Hoe
attr_accessor :version
+ @include_dirs = []
+
+ mc = (class << self; self; end)
+
+ ##
+ # Optional: Extra directories to use (eg for test runs). See
+ # +Hoe.add_include_dirs+.
+
+ mc.send :attr_accessor, :include_dirs
+
##
# Add extra dirs to both $: and RUBY_FLAGS (for test runs and rakefile deps)
def self.add_include_dirs(*dirs)
dirs = dirs.flatten
+ include_dirs.concat dirs
$:.unshift(*dirs)
s = File::PATH_SEPARATOR
RUBY_FLAGS.sub!(/-I/, "-I#{dirs.join(s)}#{s}")