Skip to content

Commit 1d456d0

Browse files
committed
branch that mirrors state of app at end of basic Rails intro in tutorial chapter
1 parent 01f73f3 commit 1d456d0

29 files changed

+538
-286
lines changed

Gemfile

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
source 'http://rubygems.org'
22

3-
gem 'rails', '3.1'
3+
gem 'rails', '3.1.0'
44

5-
# To bundle edge Rails instead:
6-
# gem 'rails', :git => 'git://github.com/rails/rails.git'
5+
# Bundle edge Rails instead:
6+
# gem 'rails', :git => 'git://github.com/rails/rails.git'
77

8-
gem 'sqlite3', '~> 1.3.3'
9-
gem 'haml'
10-
gem 'ruby-tmdb'
11-
gem 'rake', '0.8.7'
12-
13-
group :test, :development do
14-
gem 'capybara'
15-
gem 'cucumber-rails'
16-
gem 'cucumber'
17-
gem 'rspec-rails'
18-
gem 'rspec'
19-
gem 'ruby-debug19'
20-
gem 'rcov'
8+
gem 'sqlite3'
9+
10+
11+
# Gems used only for assets and not required
12+
# in production environments by default.
13+
group :assets do
14+
gem 'sass-rails', " ~> 3.1.0"
15+
gem 'coffee-rails', "~> 3.1.0"
16+
gem 'uglifier'
2117
end
2218

23-
# Bundle the extra gems:
24-
# gem 'bj'
25-
# gem 'nokogiri'
26-
# gem 'sqlite3-ruby', :require => 'sqlite3'
27-
# gem 'aws-s3', :require => 'aws/s3'
19+
gem 'jquery-rails'
20+
21+
# Use unicorn as the web server
22+
# gem 'unicorn'
23+
24+
# Deploy with Capistrano
25+
# gem 'capistrano'
26+
27+
# To use debugger
28+
gem 'ruby-debug19', :require => 'ruby-debug'
29+
gem 'haml'
30+
gem 'railroady'

Gemfile.lock

