Sha256: 83925997d2a208e027499741eff8577b9b9adebcbb8f5527a49e44ae49f16e0e

Contents?: true

Size: 899 Bytes

Versions: 12

Compression:

Stored size: 899 Bytes

Contents

# typed: false
# frozen_string_literal: true

module Workato
  module CLI
    module MultiAuthSelectedFallback
      private

      def multi_auth_selected_fallback(options)
        say('Please select current auth type for multi-auth connector:')
        options = options.keys
        options.each_with_index do |option, idx|
          say "[#{idx + 1}] #{option}"
        end
        say '[q] <exit>'
        say('')

        multi_auth_selected_fallback = loop do
          answer = ask('Your choice:').to_s.downcase
          break if answer == 'q'
          next unless /\d+/ =~ answer && options[answer.to_i - 1]

          break options[answer.to_i - 1]
        end
        return unless multi_auth_selected_fallback

        say('')
        say('Put selected auth type in your settings file to avoid this message in future')

        multi_auth_selected_fallback
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
workato-connector-sdk-1.3.13 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.12 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.11 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.10 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.9 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.8 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.7 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.6 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.5 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.4 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.3 lib/workato/cli/multi_auth_selected_fallback.rb
workato-connector-sdk-1.3.2 lib/workato/cli/multi_auth_selected_fallback.rb