Permalink
Browse files

adding revised episode 54

  • Loading branch information...
1 parent 16353c7 commit 7896f5a4395b9e35729b2ada67cb2af3dd143667 @ryanb committed Apr 8, 2012
Showing with 2,002 additions and 0 deletions.
  1. +39 −0 episode-054/README.md
  2. +15 −0 episode-054/todo-after/.gitignore
  3. +40 −0 episode-054/todo-after/Gemfile
  4. +120 −0 episode-054/todo-after/Gemfile.lock
  5. +9 −0 episode-054/todo-after/README.rdoc
  6. +7 −0 episode-054/todo-after/Rakefile
  7. BIN episode-054/todo-after/app/assets/images/rails.png
  8. +15 −0 episode-054/todo-after/app/assets/javascripts/application.js
  9. +3 −0 episode-054/todo-after/app/assets/javascripts/tasks.js.coffee
  10. +99 −0 episode-054/todo-after/app/assets/stylesheets/application.css
  11. +17 −0 episode-054/todo-after/app/assets/stylesheets/tasks.css.scss
  12. +3 −0 episode-054/todo-after/app/controllers/application_controller.rb
  13. +7 −0 episode-054/todo-after/app/controllers/tasks_controller.rb
  14. +2 −0 episode-054/todo-after/app/helpers/application_helper.rb
  15. +2 −0 episode-054/todo-after/app/helpers/tasks_helper.rb
  16. 0 episode-054/todo-after/app/mailers/.gitkeep
  17. 0 episode-054/todo-after/app/models/.gitkeep
  18. +8 −0 episode-054/todo-after/app/models/task.rb
  19. +17 −0 episode-054/todo-after/app/views/layouts/application.html.erb
  20. +4 −0 episode-054/todo-after/app/views/tasks/_task.html.erb
  21. +5 −0 episode-054/todo-after/app/views/tasks/index.html.erb
  22. +4 −0 episode-054/todo-after/config.ru
  23. +59 −0 episode-054/todo-after/config/application.rb
  24. +6 −0 episode-054/todo-after/config/boot.rb
  25. +25 −0 episode-054/todo-after/config/database.yml
  26. +5 −0 episode-054/todo-after/config/environment.rb
  27. +37 −0 episode-054/todo-after/config/environments/development.rb
  28. +67 −0 episode-054/todo-after/config/environments/production.rb
  29. +37 −0 episode-054/todo-after/config/environments/test.rb
  30. +7 −0 episode-054/todo-after/config/initializers/backtrace_silencers.rb
  31. +15 −0 episode-054/todo-after/config/initializers/inflections.rb
  32. +5 −0 episode-054/todo-after/config/initializers/mime_types.rb
  33. +7 −0 episode-054/todo-after/config/initializers/secret_token.rb
  34. +8 −0 episode-054/todo-after/config/initializers/session_store.rb
  35. +14 −0 episode-054/todo-after/config/initializers/wrap_parameters.rb
  36. +5 −0 episode-054/todo-after/config/locales/en.yml
  37. +4 −0 episode-054/todo-after/config/routes.rb
  38. +10 −0 episode-054/todo-after/db/migrate/20120407183150_create_tasks.rb
  39. +23 −0 episode-054/todo-after/db/schema.rb
  40. +12 −0 episode-054/todo-after/db/seeds.rb
  41. +2 −0 episode-054/todo-after/doc/README_FOR_APP
  42. 0 episode-054/todo-after/lib/assets/.gitkeep
  43. 0 episode-054/todo-after/lib/tasks/.gitkeep
  44. 0 episode-054/todo-after/log/.gitkeep
  45. +26 −0 episode-054/todo-after/public/404.html
  46. +26 −0 episode-054/todo-after/public/422.html
  47. +25 −0 episode-054/todo-after/public/500.html
  48. 0 episode-054/todo-after/public/favicon.ico
  49. +5 −0 episode-054/todo-after/public/robots.txt
  50. +6 −0 episode-054/todo-after/script/rails
  51. 0 episode-054/todo-after/test/fixtures/.gitkeep
  52. +9 −0 episode-054/todo-after/test/fixtures/tasks.yml
  53. 0 episode-054/todo-after/test/functional/.gitkeep
  54. +9 −0 episode-054/todo-after/test/functional/tasks_controller_test.rb
  55. 0 episode-054/todo-after/test/integration/.gitkeep
  56. +12 −0 episode-054/todo-after/test/performance/browsing_test.rb
  57. +13 −0 episode-054/todo-after/test/test_helper.rb
  58. 0 episode-054/todo-after/test/unit/.gitkeep
  59. +4 −0 episode-054/todo-after/test/unit/helpers/tasks_helper_test.rb
  60. +7 −0 episode-054/todo-after/test/unit/task_test.rb
  61. 0 episode-054/todo-after/vendor/assets/javascripts/.gitkeep
  62. 0 episode-054/todo-after/vendor/assets/stylesheets/.gitkeep
  63. 0 episode-054/todo-after/vendor/plugins/.gitkeep
  64. +15 −0 episode-054/todo-before/.gitignore
  65. +38 −0 episode-054/todo-before/Gemfile
  66. +111 −0 episode-054/todo-before/Gemfile.lock
  67. +9 −0 episode-054/todo-before/README.rdoc
  68. +7 −0 episode-054/todo-before/Rakefile
  69. BIN episode-054/todo-before/app/assets/images/rails.png
  70. +15 −0 episode-054/todo-before/app/assets/javascripts/application.js
  71. +3 −0 episode-054/todo-before/app/assets/javascripts/tasks.js.coffee
  72. +99 −0 episode-054/todo-before/app/assets/stylesheets/application.css
  73. +17 −0 episode-054/todo-before/app/assets/stylesheets/tasks.css.scss
  74. +3 −0 episode-054/todo-before/app/controllers/application_controller.rb
  75. +6 −0 episode-054/todo-before/app/controllers/tasks_controller.rb
  76. +2 −0 episode-054/todo-before/app/helpers/application_helper.rb
  77. +2 −0 episode-054/todo-before/app/helpers/tasks_helper.rb
  78. 0 episode-054/todo-before/app/mailers/.gitkeep
  79. 0 episode-054/todo-before/app/models/.gitkeep
  80. +8 −0 episode-054/todo-before/app/models/task.rb
  81. +17 −0 episode-054/todo-before/app/views/layouts/application.html.erb
  82. +4 −0 episode-054/todo-before/app/views/tasks/_task.html.erb
  83. +5 −0 episode-054/todo-before/app/views/tasks/index.html.erb
  84. +4 −0 episode-054/todo-before/config.ru
  85. +59 −0 episode-054/todo-before/config/application.rb
  86. +6 −0 episode-054/todo-before/config/boot.rb
  87. +25 −0 episode-054/todo-before/config/database.yml
  88. +5 −0 episode-054/todo-before/config/environment.rb
  89. +37 −0 episode-054/todo-before/config/environments/development.rb
  90. +67 −0 episode-054/todo-before/config/environments/production.rb
  91. +37 −0 episode-054/todo-before/config/environments/test.rb
  92. +7 −0 episode-054/todo-before/config/initializers/backtrace_silencers.rb
  93. +15 −0 episode-054/todo-before/config/initializers/inflections.rb
  94. +5 −0 episode-054/todo-before/config/initializers/mime_types.rb
  95. +7 −0 episode-054/todo-before/config/initializers/secret_token.rb
  96. +8 −0 episode-054/todo-before/config/initializers/session_store.rb
  97. +14 −0 episode-054/todo-before/config/initializers/wrap_parameters.rb
  98. +5 −0 episode-054/todo-before/config/locales/en.yml
  99. +4 −0 episode-054/todo-before/config/routes.rb
  100. +10 −0 episode-054/todo-before/db/migrate/20120407183150_create_tasks.rb
  101. +23 −0 episode-054/todo-before/db/schema.rb
  102. +12 −0 episode-054/todo-before/db/seeds.rb
  103. +2 −0 episode-054/todo-before/doc/README_FOR_APP
  104. 0 episode-054/todo-before/lib/assets/.gitkeep
  105. 0 episode-054/todo-before/lib/tasks/.gitkeep
  106. 0 episode-054/todo-before/log/.gitkeep
  107. +26 −0 episode-054/todo-before/public/404.html
  108. +26 −0 episode-054/todo-before/public/422.html
  109. +25 −0 episode-054/todo-before/public/500.html
  110. 0 episode-054/todo-before/public/favicon.ico
  111. +241 −0 episode-054/todo-before/public/index.html
  112. +5 −0 episode-054/todo-before/public/robots.txt
  113. +6 −0 episode-054/todo-before/script/rails
  114. 0 episode-054/todo-before/test/fixtures/.gitkeep
  115. +9 −0 episode-054/todo-before/test/fixtures/tasks.yml
  116. 0 episode-054/todo-before/test/functional/.gitkeep
  117. +9 −0 episode-054/todo-before/test/functional/tasks_controller_test.rb
  118. 0 episode-054/todo-before/test/integration/.gitkeep
  119. +12 −0 episode-054/todo-before/test/performance/browsing_test.rb
  120. +13 −0 episode-054/todo-before/test/test_helper.rb
  121. 0 episode-054/todo-before/test/unit/.gitkeep
  122. +4 −0 episode-054/todo-before/test/unit/helpers/tasks_helper_test.rb
  123. +7 −0 episode-054/todo-before/test/unit/task_test.rb
  124. 0 episode-054/todo-before/vendor/assets/javascripts/.gitkeep
  125. 0 episode-054/todo-before/vendor/assets/stylesheets/.gitkeep
  126. 0 episode-054/todo-before/vendor/plugins/.gitkeep
