Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update dummy_app to Rails 3.2

  • Loading branch information...
commit 8dae7078b54e9b197776d31425c092b7f28681d3 1 parent d3b313d
@sferik authored
Showing with 221 additions and 30 deletions.
  1. +15 −4 spec/dummy_app/.gitignore
  2. +9 −5 spec/dummy_app/Gemfile
  3. +1 −1  spec/dummy_app/Rakefile
  4. BIN  spec/dummy_app/app/assets/images/rails.png
  5. +15 −0 spec/dummy_app/app/assets/javascripts/application.js
  6. +13 −0 spec/dummy_app/app/assets/stylesheets/application.css
  7. +2 −0  spec/dummy_app/app/helpers/application_helper.rb
  8. 0  spec/dummy_app/app/mailers/.gitkeep
  9. 0  spec/dummy_app/app/models/.gitkeep
  10. +3 −2 spec/dummy_app/app/views/layouts/application.html.erb
  11. +20 −5 spec/dummy_app/config/application.rb
  12. +4 −1 spec/dummy_app/config/database.yml
  13. +11 −1 spec/dummy_app/config/environments/development.rb
  14. +19 −3 spec/dummy_app/config/environments/production.rb
  15. +5 −7 spec/dummy_app/config/environments/test.rb
  16. +5 −0 spec/dummy_app/config/initializers/inflections.rb
  17. +1 −1  spec/dummy_app/config/initializers/secret_token.rb
  18. +14 −0 spec/dummy_app/config/initializers/wrap_parameters.rb
  19. +2 −0  spec/dummy_app/doc/README_FOR_APP
  20. 0  spec/dummy_app/lib/assets/.gitkeep
  21. +26 −0 spec/dummy_app/public/404.html
  22. +26 −0 spec/dummy_app/public/422.html
  23. +25 −0 spec/dummy_app/public/500.html
  24. BIN  spec/dummy_app/public/favicon.ico
  25. +5 −0 spec/dummy_app/public/robots.txt
