Sha256: ab375d04d3102db1c4a995ff76fdc170135273ebf7d4e5b21060ccb10296a4e3

Contents?: true

Size: 1.71 KB

Versions: 63

Compression:

Stored size: 1.71 KB

Contents

module Fastlane
  module Actions
    class PutsAction < Action
      def self.run(params)
        # display text from the message param (most likely coming from Swift)
        # if called like `puts 'hi'` then params won't be a configuration item, so we have to check
        if params.kind_of?(FastlaneCore::Configuration) && params[:message]
          UI.message(params[:message])
          return
        end

        # no parameter included in the call means treat this like a normal fastlane ruby call
        UI.message(params.join(' '))
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Prints out the given text"
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :message,
                                       env_name: "FL_PUTS_MESSAGE",
                                       description: "Message to be printed out",
                                       optional: true)
        ]
      end

      def self.authors
        ["KrauseFx"]
      end

      def self.is_supported?(platform)
        true
      end

      def self.alias_used(action_alias, params)
        if !params.kind_of?(FastlaneCore::Configuration) || params[:message].nil?
          UI.important("#{action_alias} called, please use 'puts' instead!")
        end
      end

      def self.aliases
        ["println", "echo"]
      end

      # We don't want to show this as step
      def self.step_text
        nil
      end

      def self.example_code
        [
          'puts "Hi there"'
        ]
      end

      def self.category
        :misc
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 4 rubygems

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