diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-04 14:18:06 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-14 12:48:15 +0100 |
commit | cd3b8bbd2f8e7ad75a453441f83c46aeb1d37353 (patch) | |
tree | 4db42d36c99897ab1cfaf461ef1d9b5b03c9a218 /lib | |
parent | a5e1905d28e490fb4734bff0e02a1ecff4c7c029 (diff) | |
download | gitlab-ce-cd3b8bbd2f8e7ad75a453441f83c46aeb1d37353.tar.gz |
Add method that checks if path exists in `StringPath`
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/string_path.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/string_path.rb b/lib/gitlab/string_path.rb index 4d024b3ff73..a6234d34e7d 100644 --- a/lib/gitlab/string_path.rb +++ b/lib/gitlab/string_path.rb @@ -19,6 +19,10 @@ module Gitlab @path end + def exists? + @path == './' || @universe.include?(@path) + end + def absolute? @path.start_with?('/') end |