Sha256: 530aa44fecabbbfb9b5873e6ffcf642c49efb6c353333532c3e6066902f982a1

Contents?: true

Size: 667 Bytes

Versions: 22

Compression:

Stored size: 667 Bytes

Contents

# Copyright 2019 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved.
# Use of this source code is governed by an MIT-style license that can be found in the LICENSE file

require "digest/md5"

class FolderChecksum
  def self.git_checksum(dir)
    checksum_of_files(`git ls-files #{File.realdirpath(dir).shellescape}`.split("\n"))
  rescue => e
    Pod::UI.warn "Cannot get checksum of tracked files under #{dir}: #{e}"
    checksum_of_files(Dir["#{dir}/**/*"].reject { |f| File.directory?(f) })
  end

  def self.checksum_of_files(files)
    checksums = files.sort.map { |f| Digest::MD5.hexdigest(File.read(f)) }
    Digest::MD5.hexdigest(checksums.join)
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
cocoapods-binary-cache-next-0.1.16 lib/cocoapods-binary-cache/helper/checksum.rb
cocoapods-binary-cache-next-0.1.15 lib/cocoapods-binary-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.19 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.18 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.17 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.16 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.15 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.14 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.13 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.12 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.11 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.10 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.9 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.8 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.7 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.6 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.5 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.4 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.3 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb
cocoapods-binary-artifactory-cache-0.0.2 lib/cocoapods-binary-artifactory-cache/helper/checksum.rb