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



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

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



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

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

.authorsObject



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

def self.authors
  ["KrauseFx"]
end

.available_optionsObject



24
25
26
27
28
29
30
31
32
# 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,
                                 is_string: true)
  ]
end

.categoryObject



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

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



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

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

.is_supported?(platform) ⇒ Boolean

Returns:



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

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



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

def self.step_text
  nil
end