Skip to content

Commit

Permalink
branch that mirrors state of app at end of basic Rails intro in tutor…
Browse files Browse the repository at this point in the history
…ial chapter
  • Loading branch information
armandofox committed Dec 11, 2011
1 parent 01f73f3 commit 1d456d0
Show file tree
Hide file tree
Showing 29 changed files with 538 additions and 286 deletions.
45 changes: 24 additions & 21 deletions Gemfile
@@ -1,27 +1,30 @@
source 'http://rubygems.org'

gem 'rails', '3.1'
gem 'rails', '3.1.0'

# To bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3', '~> 1.3.3'
gem 'haml'
gem 'ruby-tmdb'
gem 'rake', '0.8.7'

group :test, :development do
gem 'capybara'
gem 'cucumber-rails'
gem 'cucumber'
gem 'rspec-rails'
gem 'rspec'
gem 'ruby-debug19'
gem 'rcov'
gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
gem 'jquery-rails'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'haml'
gem 'railroady'
121 changes: 32 additions & 89 deletions Gemfile.lock
Expand Up @@ -30,45 +30,28 @@ GEM
activesupport (= 3.1.0)
activesupport (3.1.0)
multi_json (~> 1.0)
<<<<<<< HEAD
addressable (2.2.6)
=======
archive-tar-minitar (0.5.2)
>>>>>>> e60314f... Updated gems to correct versions; updated form partial (at least one of them) to use new form_for syntax, which requires <%= and not <% on form_for to generate output; fixed syntax in migration since Time.parse and Date.parse take month/day args in opposite order in ruby 1.9
arel (2.2.1)
bcrypt-ruby (3.0.1)
builder (3.0.0)
capybara (1.1.1)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
childprocess (0.2.2)
ffi (~> 1.0.6)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.3)
columnize (0.3.4)
cucumber (1.1.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.5.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
cucumber-rails (1.1.1)
capybara (>= 1.1.1)
cucumber (>= 1.1.0)
nokogiri (>= 1.5.0)
deepopenstruct (0.1.2)
diff-lcs (1.1.3)
erubis (2.7.0)
ffi (1.0.9)
gherkin (2.5.4)
json (>= 1.4.6)
execjs (1.2.9)
multi_json (~> 1.0)
haml (3.1.3)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.18)
railties (~> 3.0)
thor (~> 0.14)
json (1.6.1)
json_pure (1.6.1)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
mail (2.3.0)
Expand All @@ -77,8 +60,7 @@ GEM
treetop (~> 1.4.8)
mime-types (1.17.2)
multi_json (1.0.3)
nokogiri (1.5.0)
polyglot (0.3.2)
polyglot (0.3.3)
rack (1.3.5)
rack-cache (1.0.3)
rack (>= 0.4)
Expand All @@ -88,6 +70,7 @@ GEM
rack
rack-test (0.6.1)
rack (>= 1.0)
railroady (1.0.2)
rails (3.1.0)
actionmailer (= 3.1.0)
actionpack (= 3.1.0)
Expand All @@ -103,40 +86,9 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
<<<<<<< HEAD
rake (0.9.2)
rbx-require-relative (0.0.5)
rcov (0.9.9)
rdoc (3.9.4)
=======
rake (0.8.7)
rake (0.9.2.2)
rdoc (3.11)
json (~> 1.4)
>>>>>>> e60314f... Updated gems to correct versions; updated form partial (at least one of them) to use new form_for syntax, which requires <%= and not <% on form_for to generate output; fixed syntax in migration since Time.parse and Date.parse take month/day args in opposite order in ruby 1.9
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
rspec-rails (2.6.1)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.6.0)
<<<<<<< HEAD
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
ruby-tmdb (0.2.1)
addressable
deepopenstruct (>= 0.1.2)
json
=======
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
Expand All @@ -147,46 +99,37 @@ GEM
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
>>>>>>> e60314f... Updated gems to correct versions; updated form partial (at least one of them) to use new form_for syntax, which requires <%= and not <% on form_for to generate output; fixed syntax in migration since Time.parse and Date.parse take month/day args in opposite order in ruby 1.9
rubyzip (0.9.4)
selenium-webdriver (2.9.1)
childprocess (>= 0.2.1)
ffi (= 1.0.9)
json_pure
rubyzip
sass (3.1.10)
sass-rails (3.1.5)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (~> 3.1.10)
tilt (~> 1.3.2)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.4)
term-ansicolor (1.0.7)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.30)
xpath (0.1.4)
nokogiri (~> 1.3)
tzinfo (0.3.31)
uglifier (1.1.0)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)

PLATFORMS
ruby

