Sha256: 47d479629752e5ccfd025c583167f57b14b5c06dba8639e40f007efe5e1b2da6

Contents?: true

Size: 1.77 KB

Versions: 274

Compression:

Stored size: 1.77 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 paramter 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,
                                       is_string: 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

274 entries across 274 versions & 2 rubygems

Version Path
fastlane-2.120.0.beta.20190408200017 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190407200059 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190406200021 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190405200012 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190404200009 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190403200039 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190402200013 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190401200056 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190331200023 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190330200100 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190329200012 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190328200010 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190327200117 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190326200014 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.120.0.beta.20190325200020 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.119.0 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.119.0.beta.20190324200014 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.119.0.beta.20190323200019 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.119.0.beta.20190322200024 fastlane/lib/fastlane/actions/puts.rb
fastlane-2.119.0.beta.20190321200022 fastlane/lib/fastlane/actions/puts.rb