Unverified Commit 19fa77dd authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4871 from dearblue/method-in-method

Avoid method in method
parents adf35836 5b30f789
......@@ -55,8 +55,7 @@ class File < IO
s
end
def self.expand_path(path, default_dir = '.')
def concat_path(path, base_path)
def self._concat_path(path, base_path)
if path[0] == "/" || path[1] == ':' # Windows root!
expanded_path = path
elsif path[0] == "~"
......@@ -87,14 +86,15 @@ class File < IO
expanded_path += "/"
end
else
expanded_path = concat_path(base_path, _getwd)
expanded_path = _concat_path(base_path, _getwd)
expanded_path += "/" + path
end
expanded_path
end
expanded_path = concat_path(path, default_dir)
def self.expand_path(path, default_dir = '.')
expanded_path = _concat_path(path, default_dir)
drive_prefix = ""
if File::ALT_SEPARATOR && expanded_path.size > 2 &&
("A".."Z").include?(expanded_path[0].upcase) && expanded_path[1] == ":"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment