Sha256: f020a4ba79d9cb79604618c00d93a4931b5af99a2eee703f3820165bf50af78e

Contents?: true

Size: 443 Bytes

Versions: 16

Compression:

Stored size: 443 Bytes

Contents

require 'base64'

module Vx
  module Common
    module Helper
      module UploadShCommand

        def upload_sh_command(path, content, options = {})
          encoded = ::Base64.encode64(content).gsub("\n", '')
          "(echo #{encoded} | #{upload_sh_base64_command options}) > #{path}"
        end

        private

          def upload_sh_base64_command(options)
            %{base64 --decode}
          end

      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vx-common-0.4.0 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.3.2 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.3.1 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.3.0 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.1 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre38 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre37 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre36 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre35 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre34 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre33 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre32 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre31 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre30 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre29 lib/vx/common/helper/upload_sh_command.rb
vx-common-0.2.0.pre28 lib/vx/common/helper/upload_sh_command.rb