Class: Fastlane::Actions::SayAction

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

Constant Summary

Constants inherited from Fastlane::Action

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

Class Method Summary collapse

Methods inherited from Fastlane::Action

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

Class Method Details

.authorObject



40
41
42
# File 'fastlane/lib/fastlane/actions/say.rb', line 40

def self.author
  "KrauseFx"
end

.available_optionsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'fastlane/lib/fastlane/actions/say.rb', line 21

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :text,
                                 description: 'Text to be spoken out loud (as string or array of strings)',
                                 optional: false,
                                 type: Array),
    FastlaneCore::ConfigItem.new(key: :mute,
                                 env_name: "SAY_MUTE",
                                 description: 'If say should be muted with text printed out',
                                 optional: false,
                                 type: Boolean,
                                 default_value: false)
  ]
end

.categoryObject



50
51
52
# File 'fastlane/lib/fastlane/actions/say.rb', line 50

def self.category
  :misc
end

.descriptionObject



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

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

.example_codeObject



44
45
46
47
48
# File 'fastlane/lib/fastlane/actions/say.rb', line 44

def self.example_code
  [
    'say("I can speak")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



36
37
38
# File 'fastlane/lib/fastlane/actions/say.rb', line 36

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



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

def self.run(params)
  text = params[:text]
  text = text.join(' ')
  text = text.tr("'", '"')

  if params[:mute]
    UI.message(text)
    return text
  else
    Actions.sh("say '#{text}'")
  end
end