Class: Fastlane::Helper::ReleaseVersionHelper
- Inherits:
-
Object
- Object
- Fastlane::Helper::ReleaseVersionHelper
- Defined in:
- lib/fastlane/plugin/release_version/helper/release_version_helper.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(config) ⇒ ReleaseVersionHelper
constructor
A new instance of ReleaseVersionHelper.
- #login ⇒ Object
-
#reject ⇒ Object
Try to reject the application.
-
#release ⇒ Object
Try to release the application.
Constructor Details
#initialize(config) ⇒ ReleaseVersionHelper
Returns a new instance of ReleaseVersionHelper.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fastlane/plugin/release_version/helper/release_version_helper.rb', line 11 def initialize(config) require 'deliver' self. = config # Check requirements has_data = ([:app_identifier].to_s.length != 0 && [:app_version].to_s.length != 0) has_app = ([:ipa].to_s.length != 0) if !has_data && !has_app UI.error("You need to provide an app_identifier and an app_version or a path to an IPA file") return end # Logging into AppStore Connect login # Get app identifier UI.("Getting app identifier") Deliver::DetectValues.new.find_app_identifier() if [:app_identifier].to_s.length != 0 UI.success("Found application identifier: #{options[:app_identifier]}") else UI.error("Could not find an app_identifier") end # Get app version UI.("Getting app version") Deliver::DetectValues.new.find_version() if [:app_version].to_s.length != 0 UI.success("Found application version: #{options[:app_version]}") else UI.error("Could not find an app_version") end # Get applications UI.("Find app from AppStore Connect") Deliver::DetectValues.new.find_app() end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
9 10 11 |
# File 'lib/fastlane/plugin/release_version/helper/release_version_helper.rb', line 9 def end |
Instance Method Details
#login ⇒ Object
49 50 51 52 53 54 |
# File 'lib/fastlane/plugin/release_version/helper/release_version_helper.rb', line 49 def login UI.("Login to App Store Connect (#{options[:username]})") Spaceship::Tunes.login([:username]) Spaceship::Tunes.select_team UI.("Login successful") end |
#reject ⇒ Object
Try to reject the application
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/fastlane/plugin/release_version/helper/release_version_helper.rb', line 71 def reject app = [:app] if app != nil if app.reject_version_if_possible! UI.success("Successfully rejected previous version!") else UI.error("Application cannot be rejected") end end end |
#release ⇒ Object
Try to release the application
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/fastlane/plugin/release_version/helper/release_version_helper.rb', line 57 def release app = [:app] if app != nil begin app.release! rescue UI.error("Failed to release application.") else UI.success("Successfully released the application") end end end |