Skip to content
Browse files

fix indenting to get markdown to recognise the code block properly

  • Loading branch information...
1 parent 9dec65e commit 0f4e340f15c0b2feb6f0824a8c9fcaf85ab90cc8 Glenn Tweedie committed Aug 22, 2011
Showing with 17 additions and 17 deletions.
  1. +17 −17 docs/storage/index.markdown
View
34 docs/storage/index.markdown
@@ -85,29 +85,29 @@ Now you've got a bunch of files in S3: your resume, some code samples,
and maybe some pictures of your cat doing funny stuff. Since this is
all of vital importance, you need to back it up.
- # copy each file to local disk
- directory.files.each do |s3_file|
- File.open(s3_file.key, 'w') do |local_file|
- local_file.write(s3_file.body)
- end
- end
+ # copy each file to local disk
+ directory.files.each do |s3_file|
+ File.open(s3_file.key, 'w') do |local_file|
+ local_file.write(s3_file.body)
+ end
+ end
@rollick
rollick added a note Sep 2, 2011

Nice work nocache!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
One caveat: it's way more efficient to do this:
- # do two things per file
- directory.files.each do |file|
- do_one_thing(file)
- do_another_thing(file)
- end
+ # do two things per file
+ directory.files.each do |file|
+ do_one_thing(file)
+ do_another_thing(file)
+ end
than it is to do this:
- # do two things per file
- directory.files.each do |file|
- do_one_thing(file)
- end.each do |file|
- do_another_thing(file)
- end
+ # do two things per file
+ directory.files.each do |file|
+ do_one_thing(file)
+ end.each do |file|
+ do_another_thing(file)
+ end
The reason is that the list of files might be large. Really
large. Eat-all-your-RAM-and-ask-for-more large. Therefore, every time

0 comments on commit 0f4e340

Please sign in to comment.
Something went wrong with that request. Please try again.