class Fastlane::Action

Constants

AVAILABLE_CATEGORIES
RETURN_TYPES

Attributes

runner[RW]

Public Class Methods

action_name() click to toggle source

instead of “AddGitAction”, this will return “add_git” to print it to the user

# File fastlane/lib/fastlane/action.rb, line 123
def self.action_name
  self.name.split('::').last.gsub(/Action$/, '').fastlane_underscore
end
author() click to toggle source
# File fastlane/lib/fastlane/action.rb, line 87
def self.author
  nil
end
authors() click to toggle source
# File fastlane/lib/fastlane/action.rb, line 91
def self.authors
  nil
end
available_options() click to toggle source
# File fastlane/lib/fastlane/action.rb, line 53
def self.available_options
  # [
  #   FastlaneCore::ConfigItem.new(key: :ipa_path,
  #                                env_name: "CRASHLYTICS_IPA_PATH",
  #                                description: "Value Description")
  # ]
  nil
end
category() click to toggle source

Documentation category, available values defined in AVAILABLE_CATEGORIES

# File fastlane/lib/fastlane/action.rb, line 118
def self.category
  :undefined
end
deprecated_notes() click to toggle source

Describes how the user should handle deprecated an action if its deprecated Returns a string (or nil)

# File fastlane/lib/fastlane/action.rb, line 151
def self.deprecated_notes
  nil
end
description() click to toggle source

Implement in subclasses

# File fastlane/lib/fastlane/action.rb, line 45
def self.description
  "No description provided".red
end
details() click to toggle source
# File fastlane/lib/fastlane/action.rb, line 49
def self.details
  nil # this is your chance to provide a more detailed description of this action
end
example_code() click to toggle source

Returns an array of string of sample usage of this action

# File fastlane/lib/fastlane/action.rb, line 107
def self.example_code
  nil
end
is_supported?(platform) click to toggle source
# File fastlane/lib/fastlane/action.rb, line 95
def self.is_supported?(platform)
  # you can do things like
  #  true
  #
  #  platform == :ios
  #
  #  [:ios, :mac].include?(platform)
  #
  UI.crash!("Implementing `is_supported?` for all actions is mandatory. Please update #{self}")
end
lane_context() click to toggle source
# File fastlane/lib/fastlane/action.rb, line 127
def self.lane_context
  Actions.lane_context
end
method_missing(method_sym, *arguments, &_block) click to toggle source

Allows the user to call an action from an action

# File fastlane/lib/fastlane/action.rb, line 132
def self.method_missing(method_sym, *arguments, &_block)
  UI.error("Unknown method '#{method_sym}'")
  UI.user_error!("To call another action from an action use `other_action.#{method_sym}` instead")
end
other_action() click to toggle source

Return a new instance of the OtherAction action We need to do this, since it has to have access to the runner object

# File fastlane/lib/fastlane/action.rb, line 145
def self.other_action
  return OtherAction.new(self.runner)
end
output() click to toggle source
# File fastlane/lib/fastlane/action.rb, line 62
def self.output
  # Return the keys you provide on the shared area
  # [
  #   ['IPA_OUTPUT_PATH', 'The path to the newly generated ipa file']
  # ]
  nil
end
return_type() click to toggle source
# File fastlane/lib/fastlane/action.rb, line 70
def self.return_type
  # Describes what type of data is expected to be returned, see RETURN_TYPES
  nil
end
return_value() click to toggle source
# File fastlane/lib/fastlane/action.rb, line 75
def self.return_value
  # Describes what this method returns
  nil
end
run(params) click to toggle source
# File fastlane/lib/fastlane/action.rb, line 41
def self.run(params)
end
sample_return_value() click to toggle source
# File fastlane/lib/fastlane/action.rb, line 80
def self.sample_return_value
  # Very optional
  # You can return a sample return value, that might be returned by the actual action
  # This is currently only used when generating the documentation and running its tests
  nil
end
shell_out_should_use_bundle_exec?() click to toggle source

When shelling out from the action, should we use `bundle exec`?

# File fastlane/lib/fastlane/action.rb, line 138
def self.shell_out_should_use_bundle_exec?
  return File.exist?('Gemfile') && !Helper.contained_fastlane?
end
step_text(params) click to toggle source

Is printed out in the Steps: output in the terminal Return nil if you don't want any logging in the terminal/JUnit Report

# File fastlane/lib/fastlane/action.rb, line 113
def self.step_text(params)
  self.action_name
end