thin 0.5.3-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of thin might be problematic. Click here for more details.
- data/CHANGELOG +40 -0
- data/COPYING +18 -0
- data/README +60 -0
- data/Rakefile +11 -0
- data/benchmark/simple.rb +48 -0
- data/bin/thin +123 -0
- data/doc/benchmarks.txt +86 -0
- data/doc/rdoc/classes/Process.html +181 -0
- data/doc/rdoc/classes/Rack.html +156 -0
- data/doc/rdoc/classes/Rack/Adapter.html +155 -0
- data/doc/rdoc/classes/Rack/Adapter/Rails.html +289 -0
- data/doc/rdoc/classes/Rack/Adapter/Rails/CGIWrapper.html +359 -0
- data/doc/rdoc/classes/Rack/Handler.html +155 -0
- data/doc/rdoc/classes/Rack/Handler/Thin.html +175 -0
- data/doc/rdoc/classes/Thin.html +164 -0
- data/doc/rdoc/classes/Thin/Cluster.html +399 -0
- data/doc/rdoc/classes/Thin/Connection.html +223 -0
- data/doc/rdoc/classes/Thin/Daemonizable.html +260 -0
- data/doc/rdoc/classes/Thin/Daemonizable/ClassMethods.html +197 -0
- data/doc/rdoc/classes/Thin/Headers.html +238 -0
- data/doc/rdoc/classes/Thin/InvalidRequest.html +144 -0
- data/doc/rdoc/classes/Thin/Logging.html +201 -0
- data/doc/rdoc/classes/Thin/Request.html +231 -0
- data/doc/rdoc/classes/Thin/Response.html +271 -0
- data/doc/rdoc/classes/Thin/Server.html +295 -0
- data/doc/rdoc/classes/Thin/StopServer.html +143 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/README.html +226 -0
- data/doc/rdoc/files/bin/thin.html +245 -0
- data/doc/rdoc/files/lib/rack/adapter/rails_rb.html +146 -0
- data/doc/rdoc/files/lib/rack/handler/thin_rb.html +146 -0
- data/doc/rdoc/files/lib/thin/cluster_rb.html +146 -0
- data/doc/rdoc/files/lib/thin/connection_rb.html +145 -0
- data/doc/rdoc/files/lib/thin/daemonizing_rb.html +146 -0
- data/doc/rdoc/files/lib/thin/headers_rb.html +146 -0
- data/doc/rdoc/files/lib/thin/logging_rb.html +146 -0
- data/doc/rdoc/files/lib/thin/request_rb.html +145 -0
- data/doc/rdoc/files/lib/thin/response_rb.html +145 -0
- data/doc/rdoc/files/lib/thin/server_rb.html +145 -0
- data/doc/rdoc/files/lib/thin/statuses_rb.html +145 -0
- data/doc/rdoc/files/lib/thin/version_rb.html +145 -0
- data/doc/rdoc/files/lib/thin_rb.html +152 -0
- data/doc/rdoc/index.html +10 -0
- data/doc/rdoc/logo.gif +0 -0
- data/doc/rdoc/rdoc-style.css +55 -0
- data/example/config.ru +9 -0
- data/example/thin.god +72 -0
- data/ext/thin_parser/common.rl +54 -0
- data/ext/thin_parser/ext_help.h +14 -0
- data/ext/thin_parser/extconf.rb +6 -0
- data/ext/thin_parser/parser.c +1199 -0
- data/ext/thin_parser/parser.h +49 -0
- data/ext/thin_parser/parser.rl +143 -0
- data/ext/thin_parser/thin.c +424 -0
- data/lib/rack/adapter/rails.rb +155 -0
- data/lib/rack/handler/thin.rb +13 -0
- data/lib/thin.rb +36 -0
- data/lib/thin/cluster.rb +106 -0
- data/lib/thin/connection.rb +46 -0
- data/lib/thin/daemonizing.rb +112 -0
- data/lib/thin/headers.rb +37 -0
- data/lib/thin/logging.rb +23 -0
- data/lib/thin/request.rb +72 -0
- data/lib/thin/response.rb +48 -0
- data/lib/thin/server.rb +80 -0
- data/lib/thin/statuses.rb +43 -0
- data/lib/thin/version.rb +11 -0
- data/lib/thin_parser.so +0 -0
- data/spec/cluster_spec.rb +58 -0
- data/spec/daemonizing_spec.rb +93 -0
- data/spec/headers_spec.rb +35 -0
- data/spec/rack_rails_spec.rb +92 -0
- data/spec/rails_app/app/controllers/application.rb +10 -0
- data/spec/rails_app/app/controllers/simple_controller.rb +19 -0
- data/spec/rails_app/app/helpers/application_helper.rb +3 -0
- data/spec/rails_app/app/views/simple/index.html.erb +15 -0
- data/spec/rails_app/config/boot.rb +109 -0
- data/spec/rails_app/config/environment.rb +64 -0
- data/spec/rails_app/config/environments/development.rb +18 -0
- data/spec/rails_app/config/environments/production.rb +19 -0
- data/spec/rails_app/config/environments/test.rb +22 -0
- data/spec/rails_app/config/initializers/inflections.rb +10 -0
- data/spec/rails_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_app/config/routes.rb +35 -0
- data/spec/rails_app/public/404.html +30 -0
- data/spec/rails_app/public/422.html +30 -0
- data/spec/rails_app/public/500.html +30 -0
- data/spec/rails_app/public/dispatch.cgi +10 -0
- data/spec/rails_app/public/dispatch.fcgi +24 -0
- data/spec/rails_app/public/dispatch.rb +10 -0
- data/spec/rails_app/public/favicon.ico +0 -0
- data/spec/rails_app/public/images/rails.png +0 -0
- data/spec/rails_app/public/index.html +277 -0
- data/spec/rails_app/public/javascripts/application.js +2 -0
- data/spec/rails_app/public/javascripts/controls.js +963 -0
- data/spec/rails_app/public/javascripts/dragdrop.js +972 -0
- data/spec/rails_app/public/javascripts/effects.js +1120 -0
- data/spec/rails_app/public/javascripts/prototype.js +4225 -0
- data/spec/rails_app/public/robots.txt +5 -0
- data/spec/rails_app/script/about +3 -0
- data/spec/rails_app/script/console +3 -0
- data/spec/rails_app/script/destroy +3 -0
- data/spec/rails_app/script/generate +3 -0
- data/spec/rails_app/script/performance/benchmarker +3 -0
- data/spec/rails_app/script/performance/profiler +3 -0
- data/spec/rails_app/script/performance/request +3 -0
- data/spec/rails_app/script/plugin +3 -0
- data/spec/rails_app/script/process/inspector +3 -0
- data/spec/rails_app/script/process/reaper +3 -0
- data/spec/rails_app/script/process/spawner +3 -0
- data/spec/rails_app/script/runner +3 -0
- data/spec/rails_app/script/server +3 -0
- data/spec/request_spec.rb +258 -0
- data/spec/response_spec.rb +56 -0
- data/spec/server_spec.rb +75 -0
- data/spec/spec_helper.rb +127 -0
- metadata +219 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe Headers do
|
4
|
+
before do
|
5
|
+
@headers = Headers.new
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'should allow duplicate on some fields' do
|
9
|
+
@headers['Set-Cookie'] = 'twice'
|
10
|
+
@headers['Set-Cookie'] = 'is cooler the once'
|
11
|
+
|
12
|
+
@headers.size.should == 2
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should overwrite value on non duplicate fields' do
|
16
|
+
@headers['Host'] = 'this is unique'
|
17
|
+
@headers['Host'] = 'so is this'
|
18
|
+
@headers['Host'] = 'so this will overwrite ^'
|
19
|
+
|
20
|
+
@headers['Host'].should == 'so this will overwrite ^'
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should return first header value' do
|
24
|
+
@headers['Set-Cookie'] = 'hi'
|
25
|
+
@headers['Set-Cookie'].should == 'hi'
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should output to string' do
|
29
|
+
@headers['Host'] = 'localhost:3000'
|
30
|
+
@headers['Set-Cookie'] = 'twice'
|
31
|
+
@headers['Set-Cookie'] = 'is cooler the once'
|
32
|
+
|
33
|
+
@headers.to_s.should == "Host: localhost:3000\r\nSet-Cookie: twice\r\nSet-Cookie: is cooler the once\r\n"
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
require 'rack/mock'
|
3
|
+
|
4
|
+
begin
|
5
|
+
gem 'rails', '= 2.0.2' # We could freeze Rails in the rails_app dir to remove this
|
6
|
+
|
7
|
+
describe Rack::Adapter::Rails do
|
8
|
+
before do
|
9
|
+
@rails_app_path = File.dirname(__FILE__) + '/rails_app'
|
10
|
+
@request = Rack::MockRequest.new(Rack::Adapter::Rails.new(:root => @rails_app_path))
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should handle simple GET request" do
|
14
|
+
res = @request.get("/simple", :lint => true)
|
15
|
+
|
16
|
+
res.should be_ok
|
17
|
+
res["Content-Type"].should include("text/html")
|
18
|
+
|
19
|
+
res.body.should include('Simple#index')
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should handle POST parameters" do
|
23
|
+
data = "foo=bar"
|
24
|
+
res = @request.post("/simple/post_form", :input => data, 'CONTENT_LENGTH' => data.size)
|
25
|
+
|
26
|
+
res.should be_ok
|
27
|
+
res["Content-Type"].should include("text/html")
|
28
|
+
res["Content-Length"].should_not be_nil
|
29
|
+
|
30
|
+
res.body.should include('foo: bar')
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should serve static files" do
|
34
|
+
res = @request.get("/index.html")
|
35
|
+
|
36
|
+
res.should be_ok
|
37
|
+
res["Content-Type"].should include("text/html")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should serve root with index.html if present" do
|
41
|
+
res = @request.get("/")
|
42
|
+
|
43
|
+
res.should be_ok
|
44
|
+
res["Content-Length"].to_i.should == File.size(@rails_app_path + '/public/index.html')
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should serve page cache if present" do
|
48
|
+
res = @request.get("/simple/cached?value=cached")
|
49
|
+
|
50
|
+
res.should be_ok
|
51
|
+
res.body.should == 'cached'
|
52
|
+
|
53
|
+
res = @request.get("/simple/cached?value=notcached")
|
54
|
+
|
55
|
+
res.should be_ok
|
56
|
+
res.body.should == 'cached'
|
57
|
+
end
|
58
|
+
|
59
|
+
it "handles multiple cookies" do
|
60
|
+
res = @request.get('/simple/set_cookie?name=a&value=1')
|
61
|
+
|
62
|
+
res.should be_ok
|
63
|
+
res.original_headers['Set-Cookie'].should include('a=1; path=/', '_rails_app_session')
|
64
|
+
end
|
65
|
+
|
66
|
+
after do
|
67
|
+
FileUtils.rm_rf @rails_app_path + '/public/simple'
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe Rack::Adapter::Rails, 'with prefix' do
|
72
|
+
before do
|
73
|
+
@rails_app_path = File.dirname(__FILE__) + '/rails_app'
|
74
|
+
@prefix = '/nowhere'
|
75
|
+
@request = Rack::MockRequest.new(
|
76
|
+
Rack::URLMap.new(
|
77
|
+
@prefix => Rack::Adapter::Rails.new(:root => @rails_app_path, :prefix => @prefix)))
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should handle simple GET request" do
|
81
|
+
res = @request.get("#{@prefix}/simple", :lint => true)
|
82
|
+
|
83
|
+
res.should be_ok
|
84
|
+
res["Content-Type"].should include("text/html")
|
85
|
+
|
86
|
+
res.body.should include('Simple#index')
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
rescue Gem::LoadError
|
91
|
+
warn 'Rails 2.0.2 is required to run the Rails adapter specs'
|
92
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Filters added to this controller apply to all controllers in the application.
|
2
|
+
# Likewise, all the methods added will be available for all controllers.
|
3
|
+
|
4
|
+
class ApplicationController < ActionController::Base
|
5
|
+
helper :all # include all helpers, all the time
|
6
|
+
|
7
|
+
# See ActionController::RequestForgeryProtection for details
|
8
|
+
# Uncomment the :secret if you're not using the cookie session store
|
9
|
+
# protect_from_forgery # :secret => 'a8af303b8dabf2d2d8f1a7912ac04d7d'
|
10
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class SimpleController < ApplicationController
|
2
|
+
caches_page :cached
|
3
|
+
|
4
|
+
def index
|
5
|
+
end
|
6
|
+
|
7
|
+
def post_form
|
8
|
+
render :text => params.to_yaml
|
9
|
+
end
|
10
|
+
|
11
|
+
def set_cookie
|
12
|
+
cookies[params[:name]] = params[:value] if params[:name]
|
13
|
+
render :text => cookies.to_yaml
|
14
|
+
end
|
15
|
+
|
16
|
+
def cached
|
17
|
+
render :text => params[:value]
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<h1>Simple#index</h1>
|
2
|
+
|
3
|
+
<h2>ENV</h2>
|
4
|
+
<%= request.env.to_yaml %>
|
5
|
+
|
6
|
+
<h2>Cookies</h2>
|
7
|
+
<%= request.cookies.to_yaml %>
|
8
|
+
|
9
|
+
<h2>Params</h2>
|
10
|
+
<%= params.to_yaml %>
|
11
|
+
|
12
|
+
<% form_tag '/simple' do %>
|
13
|
+
<%= text_field_tag :a %>
|
14
|
+
<%= submit_tag 'Submit' %>
|
15
|
+
<% end %>
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# Don't change this file!
|
2
|
+
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
+
|
4
|
+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
+
|
6
|
+
module Rails
|
7
|
+
class << self
|
8
|
+
def boot!
|
9
|
+
unless booted?
|
10
|
+
preinitialize
|
11
|
+
pick_boot.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def booted?
|
16
|
+
defined? Rails::Initializer
|
17
|
+
end
|
18
|
+
|
19
|
+
def pick_boot
|
20
|
+
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
+
end
|
22
|
+
|
23
|
+
def vendor_rails?
|
24
|
+
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
+
end
|
26
|
+
|
27
|
+
# FIXME : Ruby 1.9
|
28
|
+
def preinitialize
|
29
|
+
load(preinitializer_path) if File.exists?(preinitializer_path)
|
30
|
+
end
|
31
|
+
|
32
|
+
def preinitializer_path
|
33
|
+
"#{RAILS_ROOT}/config/preinitializer.rb"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class Boot
|
38
|
+
def run
|
39
|
+
load_initializer
|
40
|
+
Rails::Initializer.run(:set_load_path)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class VendorBoot < Boot
|
45
|
+
def load_initializer
|
46
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class GemBoot < Boot
|
51
|
+
def load_initializer
|
52
|
+
self.class.load_rubygems
|
53
|
+
load_rails_gem
|
54
|
+
require 'initializer'
|
55
|
+
end
|
56
|
+
|
57
|
+
def load_rails_gem
|
58
|
+
if version = self.class.gem_version
|
59
|
+
gem 'rails', version
|
60
|
+
else
|
61
|
+
gem 'rails'
|
62
|
+
end
|
63
|
+
rescue Gem::LoadError => load_error
|
64
|
+
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
65
|
+
exit 1
|
66
|
+
end
|
67
|
+
|
68
|
+
class << self
|
69
|
+
def rubygems_version
|
70
|
+
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
71
|
+
end
|
72
|
+
|
73
|
+
def gem_version
|
74
|
+
if defined? RAILS_GEM_VERSION
|
75
|
+
RAILS_GEM_VERSION
|
76
|
+
elsif ENV.include?('RAILS_GEM_VERSION')
|
77
|
+
ENV['RAILS_GEM_VERSION']
|
78
|
+
else
|
79
|
+
parse_gem_version(read_environment_rb)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def load_rubygems
|
84
|
+
require 'rubygems'
|
85
|
+
|
86
|
+
unless rubygems_version >= '0.9.4'
|
87
|
+
$stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
88
|
+
exit 1
|
89
|
+
end
|
90
|
+
|
91
|
+
rescue LoadError
|
92
|
+
$stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
93
|
+
exit 1
|
94
|
+
end
|
95
|
+
|
96
|
+
def parse_gem_version(text)
|
97
|
+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
98
|
+
end
|
99
|
+
|
100
|
+
private
|
101
|
+
def read_environment_rb
|
102
|
+
File.read("#{RAILS_ROOT}/config/environment.rb")
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# All that for this:
|
109
|
+
Rails.boot!
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file
|
2
|
+
|
3
|
+
# Uncomment below to force Rails into production mode when
|
4
|
+
# you don't control web/app server and can't set it the proper way
|
5
|
+
# ENV['RAILS_ENV'] ||= 'production'
|
6
|
+
|
7
|
+
# Specifies gem version of Rails to use when vendor/rails is not present
|
8
|
+
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
|
9
|
+
|
10
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
11
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
12
|
+
|
13
|
+
Rails::Initializer.run do |config|
|
14
|
+
# Settings in config/environments/* take precedence over those specified here.
|
15
|
+
# Application configuration should go into files in config/initializers
|
16
|
+
# -- all .rb files in that directory are automatically loaded.
|
17
|
+
# See Rails::Configuration for more options.
|
18
|
+
|
19
|
+
# Skip frameworks you're not going to use (only works if using vendor/rails).
|
20
|
+
# To use Rails without a database, you must remove the Active Record framework
|
21
|
+
config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
|
22
|
+
|
23
|
+
# Only load the plugins named here, in the order given. By default, all plugins
|
24
|
+
# in vendor/plugins are loaded in alphabetical order.
|
25
|
+
# :all can be used as a placeholder for all plugins not explicitly named
|
26
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
27
|
+
|
28
|
+
# Add additional load paths for your own custom dirs
|
29
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
30
|
+
|
31
|
+
# No need for log files
|
32
|
+
config.logger = Logger.new(nil)
|
33
|
+
|
34
|
+
# Force all environments to use the same logger level
|
35
|
+
# (by default production uses :info, the others :debug)
|
36
|
+
# config.log_level = :debug
|
37
|
+
|
38
|
+
# Your secret key for verifying cookie session data integrity.
|
39
|
+
# If you change this key, all old sessions will become invalid!
|
40
|
+
# Make sure the secret is at least 30 characters and all random,
|
41
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
42
|
+
config.action_controller.session = {
|
43
|
+
:session_key => '_rails_app_session',
|
44
|
+
:secret => 'cb7141365b4443eff37e7122473e704ceae95146a4028930b21300965fe6abec51e3e93b2670a914b3b65d06058b81aadfe6b240d63e7d7713db044b42a6e1c1'
|
45
|
+
}
|
46
|
+
|
47
|
+
config.action_controller.allow_forgery_protection = false
|
48
|
+
|
49
|
+
# Use the database for sessions instead of the cookie-based default,
|
50
|
+
# which shouldn't be used to store highly confidential information
|
51
|
+
# (create the session table with 'rake db:sessions:create')
|
52
|
+
# config.action_controller.session_store = :active_record_store
|
53
|
+
|
54
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
55
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
56
|
+
# like if you have constraints or database-specific column types
|
57
|
+
# config.active_record.schema_format = :sql
|
58
|
+
|
59
|
+
# Activate observers that should always be running
|
60
|
+
# config.active_record.observers = :cacher, :garbage_collector
|
61
|
+
|
62
|
+
# Make Active Record use UTC-base instead of local time
|
63
|
+
# config.active_record.default_timezone = :utc
|
64
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# In the development environment your application's code is reloaded on
|
4
|
+
# every request. This slows down response time but is perfect for development
|
5
|
+
# since you don't have to restart the webserver when you make code changes.
|
6
|
+
config.cache_classes = false
|
7
|
+
|
8
|
+
# Log error messages when you accidentally call methods on nil.
|
9
|
+
config.whiny_nils = true
|
10
|
+
|
11
|
+
# Show full error reports and disable caching
|
12
|
+
config.action_controller.consider_all_requests_local = true
|
13
|
+
config.action_view.debug_rjs = true
|
14
|
+
config.action_controller.perform_caching = true
|
15
|
+
config.action_view.cache_template_extensions = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The production environment is meant for finished, "live" apps.
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Use a different logger for distributed setups
|
8
|
+
# config.logger = SyslogLogger.new
|
9
|
+
|
10
|
+
# Full error reports are disabled and caching is turned on
|
11
|
+
config.action_controller.consider_all_requests_local = false
|
12
|
+
config.action_controller.perform_caching = true
|
13
|
+
config.action_view.cache_template_loading = true
|
14
|
+
|
15
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
16
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
17
|
+
|
18
|
+
# Disable delivery errors, bad email addresses will be ignored
|
19
|
+
# config.action_mailer.raise_delivery_errors = false
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The test environment is used exclusively to run your application's
|
4
|
+
# test suite. You never need to work with it otherwise. Remember that
|
5
|
+
# your test database is "scratch space" for the test suite and is wiped
|
6
|
+
# and recreated between test runs. Don't rely on the data there!
|
7
|
+
config.cache_classes = true
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.action_controller.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Disable request forgery protection in test environment
|
17
|
+
config.action_controller.allow_forgery_protection = false
|
18
|
+
|
19
|
+
# Tell ActionMailer not to deliver emails to the real world.
|
20
|
+
# The :test delivery method accumulates sent emails in the
|
21
|
+
# ActionMailer::Base.deliveries array.
|
22
|
+
config.action_mailer.delivery_method = :test
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
ActionController::Routing::Routes.draw do |map|
|
2
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
3
|
+
|
4
|
+
# Sample of regular route:
|
5
|
+
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
6
|
+
# Keep in mind you can assign values other than :controller and :action
|
7
|
+
|
8
|
+
# Sample of named route:
|
9
|
+
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
10
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
11
|
+
|
12
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
13
|
+
# map.resources :products
|
14
|
+
|
15
|
+
# Sample resource route with options:
|
16
|
+
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
|
17
|
+
|
18
|
+
# Sample resource route with sub-resources:
|
19
|
+
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
|
20
|
+
|
21
|
+
# Sample resource route within a namespace:
|
22
|
+
# map.namespace :admin do |admin|
|
23
|
+
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
|
24
|
+
# admin.resources :products
|
25
|
+
# end
|
26
|
+
|
27
|
+
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
|
28
|
+
# map.root :controller => "welcome"
|
29
|
+
|
30
|
+
# See how all your routes lay out with "rake routes"
|
31
|
+
|
32
|
+
# Install the default routes as the lowest priority.
|
33
|
+
map.connect ':controller/:action/:id'
|
34
|
+
map.connect ':controller/:action/:id.:format'
|
35
|
+
end
|