lib/kitchen/busser.rb
# Constructs a new Busser command generator, given a suite name.
#
# @param [String] suite_name name of suite on which to operate
#   (**Required**)
# @param [Hash] opts optional configuration
# @option opts [TrueClass, FalseClass] :use_sudo whether or not to invoke
#   sudo before commands requiring root access (default: `true`)
Constructs a new Busser command generator, given a suite name.
Constructs a new Busser command generator given a suite name .
def stream_file(local_path, remote_path)
      local_file = IO.read(local_path)
      md5 = Digest::MD5.hexdigest(local_file)
      perms = sprintf("%o", File.stat(local_path).mode)[2, 4]
      stream_cmd = [
        "#{sudo}#{busser_bin}",
        "deserialize",
        "--destination=#{remote_path}",
        "--md5sum=#{md5}",
        "--perms=#{perms}"
      ].join(" ")
      <<-STREAMFILE.gsub(/^ {8}/, '')
        echo "Uploading #{remote_path} (mode=#{perms})"
        #{sudo}cat <<"__EOFSTREAM__" | #{sudo}#{stream_cmd}
        #{Base64.encode64(local_file)}
        __EOFSTREAM__
      STREAMFILE
    end
def stream_file ( local_path , remote_path ) local_file = IO . read ( local_path ) md5 = Digest :: MD5 . hexdigest ( local_file ) perms = sprintf ( "%o" , File . stat ( local_path ) . mode ) [ 2 , 4 ] stream_cmd = [ "#{sudo}#{busser_bin}" , "deserialize" , "--destination=#{remote_path}" , "--md5sum=#{md5}" , "--perms=#{perms}" ] . join ( " " ) <<-STREAMFILE . gsub ( / ^ {8} / , '' ) 
        echo "Uploading  #{ remote_path }  (mode= #{ perms } )"
         #{ sudo } cat <<"__EOFSTREAM__" |  #{ sudo } #{ stream_cmd } #{ Base64 . encode64 ( local_file ) } 
        __EOFSTREAM__
       STREAMFILE end
Constructs a new Busser command generator, given a suite name.
Constructs a new Busser command generator given a suite name .
local_path
<not_specific>
remote_path
<not_specific>
<not_specific>
opts optional configuration
opts optional configuration
opts
<not_specific>
:use_sudo whether or not to invoke sudo before commands requiring root access (default: `true`)
: use_sudo whether or not to invoke sudo before commands requiring root access ( default : ` true ` )