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, available_options, 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



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

def self.author
  "KrauseFx"
end

.categoryObject



31
32
33
# File 'fastlane/lib/fastlane/actions/say.rb', line 31

def self.category
  :misc
end

.descriptionObject



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

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

.example_codeObject



25
26
27
28
29
# File 'fastlane/lib/fastlane/actions/say.rb', line 25

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

.is_supported?(platform) ⇒ Boolean

Returns:



17
18
19
# File 'fastlane/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 'fastlane/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