View
19 spec/dummy_app/.gitignore
@@ -1,4 +1,15 @@
-.bundle
-db/*.sqlite3
-log/*.log
-tmp/
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+#
+# If you find yourself ignoring temporary files generated by your text editor
+# or operating system, you probably want to add a global ignore instead:
+# git config --global core.excludesfile ~/.gitignore_global
+
+# Ignore bundler config
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
View
14 spec/dummy_app/Gemfile
@@ -1,6 +1,6 @@
-source 'http://rubygems.org'
+source 'https://rubygems.org'
-gem 'rails', '~> 3.1'
+gem 'rails', '~> 3.2'
gem 'devise', '~> 2.0'
gem 'rails_admin', :path => '../../'
gem 'mlb', '~> 0.5'
@@ -12,9 +12,13 @@ gem 'dragonfly'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
- gem 'sass-rails', '~> 3.1'
- gem 'coffee-rails', '~> 3.1'
- gem 'uglifier', '~> 1.0'
+ gem 'sass-rails', '~> 3.2'
+ gem 'coffee-rails', '~> 3.2'
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ # gem 'therubyracer'
+
+ gem 'uglifier', '>= 1.0.3'
end
group :development, :test do
View
2  spec/dummy_app/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'
DummyApp::Application.load_tasks
View
BIN  spec/dummy_app/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.
View
15 spec/dummy_app/app/assets/javascripts/application.js
@@ -0,0 +1,15 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
View
13 spec/dummy_app/app/assets/stylesheets/application.css
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * 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 .
+*/
View
2  spec/dummy_app/app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
View
0  spec/dummy_app/app/mailers/.gitkeep
No changes.
View
0  spec/dummy_app/app/models/.gitkeep
No changes.
View
5 spec/dummy_app/app/views/layouts/application.html.erb
@@ -2,8 +2,9 @@
<html>
<head>
<title>DummyApp</title>
- <%= stylesheet_link_tag :all %>
- <%= csrf_meta_tag %>
+ <%= stylesheet_link_tag "application", :media => "all" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
</head>
<body>
View
25 spec/dummy_app/config/application.rb
@@ -4,10 +4,13 @@
require 'devise'
require 'paperclip'
require 'carrierwave'
-# If you have a Gemfile, require the default gems, the ones in the
-# current environment and also include :assets gems if in development
-# or test environments.
-Bundler.require *Rails.groups(:assets) if defined?(Bundler)
+
+if defined?(Bundler)
+ # If you precompile assets before deploying to production, use this line
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
+ # If you want your assets lazily compiled in production, use this line
+ # Bundler.require(:default, :assets, Rails.env)
+end
module DummyApp
class Application < Rails::Application
@@ -39,9 +42,21 @@ class Application < Rails::Application
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
+ # Use SQL instead of Active Record's schema dumper when creating the database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Enforce whitelist mode for mass assignment.
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
+ # parameters by using an attr_accessible or attr_protected declaration.
+ # config.active_record.whitelist_attributes = true
+
# Enable the asset pipeline
config.assets.enabled = true
- config.autoload_paths += Dir["#{config.root}/app/models/**/"]
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
end
end
View
5 spec/dummy_app/config/database.yml
@@ -1,5 +1,8 @@
# SQLite version 3.x
-# gem i sqlite3
+# gem install sqlite3
+#
+# Ensure the SQLite 3 gem is defined in your Gemfile
+# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
View
12 spec/dummy_app/config/environments/development.rb
@@ -2,7 +2,7 @@
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
+ # every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
@@ -22,6 +22,16 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
+ # Raise exception on mass assignment protection for Active Record models
+ # config.active_record.mass_assignment_sanitizer = :strict
+
+ # Log the query plan for queries taking more than this (works
+ # with SQLite, MySQL, and PostgreSQL)
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
+
# Do not compress assets
config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
end
View
22 spec/dummy_app/config/environments/production.rb
@@ -14,9 +14,18 @@
# Compress JavaScripts and CSS
config.assets.compress = true
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs
+ config.assets.digest = true
+
+ # Defaults to Rails.root.join("public/assets")
+ # config.assets.manifest = YOUR_PATH
+
# Specifies the header that your server uses for sending files
- # (comment out if your front-end server doesn't support this)
- config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
@@ -24,8 +33,11 @@
# See everything in the log (default is :info)
# config.log_level = :debug
+ # Prepend all log lines with the following tags
+ # config.log_tags = [ :subdomain, :uuid ]
+
# Use a different logger for distributed setups
- # config.logger = SyslogLogger.new
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
# config.cache_store = :mem_cache_store
@@ -48,4 +60,8 @@
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
+
+ # Log the query plan for queries taking more than this (works
+ # with SQLite, MySQL, and PostgreSQL)
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
end
View
12 spec/dummy_app/config/environments/test.rb
@@ -2,9 +2,9 @@
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
- # test suite. You never need to work with it otherwise. Remember that
+ # test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
- # and recreated between test runs. Don't rely on the data there!
+ # and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Configure static asset server for tests with Cache-Control for performance
@@ -19,7 +19,7 @@
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
- config.action_dispatch.show_exceptions = true
+ # config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
@@ -29,10 +29,8 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Use SQL instead of Active Record's schema dumper when creating the test database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
View
5 spec/dummy_app/config/initializers/inflections.rb
@@ -8,3 +8,8 @@
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
+#
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.acronym 'RESTful'
+# end
View
2  spec/dummy_app/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-DummyApp::Application.config.secret_token = '2e733773e594846c6bb87fe0d0bb8e70ea81d334fccdbceca5b05ede2e61f10ea98add53783bf333d8d5523e001f4d7045d71c57ab288e279626c49b18810f9e'
+DummyApp::Application.config.secret_token = 'e05799a4d22b29ad6cef7cc8c423f610f2d694327aae568d7112801f2f0ef6be3c9c9e056358f7a969be7a8a9a33351261d12bb0a25a7645aa1982c39a3b2a72'
View
14 spec/dummy_app/config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters :format => [:json]
+end
+
+# Disable root element in JSON by default.
+ActiveSupport.on_load(:active_record) do
+ self.include_root_in_json = false
+end
View
2  spec/dummy_app/doc/README_FOR_APP
@@ -0,0 +1,2 @@
+Use this README file to introduce your application and point to useful places in the API for learning more.
+Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
View
0  spec/dummy_app/lib/assets/.gitkeep
No changes.
View
26 spec/dummy_app/public/404.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The page you were looking for doesn't exist (404)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>The page you were looking for doesn't exist.</h1>
+ <p>You may have mistyped the address or the page may have moved.</p>
+ </div>
+</body>
+</html>
View
26 spec/dummy_app/public/422.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The change you wanted was rejected (422)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/422.html -->
+ <div class="dialog">
+ <h1>The change you wanted was rejected.</h1>
+ <p>Maybe you tried to change something you didn't have access to.</p>
+ </div>
+</body>
+</html>
View
25 spec/dummy_app/public/500.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>We're sorry, but something went wrong (500)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/500.html -->
+ <div class="dialog">
+ <h1>We're sorry, but something went wrong.</h1>
+ </div>
+</body>
+</html>
View
BIN  spec/dummy_app/public/favicon.ico
Binary file not shown
View
5 spec/dummy_app/public/robots.txt
@@ -0,0 +1,5 @@
+# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
+#
+# To ban all spiders from the entire site uncomment the next two lines:
+# User-Agent: *
+# Disallow: /
Please sign in to comment.
Something went wrong with that request. Please try again.