Preface
Conventions Used in This Book
The following typographical conventions are used in this book:
- Italic
- Indicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width- Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Using Code Examples
All of the code in this book is released under an MIT license, and can be used pretty much anywhere and anyhow you please.
Getting the Code
All of the code in the book is available on github at http://github.com/spatten/thes3cookbook. You can checkout the code using Git with the following command:
1 $> git clone git://github.com/spatten/thes3cookbook.git
You can get a .zip or .tar archive of the code by going to http://github.com/spatten/thes3cookbook and clicking on the ‘download’ button.
How to Contact Me
I can be reached via e-mail at scott@scottpatten.ca. Please contact me if you have any questions, comments, kudos or criticism on the book. Constructive criticism is definitely appreciated; I want this book to get better through your feedback.
Why Ruby
You might be asking yourself why I wrote the examples in this book in Ruby. Here’s a quick set of reasons:
- It’s concise
- The last thing you want if you’re reading (or writing!) a book with lots of code in it is lots of repetitive, boilerplate code. Ruby keeps this to a minimum.
irb-
irbis an interactive Ruby shell which you can use to play around with Ruby. In this book, two other programs (s3shands3lib) extendirbto allow you to play around with S3 on the command prompt. - It’s available
- Ruby comes pre-installed on most Unixes, including OS X. If you are on Windows, the Ruby One Click Installer will get you up and running quickly. See “Installing Ruby and the AWS/S3 Gem” for instructions on installing Ruby
- AWS/S3
- Marcel Molina’s AWS/S3 library is an elegant interface to Amazon S3. It’s used in most of the examples in the book.
- RubyGems
- The RubyGems package library allows you to easily install the additional libraries needed to communicate with S3.
- Ruby makes me happy
- Yukihiro Matsumoto, the creator of Ruby, often says that “… Ruby is designed to make programmers happy.” He also says “…I designed Ruby to minimize my surprise.” This works for the me: Ruby is a pleasure to program in and (once you get used to it) easy to read.
This is not to say that Ruby is the best and only language out there. It just happens to be one that is well suited to this book, so I went with it.
I’ve written a quick intro to Ruby in Appendix A, A Short Introduction to Ruby.