-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
237 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
--color | ||
--drb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
require 'active_support/core_ext' | ||
|
||
guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' } do | ||
watch('config/application.rb') | ||
watch('config/environment.rb') | ||
watch(%r{^config/environments/.+\.rb$}) | ||
watch(%r{^config/initializers/.+\.rb$}) | ||
watch('Gemfile') | ||
watch('Gemfile.lock') | ||
watch('spec/spec_helper.rb') | ||
watch('test/test_helper.rb') | ||
watch('spec/support/') | ||
end | ||
|
||
guard 'rspec', :version => 2, :all_after_pass => false, :cli => '--drb' do | ||
watch(%r{^spec/.+_spec\.rb$}) | ||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | ||
watch('spec/spec_helper.rb') { "spec" } | ||
|
||
# Rails example | ||
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | ||
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } | ||
watch(%r{^spec/support/(.+)\.rb$}) { "spec" } | ||
watch('config/routes.rb') { "spec/routing" } | ||
watch('app/controllers/application_controller.rb') { "spec/controllers" } | ||
|
||
# Capybara request specs | ||
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" } | ||
|
||
# Turnip features and steps | ||
watch(%r{^spec/acceptance/(.+)\.feature$}) | ||
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } | ||
|
||
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m| | ||
["spec/routing/#{m[1]}_routing_spec.rb", | ||
"spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", | ||
"spec/acceptance/#{m[1]}_spec.rb", | ||
(m[1][/_pages/] ? "spec/requests/#{m[1]}_spec.rb" : | ||
"spec/requests/#{m[1].singularize}_pages_spec.rb")] | ||
end | ||
watch(%r{^app/views/(.+)/}) do |m| | ||
(m[1][/_pages/] ? "spec/requests/#{m[1]}_spec.rb" : | ||
"spec/requests/#{m[1].singularize}_pages_spec.rb") | ||
end | ||
end | ||
|
||
|
||
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do | ||
watch('config/application.rb') | ||
watch('config/environment.rb') | ||
watch('config/environments/test.rb') | ||
watch(%r{^config/initializers/.+\.rb$}) | ||
watch('Gemfile') | ||
watch('Gemfile.lock') | ||
watch('spec/spec_helper.rb') { :rspec } | ||
watch('test/test_helper.rb') { :test_unit } | ||
watch(%r{features/support/}) { :cucumber } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
module ApplicationHelper | ||
|
||
# Returns the full title on a per-page basis | ||
def full_title(page_title) | ||
# Set the base title | ||
base_title = "Ruby on Rails Tutorial Sample App" | ||
|
||
# Check if a title was NOT specified on the page | ||
if page_title.empty? | ||
# It wasn't, so set the full title to the base | ||
# title | ||
return base_title | ||
else # A title was specified on the page | ||
# Concatenate the base title with the page's | ||
# title | ||
return "#{base_title} | #{page_title}" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<% provide(:title, 'Home') %> | ||
<h1>Sample App</h1> | ||
<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> | ||
<p> This is the home page for the <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a> sample application. | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters