Sha256: c8ed35ee9bf9ecb2190b7c24d1118607ec4d92f87b99100a03d2f4d9b0e9435c

Contents?: true

Size: 572 Bytes

Versions: 3

Compression:

Stored size: 572 Bytes

Contents

module TestServerFiles

  def add_file(path)
    full_path = temp_path(path)
    mkdir_p File.dirname(full_path)
    File.open(full_path, 'wb') do |file|
      file.puts @templates[File.basename(full_path)]
    end
  end

  def add_directory(path)
    full_path = temp_path(path)
    mkdir_p full_path
  end

  def has_file?(path)
    full_path = temp_path(path)
    File.exists?(full_path)
  end

  def file_contents(path)
    full_path = temp_path(path)
    File.open(full_path, 'rb', &:read)
  end

  def temp_path(path)
    File.expand_path(path, temp_dir)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ftpd-0.2.0 features/support/test_server_files.rb
ftpd-0.1.1 features/support/test_server_files.rb
ftpd-0.1.0 features/support/test_server_files.rb