The Depot Application

The Depot Application

26 Active Resources 23.11 Adding New Templating Systems

25.1 Sending E-mail

ruby -rubygems /home/rubys/git/rails/railties/bin/rails mailer
      create  
      create  app/controllers
      create  app/helpers
      create  app/models
      create  app/views/layouts
      create  config/environments
      create  config/initializers
      create  config/locales
      create  db
      create  doc
      create  lib
      create  lib/tasks
      create  log
      create  public/images
      create  public/javascripts
      create  public/stylesheets
      create  script/performance
      create  test/fixtures
      create  test/functional
      create  test/integration
      create  test/performance
      create  test/unit
      create  vendor
      create  vendor/plugins
      create  tmp/sessions
      create  tmp/sockets
      create  tmp/cache
      create  tmp/pids
      create  Rakefile
      create  README
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  config/database.yml
      create  config/routes.rb
      create  config/locales/en.yml
      create  db/seeds.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/new_rails_defaults.rb
      create  config/initializers/session_store.rb
      create  config/initializers/cookie_verification_secret.rb
      create  config/environment.rb
      create  config/boot.rb
      create  config/environments/production.rb
      create  config/environments/development.rb
      create  config/environments/test.rb
      create  script/about
      create  script/console
      create  script/dbconsole
      create  script/destroy
      create  script/generate
      create  script/runner
      create  script/server
      create  script/plugin
      create  script/performance/benchmarker
      create  script/performance/profiler
      create  test/test_helper.rb
      create  test/performance/browsing_test.rb
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/index.html
      create  public/favicon.ico
      create  public/robots.txt
      create  public/images/rails.png
      create  public/javascripts/prototype.js
      create  public/javascripts/effects.js
      create  public/javascripts/dragdrop.js
      create  public/javascripts/controls.js
      create  public/javascripts/application.js
      create  doc/README_FOR_APP
      create  log/server.log
      create  log/production.log
      create  log/development.log
      create  log/test.log
ruby script/generate mailer OrderMailer confirm sent
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Dependency.new w/ a regexp is deprecated.
Dependency.new called from /home/rubys/git/awdwr/edition3/work-23/mailer/vendor/rails/railties/lib/rails_generator/lookup.rb:211
NOTE: Gem.cache is deprecated, use Gem::source_index. It will be removed on or after 2011-08-01.
Gem.cache called from /home/rubys/git/awdwr/edition3/work-23/mailer/vendor/rails/railties/lib/rails_generator/lookup.rb:212.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems.rb:1174.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem.cache is deprecated, use Gem::source_index. It will be removed on or after 2011-08-01.
Gem.cache called from /home/rubys/git/awdwr/edition3/work-23/mailer/vendor/rails/railties/lib/rails_generator/lookup.rb:234.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems.rb:1174.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:124.
      exists  app/models/
      create  app/views/order_mailer
      exists  test/unit/
      create  test/fixtures/order_mailer
      create  app/models/order_mailer.rb
      create  test/unit/order_mailer_test.rb
      create  app/views/order_mailer/confirm.erb
      create  test/fixtures/order_mailer/confirm
      create  app/views/order_mailer/sent.erb
      create  test/fixtures/order_mailer/sent
