lib/berkeley_library/util/paths.rb
# Joins any number of path elements into a single path, separating
# them with slashes, ignoring empty elements and passing the result
# to {Paths#clean}.
#
# @param elements [Array<String>] the elements to join
# @return [String] the joined path
Joins any number of path elements into a single path, separating
them with slashes, ignoring empty elements and passing the result
to {Paths#clean}.
Joins any number of path elements into a single path separating them with slashes ignoring empty elements and passing the result to { Paths#clean } .
def join(*elements)
        elements = elements.reject { |e| [nil, ''].include?(e) }
        joined_raw = elements.join('/')
        return '' if joined_raw == ''
        clean(joined_raw)
      end
def join ( * elements ) elements = elements . reject { | e | [ nil , '' ] . include? ( e ) } joined_raw = elements . join ( '/' ) return '' if joined_raw == '' clean ( joined_raw ) end
Joins any number of path elements into a single path, separating
them with slashes, ignoring empty elements and passing the result
to {Paths#clean}.
Joins any number of path elements into a single path separating them with slashes ignoring empty elements and passing the result to { Paths#clean } .
the joined path
the joined path
String
elements
the elements to join
the elements to join