Permalink
Browse files

Created Suspenders Rails 3 app with jQuery, RSpec, Sass, and other go…

…odies.
  • Loading branch information...
0 parents commit 205eb34113f58fa0f6f99d5d6130a245dad82428 @croaky croaky committed Nov 1, 2010
Showing with 4,063 additions and 0 deletions.
  1. +14 −0 .gitignore
  2. +1 −0 .rspec
  3. +23 −0 .trout
  4. +35 −0 Gemfile
  5. +190 −0 Gemfile.lock
  6. +7 −0 Rakefile
  7. +4 −0 app/controllers/application_controller.rb
  8. +2 −0 app/helpers/application_helper.rb
  9. +7 −0 app/helpers/body_class_helper.rb
  10. 0 app/models/.gitkeep
  11. +3 −0 app/models/user.rb
  12. +22 −0 app/views/layouts/application.html.erb
  13. 0 app/views/pages/.gitkeep
  14. +5 −0 app/views/shared/_flashes.html.erb
  15. +2 −0 app/views/shared/_javascript.html.erb
  16. +2 −0 autotest/discover.rb
  17. +4 −0 config.ru
  18. +45 −0 config/application.rb
  19. +13 −0 config/boot.rb
  20. +8 −0 config/cucumber.yml
  21. +15 −0 config/database.yml
  22. +5 −0 config/environment.rb
  23. +28 −0 config/environments/development.rb
  24. +51 −0 config/environments/production.rb
  25. +51 −0 config/environments/staging.rb
  26. +37 −0 config/environments/test.rb
  27. +7 −0 config/initializers/backtrace_silencers.rb
  28. +3 −0 config/initializers/clearance.rb
  29. +26 −0 config/initializers/errors.rb
  30. +10 −0 config/initializers/inflections.rb
  31. +5 −0 config/initializers/mime_types.rb
  32. +7 −0 config/initializers/secret_token.rb
  33. +8 −0 config/initializers/session_store.rb
  34. +5 −0 config/initializers/time_formats.rb
  35. +5 −0 config/locales/en.yml
  36. +60 −0 config/routes.rb
  37. 0 db/migrate/.gitkeep
  38. +20 −0 db/migrate/20101101034624_clearance_create_users.rb
  39. +7 −0 db/seeds.rb
  40. +2 −0 doc/README_FOR_APP
  41. +166 −0 doc/README_FOR_SUSPENDERS
  42. +33 −0 features/password_reset.feature
  43. +35 −0 features/sign_in.feature
  44. +15 −0 features/sign_out.feature
  45. +45 −0 features/sign_up.feature
  46. +133 −0 features/step_definitions/clearance_steps.rb
  47. +1 −0 features/step_definitions/factory_girl_steps.rb
  48. +219 −0 features/step_definitions/web_steps.rb
  49. +59 −0 features/support/env.rb
  50. +39 −0 features/support/paths.rb
  51. 0 lib/tasks/.gitkeep
  52. +53 −0 lib/tasks/cucumber.rake
  53. 0 log/.gitkeep
  54. +26 −0 public/404.html
  55. +26 −0 public/422.html
  56. +26 −0 public/500.html
  57. 0 public/favicon.ico
  58. +458 −0 public/flutie/stylesheets/flutie.css
  59. +95 −0 public/flutie/stylesheets/sass/_defaults.scss
  60. +191 −0 public/flutie/stylesheets/sass/_forms.scss
  61. +40 −0 public/flutie/stylesheets/sass/_lists.scss
  62. +53 −0 public/flutie/stylesheets/sass/_reset.scss
  63. 0 public/flutie/stylesheets/sass/_screen.scss
  64. +35 −0 public/flutie/stylesheets/sass/_tables.scss
  65. +137 −0 public/flutie/stylesheets/sass/_type.scss
  66. +7 −0 public/flutie/stylesheets/sass/flutie.scss
  67. 0 public/images/.gitkeep
  68. 0 public/javascripts/.gitkeep
  69. 0 public/javascripts/application.js
  70. +1,012 −0 public/javascripts/jquery-ui.js
  71. +154 −0 public/javascripts/jquery.js
  72. +59 −0 public/javascripts/prefilled_input.js
  73. +146 −0 public/javascripts/rails.js
  74. +5 −0 public/robots.txt
  75. 0 public/stylesheets/.gitkeep
  76. 0 public/stylesheets/sass/screen.scss
  77. 0 public/stylesheets/screen.css
  78. +10 −0 script/cucumber
  79. +6 −0 script/rails
  80. +13 −0 spec/factories/clearance.rb
  81. +27 −0 spec/spec_helper.rb
  82. 0 spec/support/.gitkeep
  83. 0 vendor/plugins/.gitkeep
