class Really::FileTransferCommand

Attributes

destination_path[RW]

Public Class Methods

new(source_path, destination_path, options = {}) click to toggle source
Calls superclass method Really::Command::new
# File lib/really/file_transfer_command.rb, line 9
def initialize(source_path, destination_path, options = {})
  super nil, options
  @source_path = source_path
  @destination_path = destination_path
end

Public Instance Methods

source_path() click to toggle source
# File lib/really/file_transfer_command.rb, line 15
def source_path
  return rendered_source_path if @options[:render]
  @source_path
end
to_s() click to toggle source
# File lib/really/file_transfer_command.rb, line 20
def to_s
  "<#{self.class} source:'#{@source_path}' dest:'#{@destination_path}'>"
end

Private Instance Methods

rendered_source_path() click to toggle source
# File lib/really/file_transfer_command.rb, line 26
def rendered_source_path
  return @rendered_file.path if @rendered_file

  @rendered_file = Tempfile.new File.basename(@source_path)

  args = [@source_path]
  args << @options[:context] if @options[:context]

  @rendered_file.print Really::Helpers::RenderingHelper.render_template(*args)
  @rendered_file.close

  logger.debug "Rendered eRuby template to tempfile '#{@rendered_file.path}'."

  @rendered_file.path
end