Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: icedvl/sample_app
base: c881897a35
...
head fork: icedvl/sample_app
compare: ed805b1d6d
  • 3 commits
  • 35 files changed
  • 0 commit comments
  • 1 contributor
Showing with 461 additions and 12 deletions.
  1. +2 −0  .autotest
  2. +2 −0  Gemfile
  3. +8 −0 Gemfile.lock
  4. +3 −0  app/assets/javascripts/pages.js.coffee
  5. +3 −0  app/assets/stylesheets/pages.css.scss
  6. +14 −0 app/controllers/pages_controller.rb
  7. +2 −0  app/helpers/pages_helper.rb
  8. BIN  app/views/layouts/.DS_Store
  9. +8 −12 app/views/layouts/application.html.erb
  10. +7 −0 app/views/pages/about.html.erb
  11. +5 −0 app/views/pages/contact.html.erb
  12. +6 −0 app/views/pages/home.html.erb
  13. +16 −0 bin/autospec
  14. +16 −0 bin/erubis
  15. +16 −0 bin/htmldiff
  16. +16 −0 bin/ldiff
  17. +16 −0 bin/nokogiri
  18. +16 −0 bin/rackup
  19. +16 −0 bin/rails
  20. +16 −0 bin/rake
  21. +16 −0 bin/rake2thor
  22. +16 −0 bin/rdoc
  23. +16 −0 bin/ri
  24. +16 −0 bin/rspec
  25. +16 −0 bin/sass
  26. +16 −0 bin/sass-convert
  27. +16 −0 bin/scss
  28. +16 −0 bin/spork
  29. +16 −0 bin/thor
  30. +16 −0 bin/tilt
  31. +16 −0 bin/tt
  32. +6 −0 config/routes.rb
  33. +16 −0 db/schema.rb
  34. +46 −0 spec/controllers/pages_controller_spec.rb
  35. +29 −0 spec/spec_helper.rb
