Sha256: 6a7c8739cd465d6ced9463704733036529c773f9d896498b47527fb6fe88172f

Contents?: true

Size: 851 Bytes

Versions: 28

Compression:

Stored size: 851 Bytes

Contents

# frozen_string_literal: true

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

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

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

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

            fn = 'download_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

28 entries across 28 versions & 1 rubygems

Version Path
bolt-2.26.0 lib/bolt/pal/yaml_plan/step/download.rb
bolt-2.25.0 lib/bolt/pal/yaml_plan/step/download.rb
bolt-2.24.1 lib/bolt/pal/yaml_plan/step/download.rb
bolt-2.24.0 lib/bolt/pal/yaml_plan/step/download.rb
bolt-2.23.0 lib/bolt/pal/yaml_plan/step/download.rb
bolt-2.22.0 lib/bolt/pal/yaml_plan/step/download.rb
bolt-2.21.0 lib/bolt/pal/yaml_plan/step/download.rb
bolt-2.20.0 lib/bolt/pal/yaml_plan/step/download.rb