erails 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/MIT-LICENSE +20 -0
- data/README +309 -0
- data/Rakefile +339 -0
- data/bin/about +4 -0
- data/bin/console +3 -0
- data/bin/dbconsole +3 -0
- data/bin/destroy +3 -0
- data/bin/erails +19 -0
- data/bin/generate +3 -0
- data/bin/performance/benchmarker +3 -0
- data/bin/performance/profiler +3 -0
- data/bin/performance/request +3 -0
- data/bin/plugin +3 -0
- data/bin/process/inspector +3 -0
- data/bin/process/reaper +3 -0
- data/bin/process/spawner +3 -0
- data/bin/runner +3 -0
- data/bin/server +3 -0
- data/builtin/rails_info/rails/info.rb +125 -0
- data/builtin/rails_info/rails/info_controller.rb +9 -0
- data/builtin/rails_info/rails/info_helper.rb +2 -0
- data/builtin/rails_info/rails_info_controller.rb +2 -0
- data/configs/apache.conf +40 -0
- data/configs/databases/frontbase.yml +28 -0
- data/configs/databases/mysql.yml +54 -0
- data/configs/databases/oracle.yml +39 -0
- data/configs/databases/postgresql.yml +48 -0
- data/configs/databases/sqlite2.yml +16 -0
- data/configs/databases/sqlite3.yml +19 -0
- data/configs/empty.log +0 -0
- data/configs/initializers/inflections.rb +10 -0
- data/configs/initializers/mime_types.rb +5 -0
- data/configs/initializers/new_rails_defaults.rb +17 -0
- data/configs/lighttpd.conf +54 -0
- data/configs/routes.rb +43 -0
- data/dispatches/dispatch.fcgi +24 -0
- data/dispatches/dispatch.rb +10 -0
- data/dispatches/gateway.cgi +97 -0
- data/doc/README_FOR_APP +2 -0
- data/environments/boot.rb +109 -0
- data/environments/development.rb +16 -0
- data/environments/environment.rb +71 -0
- data/environments/production.rb +22 -0
- data/environments/test.rb +22 -0
- data/fresh_rakefile +10 -0
- data/helpers/application.rb +15 -0
- data/helpers/application_helper.rb +3 -0
- data/helpers/test_helper.rb +38 -0
- data/html/404.html +30 -0
- data/html/422.html +30 -0
- data/html/500.html +30 -0
- data/html/favicon.ico +0 -0
- data/html/images/rails.png +0 -0
- data/html/index.html +274 -0
- data/html/javascripts/application.js +2 -0
- data/html/robots.txt +5 -0
- data/lib/code_statistics.rb +107 -0
- data/lib/commands/about.rb +3 -0
- data/lib/commands/console.rb +32 -0
- data/lib/commands/dbconsole.rb +67 -0
- data/lib/commands/destroy.rb +6 -0
- data/lib/commands/generate.rb +6 -0
- data/lib/commands/ncgi/listener +86 -0
- data/lib/commands/ncgi/tracker +69 -0
- data/lib/commands/performance/benchmarker.rb +24 -0
- data/lib/commands/performance/profiler.rb +50 -0
- data/lib/commands/performance/request.rb +6 -0
- data/lib/commands/plugin.rb +950 -0
- data/lib/commands/process/inspector.rb +68 -0
- data/lib/commands/process/reaper.rb +149 -0
- data/lib/commands/process/spawner.rb +219 -0
- data/lib/commands/process/spinner.rb +57 -0
- data/lib/commands/runner.rb +48 -0
- data/lib/commands/server.rb +39 -0
- data/lib/commands/servers/base.rb +31 -0
- data/lib/commands/servers/lighttpd.rb +94 -0
- data/lib/commands/servers/mongrel.rb +69 -0
- data/lib/commands/servers/new_mongrel.rb +16 -0
- data/lib/commands/servers/webrick.rb +66 -0
- data/lib/commands/update.rb +4 -0
- data/lib/commands.rb +17 -0
- data/lib/console_app.rb +30 -0
- data/lib/console_sandbox.rb +6 -0
- data/lib/console_with_helpers.rb +26 -0
- data/lib/dispatcher.rb +24 -0
- data/lib/fcgi_handler.rb +239 -0
- data/lib/initializer.rb +926 -0
- data/lib/rails/gem_builder.rb +21 -0
- data/lib/rails/gem_dependency.rb +129 -0
- data/lib/rails/mongrel_server/commands.rb +342 -0
- data/lib/rails/mongrel_server/handler.rb +55 -0
- data/lib/rails/plugin/loader.rb +152 -0
- data/lib/rails/plugin/locator.rb +100 -0
- data/lib/rails/plugin.rb +116 -0
- data/lib/rails/version.rb +9 -0
- data/lib/rails_generator/base.rb +263 -0
- data/lib/rails_generator/commands.rb +622 -0
- data/lib/rails_generator/generated_attribute.rb +42 -0
- data/lib/rails_generator/generators/applications/app/USAGE +9 -0
- data/lib/rails_generator/generators/applications/app/app_generator.rb +174 -0
- data/lib/rails_generator/generators/components/controller/USAGE +29 -0
- data/lib/rails_generator/generators/components/controller/controller_generator.rb +37 -0
- data/lib/rails_generator/generators/components/controller/templates/controller.rb +7 -0
- data/lib/rails_generator/generators/components/controller/templates/functional_test.rb +8 -0
- data/lib/rails_generator/generators/components/controller/templates/helper.rb +2 -0
- data/lib/rails_generator/generators/components/controller/templates/view.html.erb +2 -0
- data/lib/rails_generator/generators/components/integration_test/USAGE +8 -0
- data/lib/rails_generator/generators/components/integration_test/integration_test_generator.rb +16 -0
- data/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +10 -0
- data/lib/rails_generator/generators/components/mailer/USAGE +16 -0
- data/lib/rails_generator/generators/components/mailer/mailer_generator.rb +30 -0
- data/lib/rails_generator/generators/components/mailer/templates/fixture.erb +3 -0
- data/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -0
- data/lib/rails_generator/generators/components/mailer/templates/mailer.rb +15 -0
- data/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +21 -0
- data/lib/rails_generator/generators/components/mailer/templates/view.erb +3 -0
- data/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -0
- data/lib/rails_generator/generators/components/migration/USAGE +29 -0
- data/lib/rails_generator/generators/components/migration/migration_generator.rb +20 -0
- data/lib/rails_generator/generators/components/migration/templates/migration.rb +11 -0
- data/lib/rails_generator/generators/components/model/USAGE +27 -0
- data/lib/rails_generator/generators/components/model/model_generator.rb +45 -0
- data/lib/rails_generator/generators/components/model/templates/fixtures.yml +19 -0
- data/lib/rails_generator/generators/components/model/templates/migration.rb +16 -0
- data/lib/rails_generator/generators/components/model/templates/model.rb +2 -0
- data/lib/rails_generator/generators/components/model/templates/unit_test.rb +8 -0
- data/lib/rails_generator/generators/components/observer/USAGE +13 -0
- data/lib/rails_generator/generators/components/observer/observer_generator.rb +16 -0
- data/lib/rails_generator/generators/components/observer/templates/observer.rb +2 -0
- data/lib/rails_generator/generators/components/observer/templates/unit_test.rb +8 -0
- data/lib/rails_generator/generators/components/plugin/USAGE +25 -0
- data/lib/rails_generator/generators/components/plugin/plugin_generator.rb +39 -0
- data/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +20 -0
- data/lib/rails_generator/generators/components/plugin/templates/README +13 -0
- data/lib/rails_generator/generators/components/plugin/templates/Rakefile +22 -0
- data/lib/rails_generator/generators/components/plugin/templates/USAGE +8 -0
- data/lib/rails_generator/generators/components/plugin/templates/generator.rb +8 -0
- data/lib/rails_generator/generators/components/plugin/templates/init.rb +1 -0
- data/lib/rails_generator/generators/components/plugin/templates/install.rb +1 -0
- data/lib/rails_generator/generators/components/plugin/templates/plugin.rb +1 -0
- data/lib/rails_generator/generators/components/plugin/templates/tasks.rake +4 -0
- data/lib/rails_generator/generators/components/plugin/templates/uninstall.rb +1 -0
- data/lib/rails_generator/generators/components/plugin/templates/unit_test.rb +8 -0
- data/lib/rails_generator/generators/components/resource/USAGE +23 -0
- data/lib/rails_generator/generators/components/resource/resource_generator.rb +74 -0
- data/lib/rails_generator/generators/components/resource/templates/controller.rb +2 -0
- data/lib/rails_generator/generators/components/resource/templates/functional_test.rb +8 -0
- data/lib/rails_generator/generators/components/resource/templates/helper.rb +2 -0
- data/lib/rails_generator/generators/components/scaffold/USAGE +25 -0
- data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +93 -0
- data/lib/rails_generator/generators/components/scaffold/templates/controller.rb +85 -0
- data/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +45 -0
- data/lib/rails_generator/generators/components/scaffold/templates/helper.rb +2 -0
- data/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +17 -0
- data/lib/rails_generator/generators/components/scaffold/templates/style.css +54 -0
- data/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +18 -0
- data/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +24 -0
- data/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +17 -0
- data/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +10 -0
- data/lib/rails_generator/generators/components/session_migration/USAGE +10 -0
- data/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +18 -0
- data/lib/rails_generator/generators/components/session_migration/templates/migration.rb +16 -0
- data/lib/rails_generator/lookup.rb +249 -0
- data/lib/rails_generator/manifest.rb +53 -0
- data/lib/rails_generator/options.rb +150 -0
- data/lib/rails_generator/scripts/destroy.rb +30 -0
- data/lib/rails_generator/scripts/generate.rb +7 -0
- data/lib/rails_generator/scripts/update.rb +12 -0
- data/lib/rails_generator/scripts.rb +89 -0
- data/lib/rails_generator/secret_key_generator.rb +164 -0
- data/lib/rails_generator/simple_logger.rb +46 -0
- data/lib/rails_generator/spec.rb +44 -0
- data/lib/rails_generator.rb +43 -0
- data/lib/railties_path.rb +1 -0
- data/lib/ruby_version_check.rb +17 -0
- data/lib/rubyprof_ext.rb +35 -0
- data/lib/source_annotation_extractor.rb +102 -0
- data/lib/tasks/annotations.rake +23 -0
- data/lib/tasks/databases.rake +389 -0
- data/lib/tasks/documentation.rake +80 -0
- data/lib/tasks/framework.rake +105 -0
- data/lib/tasks/gems.rake +64 -0
- data/lib/tasks/log.rake +9 -0
- data/lib/tasks/misc.rake +57 -0
- data/lib/tasks/rails.rb +8 -0
- data/lib/tasks/routes.rake +17 -0
- data/lib/tasks/statistics.rake +18 -0
- data/lib/tasks/testing.rake +118 -0
- data/lib/tasks/tmp.rake +37 -0
- data/lib/test_help.rb +28 -0
- data/lib/webrick_server.rb +165 -0
- metadata +356 -0
data/bin/destroy
ADDED
data/bin/erails
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/../lib/ruby_version_check'
|
|
2
|
+
Signal.trap("INT") { puts; exit }
|
|
3
|
+
|
|
4
|
+
require File.dirname(__FILE__) + '/../lib/rails/version'
|
|
5
|
+
if %w(--version -v).include? ARGV.first
|
|
6
|
+
puts "Rails #{Rails::VERSION::STRING}"
|
|
7
|
+
exit(0)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
freeze = ARGV.any? { |option| %w(--freeze -f).include?(option) }
|
|
11
|
+
app_path = ARGV.first
|
|
12
|
+
|
|
13
|
+
require File.dirname(__FILE__) + '/../lib/rails_generator'
|
|
14
|
+
|
|
15
|
+
require 'rails_generator/scripts/generate'
|
|
16
|
+
Rails::Generator::Base.use_application_sources!
|
|
17
|
+
Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')
|
|
18
|
+
|
|
19
|
+
Dir.chdir(app_path) { `rake rails:freeze:gems`; puts "froze" } if freeze
|
data/bin/generate
ADDED
data/bin/plugin
ADDED
data/bin/process/reaper
ADDED
data/bin/process/spawner
ADDED
data/bin/runner
ADDED
data/bin/server
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
module Rails
|
|
2
|
+
module Info
|
|
3
|
+
mattr_accessor :properties
|
|
4
|
+
class << (@@properties = [])
|
|
5
|
+
def names
|
|
6
|
+
map &:first
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def value_for(property_name)
|
|
10
|
+
if property = assoc(property_name)
|
|
11
|
+
property.last
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class << self #:nodoc:
|
|
17
|
+
def property(name, value = nil)
|
|
18
|
+
value ||= yield
|
|
19
|
+
properties << [name, value] if value
|
|
20
|
+
rescue Exception
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def components
|
|
24
|
+
%w( active_record eaction_pack active_resource action_mailer active_support )
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def component_version(component)
|
|
28
|
+
require "#{component}/version"
|
|
29
|
+
"#{component.classify}::VERSION::STRING".constantize
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def edge_rails_revision(info = git_info)
|
|
33
|
+
info[/commit ([a-z0-9-]+)/, 1] || freeze_edge_version
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def freeze_edge_version
|
|
37
|
+
if File.exist?(rails_vendor_root)
|
|
38
|
+
begin
|
|
39
|
+
Dir[File.join(rails_vendor_root, 'REVISION_*')].first.scan(/_(\d+)$/).first.first
|
|
40
|
+
rescue
|
|
41
|
+
Dir[File.join(rails_vendor_root, 'TAG_*')].first.scan(/_(.+)$/).first.first rescue 'unknown'
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def to_s
|
|
47
|
+
column_width = properties.names.map {|name| name.length}.max
|
|
48
|
+
["About your application's environment", *properties.map do |property|
|
|
49
|
+
"%-#{column_width}s %s" % property
|
|
50
|
+
end] * "\n"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
alias inspect to_s
|
|
54
|
+
|
|
55
|
+
def to_html
|
|
56
|
+
returning table = '<table>' do
|
|
57
|
+
properties.each do |(name, value)|
|
|
58
|
+
table << %(<tr><td class="name">#{CGI.escapeHTML(name.to_s)}</td>)
|
|
59
|
+
table << %(<td class="value">#{CGI.escapeHTML(value.to_s)}</td></tr>)
|
|
60
|
+
end
|
|
61
|
+
table << '</table>'
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
protected
|
|
66
|
+
def rails_vendor_root
|
|
67
|
+
@rails_vendor_root ||= "#{RAILS_ROOT}/vendor/rails"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def git_info
|
|
71
|
+
env_lang, ENV['LC_ALL'] = ENV['LC_ALL'], 'C'
|
|
72
|
+
Dir.chdir(rails_vendor_root) do
|
|
73
|
+
silence_stderr { `git log -n 1` }
|
|
74
|
+
end
|
|
75
|
+
ensure
|
|
76
|
+
ENV['LC_ALL'] = env_lang
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# The Ruby version and platform, e.g. "1.8.2 (powerpc-darwin8.2.0)".
|
|
81
|
+
property 'Ruby version', "#{RUBY_VERSION} (#{RUBY_PLATFORM})"
|
|
82
|
+
|
|
83
|
+
# The RubyGems version, if it's installed.
|
|
84
|
+
property 'RubyGems version' do
|
|
85
|
+
Gem::RubyGemsVersion
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# The Rails version.
|
|
89
|
+
property 'Rails version' do
|
|
90
|
+
Rails::VERSION::STRING
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Versions of each Rails component (Active Record, Action Pack,
|
|
94
|
+
# Active Resource, Action Mailer, and Active Support).
|
|
95
|
+
components.each do |component|
|
|
96
|
+
property "#{component.titlecase} version" do
|
|
97
|
+
component_version(component)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# The Rails Git revision, if it's checked out into vendor/rails.
|
|
102
|
+
property 'Edge Rails revision' do
|
|
103
|
+
edge_rails_revision
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# The application's location on the filesystem.
|
|
107
|
+
property 'Application root' do
|
|
108
|
+
File.expand_path(RAILS_ROOT)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# The current Rails environment (development, test, or production).
|
|
112
|
+
property 'Environment' do
|
|
113
|
+
RAILS_ENV
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# The name of the database adapter for the current environment.
|
|
117
|
+
property 'Database adapter' do
|
|
118
|
+
ActiveRecord::Base.configurations[RAILS_ENV]['adapter']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
property 'Database schema version' do
|
|
122
|
+
ActiveRecord::Migrator.current_version rescue nil
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
class Rails::InfoController < ActionController::Base
|
|
2
|
+
def properties
|
|
3
|
+
if consider_all_requests_local || local_request?
|
|
4
|
+
render :inline => Rails::Info.to_html
|
|
5
|
+
else
|
|
6
|
+
render :text => '<p>For security purposes, this information is only available to local requests.</p>', :status => 500
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
data/configs/apache.conf
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# General Apache options
|
|
2
|
+
AddHandler fastcgi-script .fcgi
|
|
3
|
+
AddHandler cgi-script .cgi
|
|
4
|
+
Options +FollowSymLinks +ExecCGI
|
|
5
|
+
|
|
6
|
+
# If you don't want Rails to look in certain directories,
|
|
7
|
+
# use the following rewrite rules so that Apache won't rewrite certain requests
|
|
8
|
+
#
|
|
9
|
+
# Example:
|
|
10
|
+
# RewriteCond %{REQUEST_URI} ^/notrails.*
|
|
11
|
+
# RewriteRule .* - [L]
|
|
12
|
+
|
|
13
|
+
# Redirect all requests not available on the filesystem to Rails
|
|
14
|
+
# By default the cgi dispatcher is used which is very slow
|
|
15
|
+
#
|
|
16
|
+
# For better performance replace the dispatcher with the fastcgi one
|
|
17
|
+
#
|
|
18
|
+
# Example:
|
|
19
|
+
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
|
|
20
|
+
RewriteEngine On
|
|
21
|
+
|
|
22
|
+
# If your Rails application is accessed via an Alias directive,
|
|
23
|
+
# then you MUST also set the RewriteBase in this htaccess file.
|
|
24
|
+
#
|
|
25
|
+
# Example:
|
|
26
|
+
# Alias /myrailsapp /path/to/myrailsapp/public
|
|
27
|
+
# RewriteBase /myrailsapp
|
|
28
|
+
|
|
29
|
+
RewriteRule ^$ index.html [QSA]
|
|
30
|
+
RewriteRule ^([^.]+)$ $1.html [QSA]
|
|
31
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
32
|
+
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
|
|
33
|
+
|
|
34
|
+
# In case Rails experiences terminal errors
|
|
35
|
+
# Instead of displaying this message you can supply a file here which will be rendered instead
|
|
36
|
+
#
|
|
37
|
+
# Example:
|
|
38
|
+
# ErrorDocument 500 /500.html
|
|
39
|
+
|
|
40
|
+
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# FrontBase versions 4.x
|
|
2
|
+
#
|
|
3
|
+
# Get the bindings:
|
|
4
|
+
# gem install ruby-frontbase
|
|
5
|
+
|
|
6
|
+
development:
|
|
7
|
+
adapter: frontbase
|
|
8
|
+
host: localhost
|
|
9
|
+
database: <%= app_name %>_development
|
|
10
|
+
username: <%= app_name %>
|
|
11
|
+
password: ''
|
|
12
|
+
|
|
13
|
+
# Warning: The database defined as "test" will be erased and
|
|
14
|
+
# re-generated from your development database when you run "rake".
|
|
15
|
+
# Do not set this db to the same as development or production.
|
|
16
|
+
test:
|
|
17
|
+
adapter: frontbase
|
|
18
|
+
host: localhost
|
|
19
|
+
database: <%= app_name %>_test
|
|
20
|
+
username: <%= app_name %>
|
|
21
|
+
password: ''
|
|
22
|
+
|
|
23
|
+
production:
|
|
24
|
+
adapter: frontbase
|
|
25
|
+
host: localhost
|
|
26
|
+
database: <%= app_name %>_production
|
|
27
|
+
username: <%= app_name %>
|
|
28
|
+
password: ''
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# MySQL. Versions 4.1 and 5.0 are recommended.
|
|
2
|
+
#
|
|
3
|
+
# Install the MySQL driver:
|
|
4
|
+
# gem install mysql
|
|
5
|
+
# On Mac OS X:
|
|
6
|
+
# sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
|
|
7
|
+
# On Mac OS X Leopard:
|
|
8
|
+
# sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
|
|
9
|
+
# This sets the ARCHFLAGS environment variable to your native architecture
|
|
10
|
+
# On Windows:
|
|
11
|
+
# gem install mysql
|
|
12
|
+
# Choose the win32 build.
|
|
13
|
+
# Install MySQL and put its /bin directory on your path.
|
|
14
|
+
#
|
|
15
|
+
# And be sure to use new-style password hashing:
|
|
16
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
|
17
|
+
development:
|
|
18
|
+
adapter: mysql
|
|
19
|
+
encoding: utf8
|
|
20
|
+
database: <%= app_name %>_development
|
|
21
|
+
username: root
|
|
22
|
+
password:
|
|
23
|
+
<% if socket -%>
|
|
24
|
+
socket: <%= socket %>
|
|
25
|
+
<% else -%>
|
|
26
|
+
host: localhost
|
|
27
|
+
<% end -%>
|
|
28
|
+
|
|
29
|
+
# Warning: The database defined as "test" will be erased and
|
|
30
|
+
# re-generated from your development database when you run "rake".
|
|
31
|
+
# Do not set this db to the same as development or production.
|
|
32
|
+
test:
|
|
33
|
+
adapter: mysql
|
|
34
|
+
encoding: utf8
|
|
35
|
+
database: <%= app_name %>_test
|
|
36
|
+
username: root
|
|
37
|
+
password:
|
|
38
|
+
<% if socket -%>
|
|
39
|
+
socket: <%= socket %>
|
|
40
|
+
<% else -%>
|
|
41
|
+
host: localhost
|
|
42
|
+
<% end -%>
|
|
43
|
+
|
|
44
|
+
production:
|
|
45
|
+
adapter: mysql
|
|
46
|
+
encoding: utf8
|
|
47
|
+
database: <%= app_name %>_production
|
|
48
|
+
username: root
|
|
49
|
+
password:
|
|
50
|
+
<% if socket -%>
|
|
51
|
+
socket: <%= socket %>
|
|
52
|
+
<% else -%>
|
|
53
|
+
host: localhost
|
|
54
|
+
<% end -%>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Oracle/OCI 8i, 9, 10g
|
|
2
|
+
#
|
|
3
|
+
# Requires Ruby/OCI8:
|
|
4
|
+
# http://rubyforge.org/projects/ruby-oci8/
|
|
5
|
+
#
|
|
6
|
+
# Specify your database using any valid connection syntax, such as a
|
|
7
|
+
# tnsnames.ora service name, or a SQL connect url string of the form:
|
|
8
|
+
#
|
|
9
|
+
# //host:[port][/service name]
|
|
10
|
+
#
|
|
11
|
+
# By default prefetch_rows (OCI_ATTR_PREFETCH_ROWS) is set to 100. And
|
|
12
|
+
# until true bind variables are supported, cursor_sharing is set by default
|
|
13
|
+
# to 'similar'. Both can be changed in the configation below; the defaults
|
|
14
|
+
# are equivalent to specifying:
|
|
15
|
+
#
|
|
16
|
+
# prefetch_rows: 100
|
|
17
|
+
# cursor_sharing: similar
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
development:
|
|
21
|
+
adapter: oracle
|
|
22
|
+
database: <%= app_name %>_development
|
|
23
|
+
username: <%= app_name %>
|
|
24
|
+
password:
|
|
25
|
+
|
|
26
|
+
# Warning: The database defined as "test" will be erased and
|
|
27
|
+
# re-generated from your development database when you run "rake".
|
|
28
|
+
# Do not set this db to the same as development or production.
|
|
29
|
+
test:
|
|
30
|
+
adapter: oracle
|
|
31
|
+
database: <%= app_name %>_test
|
|
32
|
+
username: <%= app_name %>
|
|
33
|
+
password:
|
|
34
|
+
|
|
35
|
+
production:
|
|
36
|
+
adapter: oracle
|
|
37
|
+
database: <%= app_name %>_production
|
|
38
|
+
username: <%= app_name %>
|
|
39
|
+
password:
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# PostgreSQL. Versions 7.4 and 8.x are supported.
|
|
2
|
+
#
|
|
3
|
+
# Install the ruby-postgres driver:
|
|
4
|
+
# gem install ruby-postgres
|
|
5
|
+
# On Mac OS X:
|
|
6
|
+
# gem install ruby-postgres -- --include=/usr/local/pgsql
|
|
7
|
+
# On Windows:
|
|
8
|
+
# gem install ruby-postgres
|
|
9
|
+
# Choose the win32 build.
|
|
10
|
+
# Install PostgreSQL and put its /bin directory on your path.
|
|
11
|
+
development:
|
|
12
|
+
adapter: postgresql
|
|
13
|
+
encoding: unicode
|
|
14
|
+
database: <%= app_name %>_development
|
|
15
|
+
username: <%= app_name %>
|
|
16
|
+
password:
|
|
17
|
+
|
|
18
|
+
# Connect on a TCP socket. Omitted by default since the client uses a
|
|
19
|
+
# domain socket that doesn't need configuration. Windows does not have
|
|
20
|
+
# domain sockets, so uncomment these lines.
|
|
21
|
+
#host: localhost
|
|
22
|
+
#port: 5432
|
|
23
|
+
|
|
24
|
+
# Schema search path. The server defaults to $user,public
|
|
25
|
+
#schema_search_path: myapp,sharedapp,public
|
|
26
|
+
|
|
27
|
+
# Minimum log levels, in increasing order:
|
|
28
|
+
# debug5, debug4, debug3, debug2, debug1,
|
|
29
|
+
# log, notice, warning, error, fatal, and panic
|
|
30
|
+
# The server defaults to notice.
|
|
31
|
+
#min_messages: warning
|
|
32
|
+
|
|
33
|
+
# Warning: The database defined as "test" will be erased and
|
|
34
|
+
# re-generated from your development database when you run "rake".
|
|
35
|
+
# Do not set this db to the same as development or production.
|
|
36
|
+
test:
|
|
37
|
+
adapter: postgresql
|
|
38
|
+
encoding: unicode
|
|
39
|
+
database: <%= app_name %>_test
|
|
40
|
+
username: <%= app_name %>
|
|
41
|
+
password:
|
|
42
|
+
|
|
43
|
+
production:
|
|
44
|
+
adapter: postgresql
|
|
45
|
+
encoding: unicode
|
|
46
|
+
database: <%= app_name %>_production
|
|
47
|
+
username: <%= app_name %>
|
|
48
|
+
password:
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SQLite version 2.x
|
|
2
|
+
# gem install sqlite-ruby
|
|
3
|
+
development:
|
|
4
|
+
adapter: sqlite
|
|
5
|
+
database: db/development.sqlite2
|
|
6
|
+
|
|
7
|
+
# Warning: The database defined as "test" will be erased and
|
|
8
|
+
# re-generated from your development database when you run "rake".
|
|
9
|
+
# Do not set this db to the same as development or production.
|
|
10
|
+
test:
|
|
11
|
+
adapter: sqlite
|
|
12
|
+
database: db/test.sqlite2
|
|
13
|
+
|
|
14
|
+
production:
|
|
15
|
+
adapter: sqlite
|
|
16
|
+
database: db/production.sqlite2
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SQLite version 3.x
|
|
2
|
+
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
|
3
|
+
development:
|
|
4
|
+
adapter: sqlite3
|
|
5
|
+
database: db/development.sqlite3
|
|
6
|
+
timeout: 5000
|
|
7
|
+
|
|
8
|
+
# Warning: The database defined as "test" will be erased and
|
|
9
|
+
# re-generated from your development database when you run "rake".
|
|
10
|
+
# Do not set this db to the same as development or production.
|
|
11
|
+
test:
|
|
12
|
+
adapter: sqlite3
|
|
13
|
+
database: db/test.sqlite3
|
|
14
|
+
timeout: 5000
|
|
15
|
+
|
|
16
|
+
production:
|
|
17
|
+
adapter: sqlite3
|
|
18
|
+
database: db/production.sqlite3
|
|
19
|
+
timeout: 5000
|
data/configs/empty.log
ADDED
|
File without changes
|
|
@@ -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
|
+
# ActiveSupport::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,17 @@
|
|
|
1
|
+
# These settings change the behavior of Rails 2 apps and will be defaults
|
|
2
|
+
# for Rails 3. You can remove this initializer when Rails 3 is released.
|
|
3
|
+
|
|
4
|
+
if defined?(ActiveRecord)
|
|
5
|
+
# Include Active Record class name as root for JSON serialized output.
|
|
6
|
+
ActiveRecord::Base.include_root_in_json = true
|
|
7
|
+
|
|
8
|
+
# Store the full class name (including module namespace) in STI type column.
|
|
9
|
+
ActiveRecord::Base.store_full_sti_class = true
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Use ISO 8601 format for JSON serialized times and dates.
|
|
13
|
+
ActiveSupport.use_standard_json_time_format = true
|
|
14
|
+
|
|
15
|
+
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
|
|
16
|
+
# if you're including raw json in an HTML page.
|
|
17
|
+
ActiveSupport.escape_html_entities_in_json = false
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Default configuration file for the lighttpd web server
|
|
2
|
+
# Start using ./script/server lighttpd
|
|
3
|
+
|
|
4
|
+
server.bind = "0.0.0.0"
|
|
5
|
+
server.port = 3000
|
|
6
|
+
|
|
7
|
+
server.modules = ( "mod_rewrite", "mod_accesslog", "mod_fastcgi", "mod_compress", "mod_expire" )
|
|
8
|
+
|
|
9
|
+
server.error-handler-404 = "/dispatch.fcgi"
|
|
10
|
+
server.pid-file = CWD + "/tmp/pids/lighttpd.pid"
|
|
11
|
+
server.document-root = CWD + "/public/"
|
|
12
|
+
|
|
13
|
+
server.errorlog = CWD + "/log/lighttpd.error.log"
|
|
14
|
+
accesslog.filename = CWD + "/log/lighttpd.access.log"
|
|
15
|
+
|
|
16
|
+
url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
|
|
17
|
+
|
|
18
|
+
compress.filetype = ( "text/plain", "text/html", "text/css", "text/javascript" )
|
|
19
|
+
compress.cache-dir = CWD + "/tmp/cache"
|
|
20
|
+
|
|
21
|
+
expire.url = ( "/favicon.ico" => "access 3 days",
|
|
22
|
+
"/images/" => "access 3 days",
|
|
23
|
+
"/stylesheets/" => "access 3 days",
|
|
24
|
+
"/javascripts/" => "access 3 days" )
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# Change *-procs to 2 if you need to use Upload Progress or other tasks that
|
|
28
|
+
# *need* to execute a second request while the first is still pending.
|
|
29
|
+
fastcgi.server = ( ".fcgi" => ( "localhost" => (
|
|
30
|
+
"min-procs" => 1,
|
|
31
|
+
"max-procs" => 1,
|
|
32
|
+
"socket" => CWD + "/tmp/sockets/fcgi.socket",
|
|
33
|
+
"bin-path" => CWD + "/public/dispatch.fcgi",
|
|
34
|
+
"bin-environment" => ( "RAILS_ENV" => "development" )
|
|
35
|
+
) ) )
|
|
36
|
+
|
|
37
|
+
mimetype.assign = (
|
|
38
|
+
".css" => "text/css",
|
|
39
|
+
".gif" => "image/gif",
|
|
40
|
+
".htm" => "text/html",
|
|
41
|
+
".html" => "text/html",
|
|
42
|
+
".jpeg" => "image/jpeg",
|
|
43
|
+
".jpg" => "image/jpeg",
|
|
44
|
+
".js" => "text/javascript",
|
|
45
|
+
".png" => "image/png",
|
|
46
|
+
".swf" => "application/x-shockwave-flash",
|
|
47
|
+
".txt" => "text/plain"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
# Making sure file uploads above 64k always work when using IE or Safari
|
|
51
|
+
# For more information, see http://trac.lighttpd.net/trac/ticket/360
|
|
52
|
+
$HTTP["useragent"] =~ "^(.*MSIE.*)|(.*AppleWebKit.*)$" {
|
|
53
|
+
server.max-keep-alive-requests = 0
|
|
54
|
+
}
|
data/configs/routes.rb
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
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 with more complex sub-resources
|
|
22
|
+
# map.resources :products do |products|
|
|
23
|
+
# products.resources :comments
|
|
24
|
+
# products.resources :sales, :collection => { :recent => :get }
|
|
25
|
+
# end
|
|
26
|
+
|
|
27
|
+
# Sample resource route within a namespace:
|
|
28
|
+
# map.namespace :admin do |admin|
|
|
29
|
+
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
|
|
30
|
+
# admin.resources :products
|
|
31
|
+
# end
|
|
32
|
+
|
|
33
|
+
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
|
|
34
|
+
# map.root :controller => "welcome"
|
|
35
|
+
|
|
36
|
+
# See how all your routes lay out with "rake routes"
|
|
37
|
+
|
|
38
|
+
# Install the default routes as the lowest priority.
|
|
39
|
+
# Note: These default routes make all actions in every controller accessible via GET requests. You should
|
|
40
|
+
# consider removing the them or commenting them out if you're using named routes and resources.
|
|
41
|
+
map.connect ':controller/:action/:id'
|
|
42
|
+
map.connect ':controller/:action/:id.:format'
|
|
43
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
#
|
|
3
|
+
# You may specify the path to the FastCGI crash log (a log of unhandled
|
|
4
|
+
# exceptions which forced the FastCGI instance to exit, great for debugging)
|
|
5
|
+
# and the number of requests to process before running garbage collection.
|
|
6
|
+
#
|
|
7
|
+
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
|
|
8
|
+
# and the GC period is nil (turned off). A reasonable number of requests
|
|
9
|
+
# could range from 10-100 depending on the memory footprint of your app.
|
|
10
|
+
#
|
|
11
|
+
# Example:
|
|
12
|
+
# # Default log path, normal GC behavior.
|
|
13
|
+
# RailsFCGIHandler.process!
|
|
14
|
+
#
|
|
15
|
+
# # Default log path, 50 requests between GC.
|
|
16
|
+
# RailsFCGIHandler.process! nil, 50
|
|
17
|
+
#
|
|
18
|
+
# # Custom log path, normal GC behavior.
|
|
19
|
+
# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
|
|
20
|
+
#
|
|
21
|
+
require File.dirname(__FILE__) + "/../config/environment"
|
|
22
|
+
require 'fcgi_handler'
|
|
23
|
+
|
|
24
|
+
RailsFCGIHandler.process!
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
|
|
3
|
+
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
|
|
4
|
+
|
|
5
|
+
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
|
|
6
|
+
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
|
|
7
|
+
require "dispatcher"
|
|
8
|
+
|
|
9
|
+
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
|
|
10
|
+
Dispatcher.dispatch
|