Sha256: c89f09db648ea1ac8e930411b513c24991b8abbc6d2a4220d0a8110184a75ab1
Contents?: true
Size: 1.2 KB
Versions: 1
Compression:
Stored size: 1.2 KB
Contents
module CredentialsManager # Access the content of the app file (e.g. app identifier and Apple ID) class AppfileConfig def self.try_fetch_value(key) if self.default_path return self.new.data[key] end nil end def self.default_path ["./fastlane/Appfile", "./Appfile"].each do |current| return current if File.exists?current end nil end def initialize(path = nil) path ||= self.class.default_path raise "Could not find Appfile at path '#{path}'".red unless File.exists?(path) full_path = File.expand_path(path) Dir.chdir(File.expand_path('..', path)) do eval(File.read(full_path)) end end def data @data ||= {} end # Setters def app_identifier(value) value ||= yield if block_given? data[:app_identifier] = value if value end def apple_id(value) value ||= yield if block_given? data[:apple_id] = value if value end def team_id(value) value ||= yield if block_given? data[:team_id] = value if value end def team_name(value) value ||= yield if block_given? data[:team_name] = value if value end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
credentials_manager-0.1.3 | lib/credentials_manager/appfile_config.rb |