Class: Fastlane::UpdateChecker
- Inherits:
-
Object
- Object
- Fastlane::UpdateChecker
- Defined in:
- lib/fastlane/update_checker.rb
Overview
Verifies, the user runs the latest version of this gem
Class Method Summary collapse
-
.current_version ⇒ Object
The currently used version of this gem.
-
.update_available? ⇒ Boolean
Is a new official release available (this does not include pre-releases).
-
.verify_latest_version ⇒ Object
This method will check if the latest version is installed and show a warning if that’s not the case.
Class Method Details
.current_version ⇒ Object
The currently used version of this gem
35 36 37 |
# File 'lib/fastlane/update_checker.rb', line 35 def self.current_version Fastlane::VERSION end |
.update_available? ⇒ Boolean
Is a new official release available (this does not include pre-releases)
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/fastlane/update_checker.rb', line 22 def self.update_available? begin latest = fetch_latest if latest and Gem::Version.new(latest) > Gem::Version.new(current_version) return true end rescue => ex Helper.log.error("Could not check if 'fastlane' is up to date.") end return false end |
.verify_latest_version ⇒ Object
This method will check if the latest version is installed and show a warning if that’s not the case
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fastlane/update_checker.rb', line 7 def self.verify_latest_version if self.update_available? v = fetch_latest puts '#######################################################################'.green puts "# fastlane #{v} is available.".green puts "# It is recommended to use the latest version.".green puts "# Update using '(sudo) gem update fastlane'.".green puts "# To see what's new, open https://github.com/KrauseFx/fastlane/releases.".green puts '#######################################################################'.green return true end false end |