View
@@ -0,0 +1,39 @@
+# RailsCasts Episode #54: Debugging Ruby (revised)
+
+http://railscasts.com/episodes/54-debugging-ruby-revised
+
+Requires Ruby 1.9.2 or higher.
+
+### Commands used in Terminal
+
+```
+bundle
+rails s
+```
+
+### Commands used in debugger
+
+```
+help
+help list
+list
+next
+pp @today_tasks
+pp @today_tasks.map(&:due_at)
+step
+l
+n
+pp range
+irb
+continue
+```
+
+### Commands used in irb
+
+```
+puts where(due_at: range).to_sql
+date.to_time
+date.to_time_in_current_zone
+range = date.beginning_of_day..date.end_of_day
+exit
+```
@@ -0,0 +1,15 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+#
+# If you find yourself ignoring temporary files generated by your text editor
+# or operating system, you probably want to add a global ignore instead:
+# git config --global core.excludesfile ~/.gitignore_global
+
+# Ignore bundler config
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
@@ -0,0 +1,40 @@
+source 'https://rubygems.org'
+
+gem 'rails', '3.2.3'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3'
+
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ # gem 'therubyracer', :platform => :ruby
+
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+# To use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# To use Jbuilder templates for JSON
+# gem 'jbuilder'
+
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
+
+gem 'debugger', group: [:development, :test]
@@ -0,0 +1,120 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (3.2.3)
+ actionpack (= 3.2.3)
+ mail (~> 2.4.4)
+ actionpack (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ activerecord (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ activesupport (3.2.3)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ builder (3.0.0)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.2.0)
+ columnize (0.3.6)
+ debugger (1.1.0)
+ columnize (>= 0.3.1)
+ debugger-linecache (~> 1.1)
+ debugger-ruby_core_source (~> 1.1)
+ debugger-linecache (1.1.0)
+ debugger-ruby_core_source
+ debugger-ruby_core_source (1.1.1)
+ erubis (2.7.0)
+ execjs (1.3.0)
+ multi_json (~> 1.0)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.3)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
+ json (1.6.6)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.18)
+ multi_json (1.2.0)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.3)
+ actionmailer (= 3.2.3)
+ actionpack (= 3.2.3)
+ activerecord (= 3.2.3)
+ activeresource (= 3.2.3)
+ activesupport (= 3.2.3)
+ bundler (~> 1.0)
+ railties (= 3.2.3)
+ railties (3.2.3)
+ actionpack (= 3.2.3)
+ activesupport (= 3.2.3)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ sass (3.1.15)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sprockets (2.1.2)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.5)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.32)
+ uglifier (1.2.4)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ coffee-rails (~> 3.2.1)
+ debugger
+ jquery-rails
+ rails (= 3.2.3)
+ sass-rails (~> 3.2.3)
+ sqlite3
+ uglifier (>= 1.0.3)
@@ -0,0 +1,9 @@
+= RailsCasts Example Application
+
+Run these commands to try it out.
+
+ bundle
+ rake db:setup
+ rails s
+
+Requires Ruby 1.9.2 or higher.
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Todo::Application.load_tasks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,15 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,99 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require_self
+ *= require_tree .
+*/
+
+body {
+ background-color: #4B7399;
+ font-family: Verdana, Helvetica, Arial;
+ font-size: 14px;
+}
+
+a img {
+ border: none;
+}
+
+a {
+ color: #0000FF;
+}
+
+.clear {
+ clear: both;
+ height: 0;
+ overflow: hidden;
+}
+
+#container {
+ width: 75%;
+ margin: 0 auto;
+ background-color: #FFF;
+ padding: 20px 40px;
+ border: solid 1px black;
+ margin-top: 20px;
+}
+
+#flash_notice, #flash_error, #flash_alert {
+ padding: 5px 8px;
+ margin: 10px 0;
+ width: 400px;
+}
+
+#flash_notice {
+ background-color: #CFC;
+ border: solid 1px #6C6;
+}
+
+#flash_error, #flash_alert {
+ background-color: #FCC;
+ border: solid 1px #C66;
+}
+
+.fieldWithErrors {
+ display: inline;
+}
+
+.error_messages {
+ width: 400px;
+ border: 2px solid #CF0000;
+ padding: 0px;
+ padding-bottom: 12px;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+ font-size: 12px;
+}
+
+.error_messages h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 10px;
+ font-size: 12px;
+ margin: 0;
+ background-color: #c00;
+ color: #fff;
+}
+
+.error_messages p {
+ margin: 8px 10px;
+}
+
+.error_messages ul {
+ margin: 0;
+}
+
+form .field, form .actions {
+ margin: 12px 0;
+}
+
+.product h2 {
+ font-size: 16px;
+ margin-bottom: 2px;
+}
+
+h1 {
+ margin-top: 5px;
+ margin-bottom: 10px;
+ font-size: 24px;
+}
@@ -0,0 +1,17 @@
+// Place all the styles related to the tasks controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
+
+ul {
+ margin: 20px 0;
+ padding: 0 20px;
+ li {
+ margin: 8px 0;
+ .due {
+ font-size: 12px;
+ color: #777;
+ display: block;
+ padding-top: 2px;
+ }
+ }
+}
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
@@ -0,0 +1,7 @@
+class TasksController < ApplicationController
+ def index
+ debugger
+ @today_tasks = Task.due_on(Date.today)
+ @tomorrow_tasks = Task.due_on(Date.tomorrow)
+ end
+end
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
@@ -0,0 +1,2 @@
+module TasksHelper
+end
No changes.
Oops, something went wrong.

0 comments on commit 7896f5a

Please sign in to comment.