Sha256: 701ade4a2e1275986607d83b70f264fd6f57f1e302562f2606c05931d48239bf

Contents?: true

Size: 1.38 KB

Versions: 64

Compression:

Stored size: 1.38 KB

Contents

module Fastlane
  module Actions
    class SayAction < Action
      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

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

      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

64 entries across 64 versions & 4 rubygems

Version Path
fastlane-2.226.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.225.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.224.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.223.1 fastlane/lib/fastlane/actions/say.rb
fastlane-2.223.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.222.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.221.1 fastlane/lib/fastlane/actions/say.rb
fastlane-2.221.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.220.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.219.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.218.0 fastlane/lib/fastlane/actions/say.rb
fastlane-security-patched-2.216.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.217.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.216.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.215.1 fastlane/lib/fastlane/actions/say.rb
fastlane-2.215.0 fastlane/lib/fastlane/actions/say.rb
fastlane-mercafacil-2.214.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.214.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.213.0 fastlane/lib/fastlane/actions/say.rb
fastlane-2.212.2 fastlane/lib/fastlane/actions/say.rb