Class: Pilot::Manager
- Inherits:
-
Object
- Object
- Pilot::Manager
- Defined in:
- lib/pilot/manager.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#app ⇒ Object
The app object we’re currently using.
-
#config ⇒ Object
Access the current configuration.
-
#fetch_app_id ⇒ Object
Config Related.
- #fetch_app_identifier ⇒ Object
- #login ⇒ Object
- #start(options) ⇒ Object
Instance Method Details
#app ⇒ Object
The app object we’re currently using
20 21 22 23 24 25 26 27 |
# File 'lib/pilot/manager.rb', line 20 def app @apple_id ||= fetch_app_id unless (@app ||= Spaceship::Application.find(@apple_id)) raise "Could not find app with #{(config[:apple_id] || config[:app_identifier])}" end return @app end |
#config ⇒ Object
Access the current configuration
30 31 32 |
# File 'lib/pilot/manager.rb', line 30 def config @config end |
#fetch_app_id ⇒ Object
Config Related
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/pilot/manager.rb', line 37 def fetch_app_id return @apple_id if @apple_id config[:app_identifier] = fetch_app_identifier if config[:app_identifier] @app ||= Spaceship::Application.find(config[:app_identifier]) raise "Couldn't find app '#{config[:app_identifier]}' on the account of '#{config[:username]}'".red unless @app app_id ||= @app.apple_id end app_id ||= ask("Could not automatically find the app ID, please enter it here (e.g. 956814360): ") return app_id end |
#fetch_app_identifier ⇒ Object
52 53 54 55 56 57 |
# File 'lib/pilot/manager.rb', line 52 def fetch_app_identifier result = config[:app_identifier] result ||= FastlaneCore::IpaFileAnalyser.fetch_app_identifier(config[:ipa]) result ||= ask("Please enter the app's bundle identifier: ") return result end |
#login ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/pilot/manager.rb', line 11 def login config[:username] ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id) Helper.log.info "Login to iTunes Connect (#{config[:username]})" Spaceship::Tunes.login(config[:username]) Helper.log.info "Login successful" end |
#start(options) ⇒ Object
5 6 7 8 9 |
# File 'lib/pilot/manager.rb', line 5 def start() return if @config # to not login multiple times @config = login end |