lib/assembly-objectfile/object_file.rb in assembly-objectfile-1.8.3 vs lib/assembly-objectfile/object_file.rb in assembly-objectfile-1.8.4

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Assembly # This class contains generic methods to operate on any file. class ObjectFile include Assembly::ObjectFileable @@ -16,12 +18,12 @@ n = 0 x = strings.last n += 1 while strings.all? { |s| s[n] && (s[n] == x[n]) } common_prefix = x[0...n] if common_prefix[-1, 1] != '/' # check if last element of the common string is the end of a directory - return common_prefix.split('/')[0..-2].join('/') + '/' # if not, split string along directories, and reject last one + common_prefix.split('/')[0..-2].join('/') + '/' # if not, split string along directories, and reject last one else - return common_prefix # if it was, then return the common prefix directly + common_prefix # if it was, then return the common prefix directly end end end end