Sha256: f4a04107a3a6201fdfe8d7dc16635b6a8f3f1c2e72e5f754e370f1b9a1323be0

Contents?: true

Size: 1.01 KB

Versions: 22

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

require 'bolt/error'
require 'bolt/config/transport/base'

module Bolt
  class Config
    module Transport
      class Local < Base
        WINDOWS_OPTIONS = %w[
          cleanup
          interpreters
          tmpdir
        ].freeze

        OPTIONS = WINDOWS_OPTIONS.dup.concat(RUN_AS_OPTIONS).sort.freeze

        DEFAULTS = {
          'cleanup' => true
        }.freeze

        def self.options
          Bolt::Util.windows? ? WINDOWS_OPTIONS : OPTIONS
        end

        private def validate
          super

          if @config['interpreters']
            @config['interpreters'] = normalize_interpreters(@config['interpreters'])
          end

          if (run_as_cmd = @config['run-as-command'])
            unless run_as_cmd.all? { |n| n.is_a?(String) }
              raise Bolt::ValidationError,
                    "run-as-command must be an Array of Strings, received #{run_as_cmd.class} #{run_as_cmd.inspect}"
            end
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
bolt-2.35.0 lib/bolt/config/transport/local.rb
bolt-2.34.0 lib/bolt/config/transport/local.rb
bolt-2.33.2 lib/bolt/config/transport/local.rb
bolt-2.33.1 lib/bolt/config/transport/local.rb
bolt-2.32.0 lib/bolt/config/transport/local.rb
bolt-2.31.0 lib/bolt/config/transport/local.rb
bolt-2.30.0 lib/bolt/config/transport/local.rb
bolt-2.29.0 lib/bolt/config/transport/local.rb
bolt-2.28.0 lib/bolt/config/transport/local.rb
bolt-2.27.0 lib/bolt/config/transport/local.rb
bolt-2.26.0 lib/bolt/config/transport/local.rb
bolt-2.25.0 lib/bolt/config/transport/local.rb
bolt-2.24.1 lib/bolt/config/transport/local.rb
bolt-2.24.0 lib/bolt/config/transport/local.rb
bolt-2.23.0 lib/bolt/config/transport/local.rb
bolt-2.22.0 lib/bolt/config/transport/local.rb
bolt-2.21.0 lib/bolt/config/transport/local.rb
bolt-2.20.0 lib/bolt/config/transport/local.rb
bolt-2.19.0 lib/bolt/config/transport/local.rb
bolt-2.18.0 lib/bolt/config/transport/local.rb