@@ -0,0 +1,14 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/**/*
+db/schema.rb
+public/system
+*.DS_Store
+coverage/*
+*.swp
+rerun.txt
+tags
+!.keep
+vendor/bundler_gems
+.rvmrc
1 .rspec
@@ -0,0 +1 @@
+--colour
23 .trout
@@ -0,0 +1,23 @@
+---
+:files:
+ public/javascripts/jquery.js:
+ :git_url: git://github.com/thoughtbot/suspenders-gem.git
+ :version: 544dc2799dbb07b9ffcf00b87365819ff641c23b
+ :source_root: template/trout
+ :filename: public/javascripts/jquery.js
+ public/javascripts/prefilled_input.js:
+ :git_url: git://github.com/thoughtbot/suspenders-gem.git
+ :version: 544dc2799dbb07b9ffcf00b87365819ff641c23b
+ :source_root: template/trout
+ :filename: public/javascripts/prefilled_input.js
+ Gemfile:
+ :version: 544dc2799dbb07b9ffcf00b87365819ff641c23b
+ :git_url: git://github.com/thoughtbot/suspenders-gem.git
+ :source_root: template/trout
+ :filename: Gemfile
+ public/javascripts/jquery-ui.js:
+ :version: 544dc2799dbb07b9ffcf00b87365819ff641c23b
+ :git_url: git://github.com/thoughtbot/suspenders-gem.git
+ :source_root: template/trout
+ :filename: public/javascripts/jquery-ui.js
+:version: "1.0"
35 Gemfile
@@ -0,0 +1,35 @@
+source :rubygems
+
+gem "rails", ">= 3.0"
+gem "rack"
+gem "clearance", "0.9.0.rc9"
+gem "haml"
+gem "high_voltage"
+gem "hoptoad_notifier"
+gem "RedCloth", :require => "redcloth"
+gem "paperclip"
+gem "will_paginate"
+gem "formtastic"
+gem "mysql"
+gem "flutie"
+gem "dynamic_form"
+
+# http://blog.davidchelimsky.net/2010/07/11/rspec-rails-2-generators-and-rake-tasks/
+group :development, :test, :cucumber do
+ gem "rspec-rails", "~> 2.0.0"
+ gem "ruby-debug"
+end
+
+group :test, :cucumber do
+ gem "cucumber-rails"
+ gem "factory_girl_rails"
+ gem "bourne"
+ gem "capybara"
+ gem "database_cleaner"
+ gem "fakeweb"
+ gem "nokogiri"
+ gem "timecop"
+ gem "treetop"
+ gem "shoulda"
+ gem "launchy"
+end
@@ -0,0 +1,190 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ RedCloth (4.2.3)
+ abstract (1.0.0)
+ actionmailer (3.0.1)
+ actionpack (= 3.0.1)
+ mail (~> 2.2.5)
+ actionpack (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4.1)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.12)
+ rack-test (~> 0.5.4)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.1)
+ activesupport (= 3.0.1)
+ builder (~> 2.1.2)
+ i18n (~> 0.4.1)
+ activerecord (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ arel (~> 1.0.0)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ activesupport (3.0.1)
+ arel (1.0.1)
+ activesupport (~> 3.0.0)
+ bourne (1.0)
+ mocha (= 0.9.8)
+ builder (2.1.2)
+ capybara (0.4.0)
+ celerity (>= 0.7.9)
+ culerity (>= 0.2.4)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (>= 0.0.27)
+ xpath (~> 0.1.2)
+ celerity (0.8.2)
+ childprocess (0.1.3)
+ ffi (~> 0.6.3)
+ clearance (0.9.0.rc9)
+ rails (~> 3.0.0)
+ columnize (0.3.1)
+ configuration (1.1.0)
+ cucumber (0.9.3)
+ builder (~> 2.1.2)
+ diff-lcs (~> 1.1.2)
+ gherkin (~> 2.2.9)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ cucumber-rails (0.3.2)
+ cucumber (>= 0.8.0)
+ culerity (0.2.12)
+ database_cleaner (0.6.0)
+ diff-lcs (1.1.2)
+ dynamic_form (1.1.3)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ factory_girl (1.3.2)
+ factory_girl_rails (1.0)
+ factory_girl (~> 1.3)
+ rails (>= 3.0.0.beta4)
+ fakeweb (1.3.0)
+ ffi (0.6.3)
+ rake (>= 0.8.7)
+ flutie (1.1.1)
+ formtastic (1.1.0)
+ actionpack (>= 2.3.0)
+ activesupport (>= 2.3.0)
+ i18n (>= 0.4.0)
+ gherkin (2.2.9)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ haml (3.0.23)
+ high_voltage (0.9.2)
+ hoptoad_notifier (2.3.11)
+ activesupport
+ builder
+ i18n (0.4.2)
+ json (1.4.6)
+ json_pure (1.4.6)
+ launchy (0.3.7)
+ configuration (>= 0.0.5)
+ rake (>= 0.8.1)
+ linecache (0.43)
+ mail (2.2.9)
+ activesupport (>= 2.3.6)
+ i18n (~> 0.4.1)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ mocha (0.9.8)
+ rake
+ mysql (2.8.1)
+ nokogiri (1.4.3.1)
+ paperclip (2.3.5)
+ activerecord
+ activesupport
+ polyglot (0.3.1)
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-test (0.5.6)
+ rack (>= 1.0)
+ rails (3.0.1)
+ actionmailer (= 3.0.1)
+ actionpack (= 3.0.1)
+ activerecord (= 3.0.1)
+ activeresource (= 3.0.1)
+ activesupport (= 3.0.1)
+ bundler (~> 1.0.0)
+ railties (= 3.0.1)
+ railties (3.0.1)
+ actionpack (= 3.0.1)
+ activesupport (= 3.0.1)
+ rake (>= 0.8.4)
+ thor (~> 0.14.0)
+ rake (0.8.7)
+ rspec (2.0.1)
+ rspec-core (~> 2.0.1)
+ rspec-expectations (~> 2.0.1)
+ rspec-mocks (~> 2.0.1)
+ rspec-core (2.0.1)
+ rspec-expectations (2.0.1)
+ diff-lcs (>= 1.1.2)
+ rspec-mocks (2.0.1)
+ rspec-core (~> 2.0.1)
+ rspec-expectations (~> 2.0.1)
+ rspec-rails (2.0.1)
+ rspec (~> 2.0.0)
+ ruby-debug (0.10.3)
+ columnize (>= 0.1)
+ ruby-debug-base (~> 0.10.3.0)
+ ruby-debug-base (0.10.3)
+ linecache (>= 0.3)
+ rubyzip (0.9.4)
+ selenium-webdriver (0.0.29)
+ childprocess (>= 0.0.7)
+ ffi (~> 0.6.3)
+ json_pure
+ rubyzip
+ shoulda (2.11.3)
+ term-ansicolor (1.0.5)
+ thor (0.14.3)
+ timecop (0.3.5)
+ treetop (1.4.8)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.23)
+ will_paginate (2.3.15)
+ xpath (0.1.2)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ RedCloth
+ bourne
+ capybara
+ clearance (= 0.9.0.rc9)
+ cucumber-rails
+ database_cleaner
+ dynamic_form
+ factory_girl_rails
+ fakeweb
+ flutie
+ formtastic
+ haml
+ high_voltage
+ hoptoad_notifier
+ launchy
+ mysql
+ nokogiri
+ paperclip
+ rack
+ rails (>= 3.0)
+ rspec-rails (~> 2.0.0)
+ ruby-debug
+ shoulda
+ timecop
+ treetop
+ will_paginate
@@ -0,0 +1,7 @@
+# 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'
+
+Dddd::Application.load_tasks
@@ -0,0 +1,4 @@
+class ApplicationController < ActionController::Base
+ include Clearance::Authentication
+ protect_from_forgery
+end
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
@@ -0,0 +1,7 @@
+module BodyClassHelper
+ # TODO: move this into a gem/plugin
+ def body_class
+ qualified_controller_name = controller.controller_path.gsub('/','-')
+ "#{qualified_controller_name} #{qualified_controller_name}-#{controller.action_name}"
+ end
+end
No changes.
@@ -0,0 +1,3 @@
+class User < ActiveRecord::Base
+ include Clearance::User
+end
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title>dddd</title>
+ <%= stylesheet_link_tag :flutie, 'screen', :media => 'all', :cache => true %>
+ <%= javascript_include_tag "jquery", "jquery-ui", "prefilled_input", "rails", "application", :cache => true %>
+ <%= csrf_meta_tag %>
+</head>
+<body class="<%= body_class %>">
+ <div id="header">
+ <% if signed_in? -%>
+ <%= link_to "Sign out", sign_out_path, :method => :delete %>
+ <% else -%>
+ <%= link_to "Sign in", sign_in_path %>
+ <% end -%>
+ </div>
+ <%= render :partial => 'shared/flashes' -%>
+ <%= yield %>
+ <%= render :partial => 'shared/javascript' %>
+</body>
+</html>
No changes.
@@ -0,0 +1,5 @@
+<div id="flash">
+ <% flash.each do |key, value| -%>
+ <div id="flash_<%= key %>"><%=h value %></div>
+ <% end -%>
+</div>
@@ -0,0 +1,2 @@
+<%= javascript_include_tag 'jquery', 'jquery-ui', 'prefilled_input', :cache => true %>
+<%= yield :javascript %>
@@ -0,0 +1,2 @@
+Autotest.add_discovery { "rails" }
+Autotest.add_discovery { "rspec2" }
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Dddd::Application
@@ -0,0 +1,45 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+module Dddd
+ class Application < Rails::Application
+ config.generators do |generate|
+ generate.test_framework :rspec
+ end
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # JavaScript files you want as :defaults (application.js is always included).
+ config.action_view.javascript_expansions[:defaults] = %w()
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+ end
+end
@@ -0,0 +1,13 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+gemfile = File.expand_path('../../Gemfile', __FILE__)
+begin
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+rescue Bundler::GemNotFound => e
+ STDERR.puts e.message
+ STDERR.puts "Try running `bundle install`."
+ exit!
+end if File.exist?(gemfile)
Oops, something went wrong.

0 comments on commit 205eb34

Please sign in to comment.