Class: Fastlane::Actions::SayAction

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

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, available_options, details, output, return_value, sh, step_text

Class Method Details

.authorObject



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

def self.author
  "KrauseFx"
end

.descriptionObject



13
14
15
# File 'lib/fastlane/actions/say.rb', line 13

def self.description
  "This action speaks out loud the given text"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/fastlane/actions/say.rb', line 17

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/fastlane/actions/say.rb', line 4

def self.run(params)
  text = params.join(' ') if params.kind_of?(Array) # that's usually the case
  text = params if params.kind_of?(String)
  UI.user_error!("You can't call the `say` action as OneOff") unless text
  text = text.tr("'", '"')

  Actions.sh("say '#{text}'")
end