lib/tap/root.rb in bahuvrihi-tap-0.10.7 vs lib/tap/root.rb in bahuvrihi-tap-0.10.8

- old
+ new

@@ -124,15 +124,17 @@ # Like Dir.chdir but makes the directory, if necessary, when # mkdir is specified. chdir raises an error for non-existant # directories, as well as non-directory inputs. def chdir(dir, mkdir=false, &block) + dir = File.expand_path(dir) + unless File.directory?(dir) if !File.exists?(dir) && mkdir FileUtils.mkdir_p(dir) else - raise "not a directory: #{dir}" + raise ArgumentError, "not a directory: #{dir}" end end Dir.chdir(dir, &block) end @@ -262,10 +264,10 @@ [dirname_or_array(dir), min_join(File.basename(dir), base), extname, version, false, path] end end.compact end end - + # Returns true if the mini_path matches path. Matching logic # reverses that of minimize: # * a match occurs when path ends with mini_path # * if mini_path doesn't specify an extension, then mini_path # must only match path up to the path extension \ No newline at end of file