Class: Fastlane::Checks::Credentials
- Inherits:
-
Object
- Object
- Fastlane::Checks::Credentials
- Defined in:
- lib/fastlane/plugin/checks/helper/credentials.rb
Instance Method Summary collapse
- #get_google_credential(scopes) ⇒ Object
-
#initialize(key_file_path: nil) ⇒ Credentials
constructor
A new instance of Credentials.
Constructor Details
#initialize(key_file_path: nil) ⇒ Credentials
Returns a new instance of Credentials.
22 23 24 |
# File 'lib/fastlane/plugin/checks/helper/credentials.rb', line 22 def initialize(key_file_path: nil) @key_file_path = key_file_path end |
Instance Method Details
#get_google_credential(scopes) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fastlane/plugin/checks/helper/credentials.rb', line 26 def get_google_credential(scopes) File.open(File.(@key_file_path), "r") do |file| = { json_key_io: file, scope: scopes } begin return Google::Auth::ServiceAccountCredentials.make_creds() rescue StandardError => e UI.("Failed to read service account file: #{e.}") end end end |