lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb
def common_path(paths)
            return nil if paths.empty?
            strs = paths.map do |path|
              unless path.absolute?
                raise ArgumentError, "Paths must be absolute #{path}"
              end
              path.dirname.to_s
            end
            min, max = strs.minmax
            idx = min.size.times { |i| break i if min[i] != max[i] }
            result = Pathname.new(min[0...idx])
            # Don't consider "/" a common path
            return result unless result.to_s == '/'
          end
# Returns a Pathname of the nearest parent from which all the given paths descend.
# Converts each Pathname to a string and finds the longest common prefix
#
# @param  [Array<Pathname>] paths
#         The paths to files or directories on disk. Must be absolute paths
#
# @return [Pathname] Pathname of the nearest parent shared by paths, or nil if none exists
#
Returns a Pathname of the nearest parent from which all the given paths descend.
Converts each Pathname to a string and finds the longest common prefix
Returns a Pathname of the nearest parent from which all the given paths descend . Converts each Pathname to a string and finds the longest common prefix
def common_path(paths)
            return nil if paths.empty?
            strs = paths.map do |path|
              unless path.absolute?
                raise ArgumentError, "Paths must be absolute #{path}"
              end
              path.dirname.to_s
            end
            min, max = strs.minmax
            idx = min.size.times { |i| break i if min[i] != max[i] }
            result = Pathname.new(min[0...idx])
            return result unless result.to_s == '/'
          end
def common_path ( paths ) return nil if paths . empty? strs = paths . map do | path | unless path . absolute? raise ArgumentError , "Paths must be absolute #{path}" end path . dirname . to_s end min , max = strs . minmax idx = min . size . times { | i | break i if min [ i ] != max [ i ] } result = Pathname . new ( min [ 0 ... idx ] ) return result unless result . to_s == '/' end
Returns a Pathname of the nearest parent from which all the given paths descend.
Returns a Pathname of the nearest parent from which all the given paths descend .
# Don't consider "/" a common path
Pathname of the nearest parent shared by paths, or nil if none exists
Pathname of the nearest parent shared by paths or nil if none exists
Pathname
paths
paths The paths to files or directories on disk. Must be absolute paths
paths The paths to files or directories on disk . Must be absolute paths