Class: AppRepo::Runner
- Inherits:
-
Object
- Object
- AppRepo::Runner
- Defined in:
- lib/apprepo/runner.rb
Overview
Responsible for running
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #download_manifest ⇒ Object
-
#initialize(options) ⇒ Runner
constructor
A new instance of Runner.
- #notify ⇒ Object
-
#run ⇒ Object
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/CyclomaticComplexity.
-
#upload_binary ⇒ Object
Upload the binary to AppRepo.
-
#verify_version ⇒ Object
Make sure the version on AppRepo matches the one in the ipa If not, the new version will automatically be created.
Constructor Details
#initialize(options) ⇒ Runner
Returns a new instance of Runner.
8 9 10 11 12 |
# File 'lib/apprepo/runner.rb', line 8 def initialize() self. = AppRepo::DetectValues.new.run!(self.) FastlaneCore::PrintTable.print_values(config: , hide_keys: [:repo_password], mask_keys: [:repo_key], title: "apprepo-sftp #{AppRepo::VERSION} Summary") end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/apprepo/runner.rb', line 6 def @options end |
Instance Method Details
#download_manifest ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/apprepo/runner.rb', line 42 def download_manifest if [:manifest_path] uploader = AppRepo::Uploader.new() result = uploader.download_manifest_only msg = 'Metadata download failed. Check out the error above.' UI.user_error!(msg) unless result end end |
#notify ⇒ Object
61 62 63 64 |
# File 'lib/apprepo/runner.rb', line 61 def notify # should be in metadata UI.command_output('TODO: Missing implementation for AppRepo Push Notifier') end |
#run ⇒ Object
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/CyclomaticComplexity
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/apprepo/runner.rb', line 16 def run UI.success('AppRepo SFTP Uploader running...') verify_version unless [:app_version].to_s.empty? has_binary = [:ipa] if ![:skip_binary_upload] && ![:build_number] && has_binary upload_binary end UI.success('Finished the upload to AppRepo.') notify unless [:notify].nil? end |
#upload_binary ⇒ Object
Upload the binary to AppRepo
52 53 54 55 56 57 58 59 |
# File 'lib/apprepo/runner.rb', line 52 def upload_binary if [:ipa] uploader = AppRepo::Uploader.new() result = uploader.upload msg = 'Binary upload failed. Check out the error above.' UI.user_error!(msg) unless result end end |
#verify_version ⇒ Object
Make sure the version on AppRepo matches the one in the ipa If not, the new version will automatically be created
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/apprepo/runner.rb', line 29 def verify_version app_version = [:app_version] msg = "TODO: Test if AppRepo matches '#{app_version}' from the IPA..." UI.(msg) # changed = options[:app].ensure_version!(app_version) # if changed # UI.success("Successfully set the version to '#{app_version}'") # else # UI.success("'#{app_version}' is the latest version on AppRepo") # end end |