|
1 | | -# typed: true # rubocop:todo Sorbet/StrictSigil |
| 1 | +# typed: strict |
2 | 2 | # frozen_string_literal: true |
3 | 3 |
|
4 | 4 | # A requirement on a code-signing identity. |
5 | 5 | class CodesignRequirement < Requirement |
6 | 6 | fatal true |
7 | 7 |
|
| 8 | + sig { returns(String) } |
| 9 | + attr_reader :identity |
| 10 | + |
| 11 | + sig { params(tags: T::Array[T.untyped]).void } |
8 | 12 | def initialize(tags) |
9 | 13 | options = tags.shift |
10 | 14 | raise ArgumentError, "CodesignRequirement requires an options Hash!" unless options.is_a?(Hash) |
11 | 15 | raise ArgumentError, "CodesignRequirement requires an identity key!" unless options.key?(:identity) |
12 | 16 |
|
13 | | - @identity = options.fetch(:identity) |
14 | | - @with = options.fetch(:with, "code signing") |
15 | | - @url = options.fetch(:url, nil) |
| 17 | + @identity = T.let(options.fetch(:identity), String) |
| 18 | + @with = T.let(options.fetch(:with, "code signing"), String) |
| 19 | + @url = T.let(options.fetch(:url, nil), T.nilable(String)) |
16 | 20 | super |
17 | 21 | end |
18 | 22 |
|
19 | 23 | satisfy(build_env: false) do |
20 | 24 | T.bind(self, CodesignRequirement) |
| 25 | + odeprecated "CodesignRequirement" |
21 | 26 | mktemp do |
22 | 27 | FileUtils.cp "/usr/bin/false", "codesign_check" |
23 | | - quiet_system "/usr/bin/codesign", "-f", "-s", @identity, |
| 28 | + quiet_system "/usr/bin/codesign", "-f", "-s", identity, |
24 | 29 | "--dryrun", "codesign_check" |
25 | 30 | end |
26 | 31 | end |
|
0 commit comments