Permalink
Browse files

Regenerate app with "rails new gocool -T" using rails 3.2.3 and merge…

… changes
  • Loading branch information...
gcao committed May 4, 2012
1 parent 2bf5b66 commit d82e24d6aaaa1f7e9cb10af83a82fec90d2758c7
View
@@ -1,6 +0,0 @@
-[submodule "vendor/plugins/active_scaffold"]
- path = vendor/plugins/active_scaffold
- url = git://github.com/activescaffold/active_scaffold.git
-[submodule "vendor/plugins/discuz_int"]
- path = vendor/plugins/discuz_int
- url = git://github.com/gcao/discuz_int.git
View
11 Gemfile
@@ -1,7 +1,8 @@
-source "http://rubygems.org"
+source 'https://rubygems.org'
# bundler requires these gems in all environments
gem "rails", "~>3.2.0"
+gem 'jquery-rails'
gem "mysql2"
gem "json"
# gem "calendar_date_select"
@@ -63,3 +64,11 @@ group :production do
# gem "rubaidh-google_analytics"
end
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
View
@@ -18,7 +18,7 @@ GIT
sgf_parser (0.1.0)
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
SyslogLogger (1.4.1)
aasm (3.0.5)
@@ -91,6 +91,9 @@ GEM
builder
i18n (0.6.0)
journey (1.0.3)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
json (1.7.0)
mail (2.4.4)
i18n (>= 0.4.0)
@@ -190,6 +193,7 @@ DEPENDENCIES
guard-shell
haml (~> 3.1.0)
hoptoad_notifier
+ jquery-rails
json
mocha
mysql2
View
@@ -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'
Gocool::Application.load_tasks
@@ -1,4 +1,5 @@
-//= require jquery-1.2.6
+//= require jquery
+//= require jquery_ujs
//= require jqueryslidemenu.js
//= require jquery.autocomplete.js
//= require jquery.livequery.js
@@ -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 .
+*/
@@ -1,4 +1,4 @@
-!!! transitional
+!!! html
%html
%head
%meta(http-equiv="content-type" content="text/html;charset=UTF-8")
@@ -10,6 +10,7 @@
/[if IE]
= stylesheet_link_tag 'ie.css'
+ = csrf_meta_tags
= yield :head
%body.bp
= render 'discuz/header'
View
@@ -39,16 +39,22 @@ class Application < Rails::Application
# 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(jquery rails)
-
# 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]
- # config.action_controller.relative_url_root = "/app"
+ # 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
View
@@ -1,13 +1,6 @@
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)
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -1,25 +1,33 @@
Gocool::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+ # 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
- # since you don't have to restart the webserver when you make code changes.
+ # 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
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
-
- config.active_support.deprecation = :log
# Show full error reports and disable caching
+ config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
- # config.middleware.use "Rack::Bug",
- # :secret_key => "epT5uCIchlsHCeR9dloOeAPG66PtHd9K8l0q9avitiaA/KUrY7DE52hD4yWY+8z1",
- # :password => "admin"
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # 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
@@ -1,33 +1,12 @@
Gocool::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+ # Settings specified here will take precedence over those in config/application.rb
- # The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
- config.action_controller.perform_caching = true
-
- # See everything in the log (default is :info)
- # config.log_level = :debug
-
- # Use a different logger for distributed setups
- config.logger = SyslogLogger.new 'gocool'
-
- # Use a different cache store in production
- # config.cache_store = :mem_cache_store
-
- # Enable serving of images, stylesheets, and javascripts from an asset server
- #config.action_controller.asset_host = "http://assets%d.go-cool.org"
-
- # Disable delivery errors, bad email addresses will be ignored
- # config.action_mailer.raise_delivery_errors = false
-
- # Enable threaded mode
- # config.threadsafe!
-
- # require 'syslog_logger'
- # RAILS_DEFAULT_LOGGER = SyslogLogger.new
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
@@ -36,14 +15,33 @@
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
- config.assets.compile = true
+ 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
+ # 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
+
+ # 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 = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
@@ -54,7 +52,21 @@
config.action_mailer.raise_delivery_errors = true
ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.sendmail_settings = {
- :location => '/usr/sbin/sendmail',
- :arguments => '-i -t'
+ :location => '/usr/sbin/sendmail',
+ :arguments => '-i -t'
}
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # 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
@@ -1,26 +1,37 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Gocool::Application.configure do
+ # 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
-# 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!
-config.cache_classes = false
+ # The test environment is used exclusively to run your application's
+ # 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!
+ config.cache_classes = true
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
+ # Configure static asset server for tests with Cache-Control for performance
+ config.serve_static_assets = true
+ config.static_cache_control = "public, max-age=3600"
-# Show full error reports and disable caching
-config.action_controller.perform_caching = false
+ # Log error messages when you accidentally call methods on nil
+ config.whiny_nils = true
-# Disable request forgery protection in test environment
-config.action_controller.allow_forgery_protection = false
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
-# Tell Action Mailer not to deliver emails to the real world.
-# The :test delivery method accumulates sent emails in the
-# ActionMailer::Base.deliveries array.
-config.action_mailer.delivery_method = :test
+ # Raise exceptions instead of rendering exception templates
+ config.action_dispatch.show_exceptions = false
-# 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
+ # Disable request forgery protection in test environment
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # 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
+end
@@ -3,5 +3,5 @@
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
@@ -1,10 +1,15 @@
# Be sure to restart your server when you modify this file.
-# Add new inflection rules using the following format
+# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# 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
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# 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.
+Gocool::Application.config.secret_token = '5d7c0840a2fd75f724790185b2051cfc40e19a12a92cd64afcec7535290817dea31c7220025b1e2ca09f17a0e157a972ee35ec70dc1c2f7db9bd79a11f4def43'
@@ -1,9 +1,8 @@
# Be sure to restart your server when you modify this file.
Gocool::Application.config.session_store :cookie_store, :key => '_gocool_session'
-Gocool::Application.config.secret_token = '3ab0ef9713356fa8d08424c770584d95ad14f2ae54d43c9b8e4881b5491fe024407ec2f45548384946410d5a412c0c1dea5ab21da811fb43e2c538fa817d1cdc'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
-# Testapp::Application.config.session_store :active_record_store
+# Gocool::Application.config.session_store :active_record_store
@@ -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
Oops, something went wrong.

0 comments on commit d82e24d

Please sign in to comment.