Sha256: 5eae18039a78ad725a45be49a9cb9ebe8df2eb39c5169b7d128e7f932648dd4a

Contents?: true

Size: 874 Bytes

Versions: 25

Compression:

Stored size: 874 Bytes

Contents

# frozen_string_literal: true

module Bolt
  class PAL
    class YamlPlan
      class Step
        class Upload < Step
          def self.allowed_keys
            super + Set['source', 'destination', 'upload']
          end

          def self.required_keys
            Set['upload', 'destination', 'targets']
          end

          def initialize(step_body)
            super
            @source = step_body['upload'] || step_body['source']
            @destination = step_body['destination']
          end

          def transpile
            code = String.new("  ")
            code << "$#{@name} = " if @name

            fn = 'upload_file'
            args = [@source, @destination, @targets]
            args << @description if @description

            code << function_call(fn, args)

            code << "\n"
          end
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
bolt-2.44.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.42.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.40.2 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.40.1 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.38.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.37.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.36.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.35.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.34.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.33.2 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.33.1 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.32.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.31.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.30.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.29.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.28.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.27.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.26.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.25.0 lib/bolt/pal/yaml_plan/step/upload.rb
bolt-2.24.1 lib/bolt/pal/yaml_plan/step/upload.rb