View
2  .autotest
@@ -0,0 +1,2 @@
+require 'autotest/growl'
+require 'autotest/fsevent'
View
2  Gemfile
@@ -9,10 +9,12 @@ gem 'sqlite3'
group :development do
gem 'rspec-rails'
+ gem 'webrat'
end
group :test do
gem 'rspec-rails'
+ gem 'spork', '0.8.4'
end
# Gems used only for assets and not required
View
8 Gemfile.lock
@@ -54,6 +54,7 @@ GEM
treetop (~> 1.4.8)
mime-types (1.18)
multi_json (1.3.4)
+ nokogiri (1.5.2)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
@@ -98,6 +99,7 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
+ spork (0.8.4)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -112,6 +114,10 @@ GEM
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
+ webrat (0.7.3)
+ nokogiri (>= 1.2.0)
+ rack (>= 1.0)
+ rack-test (>= 0.5.3)
PLATFORMS
ruby
@@ -122,5 +128,7 @@ DEPENDENCIES
rails (= 3.2.3)
rspec-rails
sass-rails (~> 3.2.3)
+ spork (= 0.8.4)
sqlite3
uglifier (>= 1.0.3)
+ webrat
View
3  app/assets/javascripts/pages.js.coffee
@@ -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/
View
3  app/assets/stylesheets/pages.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the Pages controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
14 app/controllers/pages_controller.rb
@@ -0,0 +1,14 @@
+class PagesController < ApplicationController
+
+ def home
+ @title = "Home"
+ end
+
+ def contact
+ @title = "Contact"
+ end
+
+ def about
+ @title = "About"
+ end
+end
View
2  app/helpers/pages_helper.rb
@@ -0,0 +1,2 @@
+module PagesHelper
+end
View
BIN  app/views/layouts/.DS_Store
Binary file not shown
View
20 app/views/layouts/application.html.erb
@@ -1,14 +1,10 @@
<!DOCTYPE html>
<html>
-<head>
- <title>SampleApp</title>
- <%= stylesheet_link_tag "application", :media => "all" %>
- <%= javascript_include_tag "application" %>
- <%= csrf_meta_tags %>
-</head>
-<body>
-
-<%= yield %>
-
-</body>
-</html>
+ <head>
+ <title>Ruby on Rails Tutorial Sample App | <%= @title %></title>
+ <%= csrf_meta_tag %>
+ </head>
+ <body>
+ <%= yield %>
+ </body>
+</html>
View
7 app/views/pages/about.html.erb
@@ -0,0 +1,7 @@
+<h1>About Us</h1>
+<p>
+ <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
+ is a project to make a book and screencasts to teach web development
+ with <a href="http://rubyonrails.org/">Ruby on Rails</a>. This
+ is the sample application for the tutorial.
+</p>
View
5 app/views/pages/contact.html.erb
@@ -0,0 +1,5 @@
+<h1>Contact</h1>
+<p>
+ Contact Ruby on Rails Tutorial about the sample app at the
+ <a href="http://railstutorial.org/feedback">feedback page</a>.
+</p>
View
6 app/views/pages/home.html.erb
@@ -0,0 +1,6 @@
+<h1>Sample App</h1>
+<p>
+ This is the home page for the
+ <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
+ sample application.
+</p>
View
16 bin/autospec
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'autospec' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('rspec-core', 'autospec')
View
16 bin/erubis
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'erubis' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('erubis', 'erubis')
View
16 bin/htmldiff
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'htmldiff' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('diff-lcs', 'htmldiff')
View
16 bin/ldiff
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'ldiff' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('diff-lcs', 'ldiff')
View
16 bin/nokogiri
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'nokogiri' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('nokogiri', 'nokogiri')
View
16 bin/rackup
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rackup' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('rack', 'rackup')
View
16 bin/rails
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rails' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('railties', 'rails')
View
16 bin/rake
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rake' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('rake', 'rake')
View
16 bin/rake2thor
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rake2thor' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('thor', 'rake2thor')
View
16 bin/rdoc
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rdoc' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('rdoc', 'rdoc')
View
16 bin/ri
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'ri' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('rdoc', 'ri')
View
16 bin/rspec
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rspec' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('rspec-core', 'rspec')
View
16 bin/sass
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'sass' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('sass', 'sass')
View
16 bin/sass-convert
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'sass-convert' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('sass', 'sass-convert')
View
16 bin/scss
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'scss' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('sass', 'scss')
View
16 bin/spork
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'spork' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('spork', 'spork')
View
16 bin/thor
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'thor' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('thor', 'thor')
View
16 bin/tilt
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'tilt' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('tilt', 'tilt')
View
16 bin/tt
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'tt' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('treetop', 'tt')
View
6 config/routes.rb
@@ -1,4 +1,10 @@
SampleApp::Application.routes.draw do
+ get "pages/home"
+
+ get "pages/contact"
+
+ get "pages/about"
+
# The priority is based upon order of creation:
# first created -> highest priority.
View
16 db/schema.rb
@@ -0,0 +1,16 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 0) do
+
+end
View
46 spec/controllers/pages_controller_spec.rb
@@ -0,0 +1,46 @@
+require 'spec_helper'
+
+describe PagesController do
+ render_views
+
+ describe "GET 'home'" do
+ it "should be successful" do
+ get 'home'
+ response.should be_success
+ end
+
+ it "should have the right title" do
+ get 'home'
+ response.should have_selector("title",
+ :content => "Ruby on Rails Tutorial Sample App | Home")
+ end
+ end
+
+ describe "GET 'contact'" do
+ it "should be successful" do
+ get 'contact'
+ response.should be_success
+ end
+
+ it "should have the right title" do
+ get 'contact'
+ response.should have_selector("title",
+ :content =>
+ "Ruby on Rails Tutorial Sample App | Contact")
+ end
+ end
+
+ describe "GET 'about'" do
+ it "should be successful" do
+ get 'about'
+ response.should be_success
+ end
+
+ it "should have the right title" do
+ get 'about'
+ response.should have_selector("title",
+ :content =>
+ "Ruby on Rails Tutorial Sample App | About")
+ end
+ end
+end
View
29 spec/spec_helper.rb
@@ -1,3 +1,32 @@
+require 'rubygems'
+require 'spork'
+
+Spork.prefork do
+ # Loading more in this block will cause your tests to run faster. However,
+ # if you change any configuration or code from libraries loaded here, you'll
+ # need to restart spork for it take effect.
+
+end
+
+Spork.each_run do
+ # This code will be run each time you run your specs.
+
+end
+
+# --- Instructions ---
+# - Sort through your spec_helper file. Place as much environment loading
+# code that you don't normally modify during development in the
+# Spork.prefork block.
+# - Place the rest under Spork.each_run block
+# - Any code that is left outside of the blocks will be ran during preforking
+# and during each_run!
+# - These instructions should self-destruct in 10 seconds. If they don't,
+# feel free to delete them.
+#
+
+
+
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)

No commit comments for this range

Something went wrong with that request. Please try again.