Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Append to file

  • append
if ARGV.size != 2
  puts "Need a filename and the content to write to it on the command line"
  exit 1
end
filename, content = ARGV

File.write(filename, content, mode: "a")
  • This is a bug in my code, but it still creates the file with some strange rights ---xr-Sr--
File.write("out.txt", "content", mode = "a")
  • The ameba linter will catch this error.