Class: Fastlane::Actions::FastlaneVersionAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/fastlane_version.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, available_options, lane_context, method_missing, other_action, output, return_value, sample_return_value, sh

Class Method Details

.authorObject



25
26
27
# File 'lib/fastlane/actions/fastlane_version.rb', line 25

def self.author
  "KrauseFx"
end

.categoryObject



44
45
46
# File 'lib/fastlane/actions/fastlane_version.rb', line 44

def self.category
  :misc
end

.descriptionObject



29
30
31
# File 'lib/fastlane/actions/fastlane_version.rb', line 29

def self.description
  "Verifies the minimum fastlane version required"
end

.detailsObject



37
38
39
40
41
42
# File 'lib/fastlane/actions/fastlane_version.rb', line 37

def self.details
  [
    "Add this to your `Fastfile` to require a certain version of _fastlane_.",
    "Use it if you use an action that just recently came out and you need it"
  ].join("\n")
end

.example_codeObject



33
34
35
# File 'lib/fastlane/actions/fastlane_version.rb', line 33

def self.example_code
  ['fastlane_version "1.50.0"']
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/fastlane/actions/fastlane_version.rb', line 48

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/fastlane/actions/fastlane_version.rb', line 7

def self.run(params)
  params = nil unless params.kind_of?(Array)
  value = (params || []).first
  defined_version = Gem::Version.new(value) if value

  UI.user_error!("Please pass minimum fastlane version as parameter to fastlane_version") unless defined_version

  if Gem::Version.new(Fastlane::VERSION) < defined_version
    UI.user_error!("The Fastfile requires a fastlane version of >= #{defined_version}. You are on #{Fastlane::VERSION}. Please update using `sudo gem update fastlane`.")
  end

  UI.message("Your fastlane version #{Fastlane::VERSION} matches the minimum requirement of #{defined_version}")
end

.step_textObject



21
22
23
# File 'lib/fastlane/actions/fastlane_version.rb', line 21

def self.step_text
  "Verifying required fastlane version"
end