aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat/sha1.rb
blob: 9d6fbc6e01f24eb353c9b51c21a8d1c2d21feba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class Formula
  def self.sha1(val)
    stable.sha1(val)
  end
end

class SoftwareSpec
  def sha1(val)
    @resource.sha1(val)
  end
end

class Resource
  def sha1(val)
    @checksum = Checksum.new(:sha1, val)
  end
end

class BottleSpecification
  def sha1(val)
    digest, tag = val.shift
    collector[tag] = Checksum.new(:sha1, digest)
  end
end

class Pathname
  def sha1
    require "digest/sha1"
    opoo <<-EOS.undent
    SHA1 support is deprecated and will be removed in a future version.
    Please switch this formula to SHA256.
    EOS
    incremental_hash(Digest::SHA1)
  end
end