lib/bubble-wrap/requirement/path_manipulation.rb in bubble-wrap-1.1.1 vs lib/bubble-wrap/requirement/path_manipulation.rb in bubble-wrap-1.1.2

- old
+ new

@@ -20,16 +20,20 @@ def convert_to_absolute_path(path) File.expand_path(path) end def strip_up_to_last_lib(path) - path = path.split('lib') - path = if path.size > 1 - path[0..-2].join('lib') - else - path[0] - end - path = path[0..-2] if path[-1] == '/' + if path =~ /\/lib$/ + path = path.gsub(/\/lib$/, "") + else + path = path.split('lib') + path = if path.size > 1 + path[0..-2].join('lib') + else + path[0] + end + path = path[0..-2] if path[-1] == '/' + end path end def convert_to_relative(path,root) path = path.gsub(root,'')