Lines changed: 32 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -30,45 +30,28 @@ GEM
3030
activesupport (= 3.1.0)
3131
activesupport (3.1.0)
3232
multi_json (~> 1.0)
33-
<<<<<<< HEAD
34-
addressable (2.2.6)
35-
=======
3633
archive-tar-minitar (0.5.2)
37-
>>>>>>> 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
3834
arel (2.2.1)
3935
bcrypt-ruby (3.0.1)
4036
builder (3.0.0)
41-
capybara (1.1.1)
42-
mime-types (>= 1.16)
43-
nokogiri (>= 1.3.3)
44-
rack (>= 1.0.0)
45-
rack-test (>= 0.5.4)
46-
selenium-webdriver (~> 2.0)
47-
xpath (~> 0.1.4)
48-
childprocess (0.2.2)
49-
ffi (~> 1.0.6)
37+
coffee-rails (3.1.1)
38+
coffee-script (>= 2.2.0)
39+
railties (~> 3.1.0)
40+
coffee-script (2.2.0)
41+
coffee-script-source
42+
execjs
43+
coffee-script-source (1.1.3)
5044
columnize (0.3.4)
51-
cucumber (1.1.0)
52-
builder (>= 2.1.2)
53-
diff-lcs (>= 1.1.2)
54-
gherkin (~> 2.5.0)
55-
json (>= 1.4.6)
56-
term-ansicolor (>= 1.0.6)
57-
cucumber-rails (1.1.1)
58-
capybara (>= 1.1.1)
59-
cucumber (>= 1.1.0)
60-
nokogiri (>= 1.5.0)
61-
deepopenstruct (0.1.2)
62-
diff-lcs (1.1.3)
6345
erubis (2.7.0)
64-
ffi (1.0.9)
65-
gherkin (2.5.4)
66-
json (>= 1.4.6)
46+
execjs (1.2.9)
47+
multi_json (~> 1.0)
6748
haml (3.1.3)
6849
hike (1.2.1)
6950
i18n (0.6.0)
51+
jquery-rails (1.0.18)
52+
railties (~> 3.0)
53+
thor (~> 0.14)
7054
json (1.6.1)
71-
json_pure (1.6.1)
7255
linecache19 (0.5.12)
7356
ruby_core_source (>= 0.1.4)
7457
mail (2.3.0)
@@ -77,8 +60,7 @@ GEM
7760
treetop (~> 1.4.8)
7861
mime-types (1.17.2)
7962
multi_json (1.0.3)
80-
nokogiri (1.5.0)
81-
polyglot (0.3.2)
63+
polyglot (0.3.3)
8264
rack (1.3.5)
8365
rack-cache (1.0.3)
8466
rack (>= 0.4)
@@ -88,6 +70,7 @@ GEM
8870
rack
8971
rack-test (0.6.1)
9072
rack (>= 1.0)
73+
railroady (1.0.2)
9174
rails (3.1.0)
9275
actionmailer (= 3.1.0)
9376
actionpack (= 3.1.0)
@@ -103,40 +86,9 @@ GEM
10386
rake (>= 0.8.7)
10487
rdoc (~> 3.4)
10588
thor (~> 0.14.6)
106-
<<<<<<< HEAD
107-
rake (0.9.2)
108-
rbx-require-relative (0.0.5)
109-
rcov (0.9.9)
110-
rdoc (3.9.4)
111-
=======
112-
rake (0.8.7)
89+
rake (0.9.2.2)
11390
rdoc (3.11)
11491
json (~> 1.4)
115-
>>>>>>> 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
116-
rspec (2.6.0)
117-
rspec-core (~> 2.6.0)
118-
rspec-expectations (~> 2.6.0)
119-
rspec-mocks (~> 2.6.0)
120-
rspec-core (2.6.4)
121-
rspec-expectations (2.6.0)
122-
diff-lcs (~> 1.1.2)
123-
rspec-mocks (2.6.0)
124-
rspec-rails (2.6.1)
125-
actionpack (~> 3.0)
126-
activesupport (~> 3.0)
127-
railties (~> 3.0)
128-
rspec (~> 2.6.0)
129-
<<<<<<< HEAD
130-
ruby-debug (0.10.4)
131-
columnize (>= 0.1)
132-
ruby-debug-base (~> 0.10.4.0)
133-
ruby-debug-base (0.10.4)
134-
linecache (>= 0.3)
135-
ruby-tmdb (0.2.1)
136-
addressable
137-
deepopenstruct (>= 0.1.2)
138-
json
139-
=======
14092
ruby-debug-base19 (0.11.25)
14193
columnize (>= 0.3.1)
14294
linecache19 (>= 0.5.11)
@@ -147,46 +99,37 @@ GEM
14799
ruby-debug-base19 (>= 0.11.19)
148100
ruby_core_source (0.1.5)
149101
archive-tar-minitar (>= 0.5.2)
150-
>>>>>>> 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
151-
rubyzip (0.9.4)
152-
selenium-webdriver (2.9.1)
153-
childprocess (>= 0.2.1)
154-
ffi (= 1.0.9)
155-
json_pure
156-
rubyzip
102+
sass (3.1.10)
103+
sass-rails (3.1.5)
104+
actionpack (~> 3.1.0)
105+
railties (~> 3.1.0)
106+
sass (~> 3.1.10)
107+
tilt (~> 1.3.2)
157108
sprockets (2.0.3)
158109
hike (~> 1.2)
159110
rack (~> 1.0)
160111
tilt (~> 1.1, != 1.3.0)
161112
sqlite3 (1.3.4)
162-
term-ansicolor (1.0.7)
163113
thor (0.14.6)
164114
tilt (1.3.3)
165115
treetop (1.4.10)
166116
polyglot
167117
polyglot (>= 0.3.1)
168-
tzinfo (0.3.30)
169-
xpath (0.1.4)
170-
nokogiri (~> 1.3)
118+
tzinfo (0.3.31)
119+
uglifier (1.1.0)
120+
execjs (>= 0.3.0)
121+
multi_json (>= 1.0.2)
171122

172123
PLATFORMS
173124
ruby
174125

175126
DEPENDENCIES
176-
capybara
177-
cucumber
178-
cucumber-rails
127+
coffee-rails (~> 3.1.0)
179128
haml
180-
rails (= 3.1)
181-
<<<<<<< HEAD
182-
rcov
183-
rspec-rails
184-
ruby-debug
185-
ruby-tmdb
186-
=======
187-
rake (= 0.8.7)
188-
rspec
189-
rspec-rails
129+
jquery-rails
130+
railroady
131+
rails (= 3.1.0)
190132
ruby-debug19
191-
>>>>>>> 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
192-
sqlite3 (~> 1.3.3)
133+
sass-rails (~> 3.1.0)
134+
sqlite3
135+
uglifier

README

