crayon-syntax-highlighter/util/sample/ruby.txt
2019-08-30 19:30:19 +02:00

9 lines
225 B
Plaintext

# 'w' denotes "write mode".
File.open('file.txt', 'w') do |file|
file.puts 'Wrote some text.'
end # File is automatically closed here
File.readlines('file.txt').each do |line|
puts line
end
# => Wrote some text.