Sha256: 126409efdb86cecfafb2530852c156f70079cb084165f6250e4f1170d424b554

Contents?: true

Size: 422 Bytes

Versions: 3

Compression:

Stored size: 422 Bytes

Contents

# frozen_string_literal: true

module Nocode
  module Steps
    module Io
      class Write < Step
        option :path,
               :register

        def perform
          data = registers[register_option]

          FileUtils.mkdir_p(File.dirname(path))

          File.write(path, data)
        end

        private

        def path
          File.join(*array(path_option))
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nocode-0.0.3 lib/nocode/steps/io/write.rb
nocode-0.0.2 lib/nocode/steps/io/write.rb
nocode-0.0.1 lib/nocode/steps/io/write.rb