mv test/unit/order_mailer_test.rb test/functional
cp -vr /home/rubys/git/awdwr/edition3/data/code/e1/mailer/db/migrate db
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/db/migrate' -> `db/migrate'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/db/migrate/004_populate_data.rb' -> `db/migrate/004_populate_data.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/db/migrate/003_create_orders.rb' -> `db/migrate/003_create_orders.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/db/migrate/002_create_line_items.rb' -> `db/migrate/002_create_line_items.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/db/migrate/001_create_products.rb' -> `db/migrate/001_create_products.rb'
cp -v /home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/controllers/* app/controllers
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/controllers/application.rb' -> `app/controllers/application.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/controllers/order_controller.rb' -> `app/controllers/order_controller.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/controllers/test_controller.rb' -> `app/controllers/test_controller.rb'
cp -v /home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/models/* app/models
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/models/incoming_ticket_handler.rb' -> `app/models/incoming_ticket_handler.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/models/line_item.rb' -> `app/models/line_item.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/models/order.rb' -> `app/models/order.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/models/order_mailer.rb' -> `app/models/order_mailer.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/models/product.rb' -> `app/models/product.rb'
cp -vr /home/rubys/git/awdwr/edition3/data/code/e1/mailer/test .
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/test/fixtures/orders.yml' -> `./test/fixtures/orders.yml'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/test/fixtures/order_mailer/confirm' -> `./test/fixtures/order_mailer/confirm'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/test/fixtures/order_mailer/sent' -> `./test/fixtures/order_mailer/sent'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/test/fixtures/line_items.yml' -> `./test/fixtures/line_items.yml'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/test/fixtures/products.yml' -> `./test/fixtures/products.yml'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/test/functional/order_controller_test.rb' -> `./test/functional/order_controller_test.rb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/test/functional/order_mailer_test.rb' -> `./test/functional/order_mailer_test.rb'
cp -vr /home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/views/order_mailer app/views
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/views/order_mailer/confirm.erb' -> `app/views/order_mailer/confirm.erb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/views/order_mailer/survey.text.plain.erb' -> `app/views/order_mailer/survey.text.plain.erb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/views/order_mailer/sent.erb' -> `app/views/order_mailer/sent.erb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/views/order_mailer/_line_item.erb' -> `app/views/order_mailer/_line_item.erb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/views/order_mailer/_html_line_item.erb' -> `app/views/order_mailer/_html_line_item.erb'
`/home/rubys/git/awdwr/edition3/data/code/e1/mailer/app/views/order_mailer/survey.text.html.erb' -> `app/views/order_mailer/survey.text.html.erb'

Restart the server.

rake db:migrate
mv 001_create_products.rb 20110711000001_create_products.rb
mv 002_create_line_items.rb 20110711000002_create_line_items.rb
mv 003_create_orders.rb 20110711000003_create_orders.rb
mv 004_populate_data.rb 20110711000004_populate_data.rb
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
==  CreateProducts: migrating =================================================
-- create_table(:products)
   -> 0.0039s
==  CreateProducts: migrated (0.0041s) ========================================
 
==  CreateLineItems: migrating ================================================
-- create_table(:line_items)
   -> 0.0028s
==  CreateLineItems: migrated (0.0030s) =======================================
 
==  CreateOrders: migrating ===================================================
-- create_table(:orders)
   -> 0.0034s
==  CreateOrders: migrated (0.0036s) ==========================================
 
==  PopulateData: migrating ===================================================
==  PopulateData: migrated (0.0653s) ==========================================
 
get /test/create_order
Date: Sat, 30 Jun 2012 06:22:21 -0400
From: orders@example.com
To: dave@example.com
Subject: Pragmatic Store Order Confirmation
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8

Dear Dave Thomas

Thank you for your recent order from The Pragmatic Store.

You ordered the following items:

 1 x Programming Ruby, 2nd Edition
 1 x Pragmatic Project Automation


We'll send you a separate e-mail when your order ships.


get /test/ship_order
Thank you...
rake test
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/bin/ruby -I"lib:test" -I"/home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib" "/home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/unit/**/*_test.rb" 
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/bin/ruby -I"lib:test" -I"/home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib" "/home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/functional/**/*_test.rb" 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-23/mailer/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
Loaded suite /home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/rake_test_loader
Started
...
Finished in 0.262548 seconds.
 
3 tests, 9 assertions, 0 failures, 0 errors
/home/rubys/.rvm/rubies/ruby-1.8.7-p352/bin/ruby -I"lib:test" -I"/home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib" "/home/rubys/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/integration/**/*_test.rb" 

26 Active Resources 23.11 Adding New Templating Systems