DEPENDENCIES
capybara
cucumber
cucumber-rails
coffee-rails (~> 3.1.0)
haml
rails (= 3.1)
<<<<<<< HEAD
rcov
rspec-rails
ruby-debug
ruby-tmdb
=======
rake (= 0.8.7)
rspec
rspec-rails
jquery-rails
railroady
rails (= 3.1.0)
ruby-debug19
>>>>>>> e60314f... Updated gems to correct versions; updated form partial (at least one of them) to use new form_for syntax, which requires <%= and not <% on form_for to generate output; fixed syntax in migration since Time.parse and Date.parse take month/day args in opposite order in ruby 1.9
sqlite3 (~> 1.3.3)
sass-rails (~> 3.1.0)
sqlite3
uglifier
64 changes: 12 additions & 52 deletions README
@@ -1,15 +1,3 @@
== RottenPotatoes for "Engineering Software for Cloud Computing"

This repo tracks the version of the RottenPotatoes teaching app used
with the Fox & Patterson textbook "Engineering Software for Cloud
Computing".

Different branches of the repo correspond to the code developed in
different chapters of the book.

See the book for information on how to use this repo and what the
branches are for.

== Welcome to Rails

Rails is a web-application framework that includes everything needed to create
Expand Down Expand Up @@ -38,39 +26,6 @@ Rails. You can read more about Action Pack in
link:files/vendor/rails/actionpack/README.html.


== Getting Started

NOTE: The steps below are for creating a new app. The initial version
of RottenPotatoes was created with Rails 3.0.5 and Ruby 1.8.7 using the
commands:

* <tt>rails new rottenpotatoes -J -T</tt>
* <tt>cd rottenpotatoes</tt>
* <tt>rails generate resource movie title:string rating:string description:text released_on:datetime</tt>
* <tt>rake db:migrate</tt>
* <tt>rails generate cucumber:install</tt>
* <tt>rails generate rspec:install</tt>
* <tt>rm public/index.html</tt>

and then filling in the basic code for the Movie model, views and controller.

1. At the command prompt, create a new Rails application:
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)

2. Change directory to <tt>myapp</tt> and start the web server:
<tt>cd myapp; rails server</tt> (run with --help for options)

3. Go to http://localhost:3000/ and you'll see:
"Welcome aboard: You're riding Ruby on Rails!"

4. Follow the guidelines to start developing your application. You can find
the following resources handy:

* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/



== Getting Started

1. At the command prompt, create a new Rails application:
Expand Down Expand Up @@ -136,7 +91,7 @@ mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:

class WeblogController < ActionController::Base
def index
@posts = Post.find(:all)
@posts = Post.all
debugger
end
end
Expand Down Expand Up @@ -184,7 +139,7 @@ To reload your controllers and models after launching the console run
<tt>reload!</tt>

More information about irb can be found at:
link:http://www.rubycentral.com/pickaxe/irb.html
link:http://www.rubycentral.org/pickaxe/irb.html


== dbconsole
Expand All @@ -201,6 +156,10 @@ PostgreSQL and SQLite 3.
The default directory structure of a generated Ruby on Rails application:

|-- app
| |-- assets
| |-- images
| |-- javascripts
| `-- stylesheets
| |-- controllers
| |-- helpers
| |-- mailers
Expand All @@ -217,9 +176,6 @@ The default directory structure of a generated Ruby on Rails application:
| `-- tasks
|-- log
|-- public
| |-- images
| |-- javascripts
| `-- stylesheets
|-- script
|-- test
| |-- fixtures
Expand All @@ -233,11 +189,16 @@ The default directory structure of a generated Ruby on Rails application:
| |-- sessions
| `-- sockets
`-- vendor
|-- assets
`-- stylesheets
`-- plugins

app
Holds all the code that's specific to this particular application.

app/assets
Contains subdirectories for images, stylesheets, and JavaScript files.

app/controllers
Holds controllers that should be named like weblogs_controller.rb for
automated URL mapping. All controllers should descend from
Expand Down Expand Up @@ -282,8 +243,7 @@ lib
the load path.

public
The directory available for the web server. Contains subdirectories for
images, stylesheets, and javascripts. Also contains the dispatchers and the
The directory available for the web server. Also contains the dispatchers and the
default HTML files. This should be set as the DOCUMENT_ROOT of your web
server.

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
@@ -1,7 +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__)
require 'rake'

Rottenpotatoes::Application.load_tasks
Binary file added app/assets/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/assets/javascripts/application.js
@@ -0,0 +1,9 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
7 changes: 7 additions & 0 deletions app/assets/stylesheets/application.css
@@ -0,0 +1,7 @@
/*
* 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 .
*/

0 comments on commit 1d456d0

Please sign in to comment.