Lines changed: 12 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
== RottenPotatoes for "Engineering Software for Cloud Computing"
2-
3-
This repo tracks the version of the RottenPotatoes teaching app used
4-
with the Fox & Patterson textbook "Engineering Software for Cloud
5-
Computing".
6-
7-
Different branches of the repo correspond to the code developed in
8-
different chapters of the book.
9-
10-
See the book for information on how to use this repo and what the
11-
branches are for.
12-
131
== Welcome to Rails
142

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

4028

41-
== Getting Started
42-
43-
NOTE: The steps below are for creating a new app. The initial version
44-
of RottenPotatoes was created with Rails 3.0.5 and Ruby 1.8.7 using the
45-
commands:
46-
47-
* <tt>rails new rottenpotatoes -J -T</tt>
48-
* <tt>cd rottenpotatoes</tt>
49-
* <tt>rails generate resource movie title:string rating:string description:text released_on:datetime</tt>
50-
* <tt>rake db:migrate</tt>
51-
* <tt>rails generate cucumber:install</tt>
52-
* <tt>rails generate rspec:install</tt>
53-
* <tt>rm public/index.html</tt>
54-
55-
and then filling in the basic code for the Movie model, views and controller.
56-
57-
1. At the command prompt, create a new Rails application:
58-
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
59-
60-
2. Change directory to <tt>myapp</tt> and start the web server:
61-
<tt>cd myapp; rails server</tt> (run with --help for options)
62-
63-
3. Go to http://localhost:3000/ and you'll see:
64-
"Welcome aboard: You're riding Ruby on Rails!"
65-
66-
4. Follow the guidelines to start developing your application. You can find
67-
the following resources handy:
68-
69-
* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
70-
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
71-
72-
73-
7429
== Getting Started
7530

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

13792
class WeblogController < ActionController::Base
13893
def index
139-
@posts = Post.find(:all)
94+
@posts = Post.all
14095
debugger
14196
end
14297
end
@@ -184,7 +139,7 @@ To reload your controllers and models after launching the console run
184139
<tt>reload!</tt>
185140

186141
More information about irb can be found at:
187-
link:http://www.rubycentral.com/pickaxe/irb.html
142+
link:http://www.rubycentral.org/pickaxe/irb.html
188143

189144

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

203158
|-- app
159+
| |-- assets
160+
| |-- images
161+
| |-- javascripts
162+
| `-- stylesheets
204163
| |-- controllers
205164
| |-- helpers
206165
| |-- mailers
@@ -217,9 +176,6 @@ The default directory structure of a generated Ruby on Rails application:
217176
| `-- tasks
218177
|-- log
219178
|-- public
220-
| |-- images
221-
| |-- javascripts
222-
| `-- stylesheets
223179
|-- script
224180
|-- test
225181
| |-- fixtures
@@ -233,11 +189,16 @@ The default directory structure of a generated Ruby on Rails application:
233189
| |-- sessions
234190
| `-- sockets
235191
`-- vendor
192+
|-- assets
193+
`-- stylesheets
236194
`-- plugins
237195

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

199+
app/assets
200+
Contains subdirectories for images, stylesheets, and JavaScript files.
201+
241202
app/controllers
242203
Holds controllers that should be named like weblogs_controller.rb for
243204
automated URL mapping. All controllers should descend from
@@ -282,8 +243,7 @@ lib
282243
the load path.
283244

284245
public
285-
The directory available for the web server. Contains subdirectories for
286-
images, stylesheets, and javascripts. Also contains the dispatchers and the
246+
The directory available for the web server. Also contains the dispatchers and the
287247
default HTML files. This should be set as the DOCUMENT_ROOT of your web
288248
server.
289249

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
#!/usr/bin/env rake
12
# Add your own tasks in files placed in lib/tasks ending in .rake,
23
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
34

45
require File.expand_path('../config/application', __FILE__)
5-
require 'rake'
66

77
Rottenpotatoes::Application.load_tasks

app/assets/images/rails.png

6.49 KB
Loading

app/assets/javascripts/application.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This is a manifest file that'll be compiled into including all the files listed below.
2+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3+
// be included in the compiled file accessible from http://example.com/assets/application.js
4+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5+
// the compiled file.
6+
//
7+
//= require jquery
8+
//= require jquery_ujs
9+
//= require_tree .
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
3+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4+
* the top of the compiled file, but it's generally better to create a new file per style scope.
5+
*= require_self
6+
*= require_tree .
7+
*/

0 commit comments

Comments
 (0)