lib/rbbt/resource/util.rb in rbbt-util-4.4.0 vs lib/rbbt/resource/util.rb in rbbt-util-5.0.0

- old
+ new

@@ -6,11 +6,11 @@ file = caller.reject{|l| l =~ /rbbt\/(?:resource\.rb|workflow\.rb)/ or l =~ /rbbt\/resource\/path\.rb/ or l =~ /rbbt\/util\/misc\.rb/ or l =~ /progress-monitor\.rb/ - }.first.sub(/\.rb.*/,'.rb') if file.nil? + }.first.sub(/\.rb[^\w].*/,'.rb') if file.nil? file = File.expand_path file return Path.setup(file) if File.exists? File.join(file, relative_to) while file != '/' @@ -80,11 +80,11 @@ CMD.cmd(File.join(opt_dir, '.post_install')) end def rake_for(path) - entry = @rake_dirs.reject{|dir, content| + @rake_dirs.reject{|dir, content| !Misc.common_path(dir, path) }.sort_by{|dir, content| dir.length }.last end @@ -94,9 +94,11 @@ end def run_rake(path, rakefile, rake_dir) task = Misc.path_relative_to rake_dir, path rakefile = rakefile.produce if rakefile.respond_to? :produce + + rake_dir = rake_dir.find if rake_dir.respond_to? :find begin Rake.run(rakefile, rake_dir, task) rescue Rake::TaskNotFound raise $! if rake_dir.nil? or rake_dir.empty? or rake_dir == "/" or rake_dir == "./"