diff options
| author | Julian Aron Prenner <[email protected]> | 2015-01-07 09:24:48 +0100 |
|---|---|---|
| committer | Julian Aron Prenner <[email protected]> | 2015-01-07 09:31:30 +0100 |
| commit | edf7729d891b37423ca6b02768570e0b441f2884 (patch) | |
| tree | eb8fb9cecc4eda68ef0da8371154cb564d89413f /minirake | |
| parent | 432afa2c42f82093626f88242073ce135ad1b156 (diff) | |
| download | mruby-edf7729d891b37423ca6b02768570e0b441f2884.tar.gz mruby-edf7729d891b37423ca6b02768570e0b441f2884.zip | |
Correctly handle relative paths
Diffstat (limited to 'minirake')
| -rwxr-xr-x | minirake | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -259,10 +259,10 @@ module MiniRake MiniRake::FileTask.define_task(args) do |t| block.call(t) unless block.nil? dir = args.is_a?(Hash) ? args.keys.first : args - dir.split(File::SEPARATOR).reject(&:empty?).inject("") do |acc, part| - (acc + File::SEPARATOR + part).tap do |d| + (dir.split(File::SEPARATOR) + ['']).inject do |acc, part| + (acc + File::SEPARATOR).tap do |d| Dir.mkdir(d) unless File.exists? d - end + end + part end end end |
