Sha256: cee5d08b2e983d02a024190bcbd0cc96ee3d07e34634fc1780db9e7bc88c8c72

Contents?: true

Size: 1.46 KB

Versions: 431

Compression:

Stored size: 1.46 KB

Contents

module Fastlane
  module Actions
    class SayAction < Action
      def self.run(params)
        text = params[:text]
        text = text.join(' ') if text.kind_of?(Array)
        text = text.tr("'", '"')

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

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

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

      def self.is_supported?(platform)
        true
      end

      def self.author
        "KrauseFx"
      end

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

      def self.category
        :misc
      end
    end
  end
end

Version data entries

431 entries across 431 versions & 2 rubygems

Version Path
fastlane-2.129.0.beta.20190809200051 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190808200013 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190807200122 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190806200055 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190805200019 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190804200053 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190803200103 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190802200057 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190731200035 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190730200040 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190729200106 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190728200052 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190727200032 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190726200041 fastlane/lib/fastlane/actions/say.rb
fastlane-2.128.1 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190725200033 fastlane/lib/fastlane/actions/say.rb
fastlane-2.129.0.beta.20190723200012 fastlane/lib/fastlane/actions/say.rb
fastlane-2.128.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.128.0.beta.20190722200021 fastlane/lib/fastlane/actions/say.rb
fastlane-2.128.0.beta.20190721200024 fastlane/lib/fastlane/actions/say.rb