Class: Fastlane::Actions::PutsAction

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

Direct Known Subclasses

EchoAction, PrintlnAction

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, deprecated_notes, details, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?

Class Method Details

.alias_used(action_alias, params) ⇒ Object



41
42
43
44
45
# File 'fastlane/lib/fastlane/actions/puts.rb', line 41

def self.alias_used(action_alias, params)
  if !params.kind_of?(FastlaneCore::Configuration) || params[:message].nil?
    UI.important("#{action_alias} called, please use 'puts' instead!")
  end
end

.aliasesObject



47
48
49
# File 'fastlane/lib/fastlane/actions/puts.rb', line 47

def self.aliases
  ["println", "echo"]
end

.authorsObject



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

def self.authors
  ["KrauseFx"]
end

.available_optionsObject



24
25
26
27
28
29
30
31
# File 'fastlane/lib/fastlane/actions/puts.rb', line 24

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :message,
                                 env_name: "FL_PUTS_MESSAGE",
                                 description: "Message to be printed out",
                                 optional: true)
  ]
end

.categoryObject



62
63
64
# File 'fastlane/lib/fastlane/actions/puts.rb', line 62

def self.category
  :misc
end

.descriptionObject



20
21
22
# File 'fastlane/lib/fastlane/actions/puts.rb', line 20

def self.description
  "Prints out the given text"
end

.example_codeObject



56
57
58
59
60
# File 'fastlane/lib/fastlane/actions/puts.rb', line 56

def self.example_code
  [
    'puts "Hi there"'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



37
38
39
# File 'fastlane/lib/fastlane/actions/puts.rb', line 37

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'fastlane/lib/fastlane/actions/puts.rb', line 4

def self.run(params)
  # display text from the message param (most likely coming from Swift)
  # if called like `puts 'hi'` then params won't be a configuration item, so we have to check
  if params.kind_of?(FastlaneCore::Configuration) && params[:message]
    UI.message(params[:message])
    return
  end

  # no parameter included in the call means treat this like a normal fastlane ruby call
  UI.message(params.join(' '))
end

.step_textObject

We don’t want to show this as step



52
53
54
# File 'fastlane/lib/fastlane/actions/puts.rb', line 52

def self.step_text
  nil
end