@@ -15,19 +15,21 @@ gl_homepage = "https://gitlab.com/oauth-xx/oauth2"
15
15
gh_mirror = "https://github.com/oauth-xx/oauth2"
16
16
17
17
Gem ::Specification . new do |spec |
18
- # Linux distros may package ruby gems differently,
19
- # and securely certify them independently via alternate package management systems.
18
+ # Linux distros often package gems and securely certify them independent
19
+ # of the official RubyGem certification process. Allowed via ENV["SKIP_GEM_SIGNING"]
20
20
# Ref: https://gitlab.com/oauth-xx/version_gem/-/issues/3
21
21
# Hence, only enable signing if `SKIP_GEM_SIGNING` is not set in ENV.
22
22
# See CONTRIBUTING.md
23
- user_cert = "certs/#{ ENV . fetch ( "GEM_CERT_USER" , ENV [ "USER" ] ) } .pem"
24
- cert_file_path = File . join ( __dir__ , user_cert )
25
- cert_chain = cert_file_path . split ( "," )
26
- cert_chain . select! { |fp | File . exist? ( fp ) }
27
- if cert_file_path && cert_chain . any?
28
- spec . cert_chain = cert_chain
29
- if $PROGRAM_NAME. end_with? ( "gem" ) && ARGV [ 0 ] == "build" && !ENV . include? ( "SKIP_GEM_SIGNING" )
30
- spec . signing_key = File . join ( Gem . user_home , ".ssh" , "gem-private_key.pem" )
23
+ unless ENV . include? ( "SKIP_GEM_SIGNING" )
24
+ user_cert = "certs/#{ ENV . fetch ( "GEM_CERT_USER" , ENV [ "USER" ] ) } .pem"
25
+ cert_file_path = File . join ( __dir__ , user_cert )
26
+ cert_chain = cert_file_path . split ( "," )
27
+ cert_chain . select! { |fp | File . exist? ( fp ) }
28
+ if cert_file_path && cert_chain . any?
29
+ spec . cert_chain = cert_chain
30
+ if $PROGRAM_NAME. end_with? ( "gem" ) && ARGV [ 0 ] == "build"
31
+ spec . signing_key = File . join ( Gem . user_home , ".ssh" , "gem-private_key.pem" )
32
+ end
31
33
end
32
34
end
33
35
0 commit comments