The Depot Application

The Depot Application

25.1 Sending E-mail 23.10 Caching, Part Two

23.11 Adding New Templating Systems

cp -v /home/rubys/git/awdwr/edition3/data/code/e1/views/config/initializers/* config/initializers/
`/home/rubys/git/awdwr/edition3/data/code/e1/views/config/initializers/register_eval_template.rb' -> `config/initializers/register_eval_template.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/views/config/initializers/register_rdoc_template.rb' -> `config/initializers/register_rdoc_template.rb'
cp -v /home/rubys/git/awdwr/edition3/data/code/e1/views/lib/*_template.rb lib
`/home/rubys/git/awdwr/edition3/data/code/e1/views/lib/eval_template.rb' -> `lib/eval_template.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/views/lib/rdoc_template.rb' -> `lib/rdoc_template.rb'
mv date_format.reval date_format.text.reval
mv example1.reval example1.text.reval
edit Gemfile
# source 'http://rubygems.org'
 
gem 'rails', :path => "/home/rubys/git/rails" # '3.0.15'
 
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
 
gem 'sqlite3'
 
# Use unicorn as the web server
# gem 'unicorn'
 
# Deploy with Capistrano
# gem 'capistrano'
 
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
 
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
 
gem 'rdoc'
 
gem 'will_paginate', '>= 3.0.pre'
 
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
#   gem 'webrat'
# end

Restart the server.

get /test/example

Greetings from RDoc

Let’s see if we’re doing real formatting…

get /test/date_format
distance_of_time_in_words(Time.now, Time.local(2005, 12, 25)) => over 6 years
time_ago_in_words(Time.utc(2004, 12, 25)) => over 7 years
get /test/example1
Time.now => Fri Jun 29 15:24:24 -0400 2012
request.path => /test/example1
a = 1 => 1
b = 2 => 2
a + b => 3

25.1 Sending E-mail 23.10 Caching, Part Two