Revision: 856
http://crackerjack.svn.sourceforge.net/crackerjack/?rev=856&view=rev
Author: znz
Date: 2009-03-19 08:03:56 +0000 (Thu, 19 Mar 2009)
Log Message:
-----------
merge diff of generated between rails 2.2.2 and 2.3.2
Modified Paths:
--------------
trunk/viewsite/README
trunk/viewsite/app/controllers/application_controller.rb
trunk/viewsite/config/environment.rb
trunk/viewsite/config/environments/production.rb
trunk/viewsite/config/environments/test.rb
trunk/viewsite/config/initializers/inflections.rb
trunk/viewsite/doc/README_FOR_APP
trunk/viewsite/public/500.html
trunk/viewsite/public/images/rails.png
trunk/viewsite/test/test_helper.rb
Added Paths:
-----------
trunk/viewsite/config/initializers/backtrace_silencers.rb
trunk/viewsite/config/initializers/new_rails_defaults.rb
trunk/viewsite/config/initializers/session_store.rb
trunk/viewsite/config.ru
trunk/viewsite/public/index.html
Removed Paths:
-------------
trunk/viewsite/public/dispatch.cgi
trunk/viewsite/public/dispatch.fcgi
trunk/viewsite/public/dispatch.rb
trunk/viewsite/script/performance/request
trunk/viewsite/script/process/
Modified: trunk/viewsite/README
===================================================================
--- trunk/viewsite/README 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/README 2009-03-19 08:03:56 UTC (rev 856)
@@ -1,15 +1,15 @@
== Welcome to Rails
-Rails is a web-application and persistence framework that includes everything
-needed to create database-backed web-applications according to the
-Model-View-Control pattern of separation. This pattern splits the view (also
-called the presentation) into "dumb" templates that are primarily responsible
-for inserting pre-built data in between HTML tags. The model contains the
-"smart" domain objects (such as Account, Product, Person, Post) that holds all
-the business logic and knows how to persist themselves to a database. The
-controller handles the incoming requests (such as Save New Account, Update
-Product, Show Post) by manipulating the model and directing data to the view.
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
+This pattern splits the view (also called the presentation) into "dumb" templates
+that are primarily responsible for inserting pre-built data in between HTML tags.
+The model contains the "smart" domain objects (such as Account, Product, Person,
+Post) that holds all the business logic and knows how to persist themselves to
+a database. The controller handles the incoming requests (such as Save New Account,
+Update Product, Show Post) by manipulating the model and directing data to the view.
+
In Rails, the model is handled by what's called an object-relational mapping
layer entitled Active Record. This layer allows you to present the data from
database rows as objects and embellish these data objects with business logic
@@ -29,39 +29,69 @@
1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
and your application name. Ex: rails myapp
- (If you've downloaded Rails in a complete tgz or zip, this step is already done)
2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
-3. Go to http://localhost:3000/ and get "Welcome aboard: You’re riding the Rails!"
+3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
4. Follow the guidelines to start developing your application
== Web Servers
-By default, Rails will try to use Mongrel and lighttpd if they are installed, otherwise
-Rails will use WEBrick, the webserver that ships with Ruby. When you run script/server,
-Rails will check if Mongrel exists, then lighttpd and finally fall back to WEBrick. This ensures
-that you can always get up and running quickly.
+By default, Rails will try to use Mongrel if it's are installed when started with script/server, otherwise Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
+with a variety of other web servers.
Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
More info at: http://mongrel.rubyforge.org
-If Mongrel is not installed, Rails will look for lighttpd. It's considerably faster than
-Mongrel and WEBrick and also suited for production use, but requires additional
-installation and currently only works well on OS X/Unix (Windows users are encouraged
-to start with Mongrel). We recommend version 1.4.11 and higher. You can download it from
-http://www.lighttpd.net.
+Say other Ruby web servers like Thin and Ebb or regular web servers like Apache or LiteSpeed or
+Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
+FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.
-And finally, if neither Mongrel or lighttpd are installed, Rails will use the built-in Ruby
-web server, WEBrick. WEBrick is a small Ruby web server suitable for development, but not
-for production.
+== Apache .htaccess example for FCGI/CGI
-But of course its also possible to run Rails on any platform that supports FCGI.
-Apache, LiteSpeed, IIS are just a few. For more information on FCGI,
-please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI
+# General Apache options
+AddHandler fastcgi-script .fcgi
+AddHandler cgi-script .cgi
+Options +FollowSymLinks +ExecCGI
+# If you don't want Rails to look in certain directories,
+# use the following rewrite rules so that Apache won't rewrite certain requests
+#
+# Example:
+# RewriteCond %{REQUEST_URI} ^/notrails.*
+# RewriteRule .* - [L]
+# Redirect all requests not available on the filesystem to Rails
+# By default the cgi dispatcher is used which is very slow
+#
+# For better performance replace the dispatcher with the fastcgi one
+#
+# Example:
+# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
+RewriteEngine On
+
+# If your Rails application is accessed via an Alias directive,
+# then you MUST also set the RewriteBase in this htaccess file.
+#
+# Example:
+# Alias /myrailsapp /path/to/myrailsapp/public
+# RewriteBase /myrailsapp
+
+RewriteRule ^$ index.html [QSA]
+RewriteRule ^([^.]+)$ $1.html [QSA]
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
+
+# In case Rails experiences terminal errors
+# Instead of displaying this message you can supply a file here which will be rendered instead
+#
+# Example:
+# ErrorDocument 500 /500.html
+
+ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
+
+
== Debugging Rails
Sometimes your application goes wrong. Fortunately there are a lot of tools that
@@ -102,7 +132,9 @@
Debugger support is available through the debugger command when you start your Mongrel or
Webrick server with --debugger. This means that you can break out of execution at any point
-in the code, investigate and change the model, AND then resume execution! Example:
+in the code, investigate and change the model, AND then resume execution!
+You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
+Example:
class WeblogController < ActionController::Base
def index
@@ -140,7 +172,14 @@
To reload your controllers and models after launching the console run <tt>reload!</tt>
+== dbconsole
+You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
+You would be connected to the database with the credentials defined in database.yml.
+Starting the script without arguments will connect you to the development database. Passing an
+argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
+Currently works for mysql, postgresql and sqlite.
+
== Description of Contents
app
@@ -157,13 +196,13 @@
app/views
Holds the template files for the view that should be named like
- weblogs/index.erb for the WeblogsController#index action. All views use eRuby
+ weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
syntax.
app/views/layouts
Holds the template files for layouts to be used with views. This models the common
header/footer method of wrapping views. In your views, define a layout using the
- <tt>layout :default</tt> and create a file named default.erb. Inside default.erb,
+ <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
call <% yield %> to render the view using this layout.
app/helpers
@@ -200,4 +239,5 @@
vendor
External libraries that the application depends on. Also includes the plugins subdirectory.
+ If the app has frozen rails, those gems also go here, under vendor/rails/.
This directory is in the load path.
Modified: trunk/viewsite/app/controllers/application_controller.rb
===================================================================
--- trunk/viewsite/app/controllers/application_controller.rb 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/app/controllers/application_controller.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -3,10 +3,10 @@
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
+ protect_from_forgery # See ActionController::RequestForgeryProtection for details
- # See ActionController::RequestForgeryProtection for details
- # Uncomment the :secret if you're not using the cookie session store
- protect_from_forgery # :secret => 'a1fa903c40853ae126cd5743e772b00b'
+ # Scrub sensitive parameters from your log
+ # filter_parameter_logging :password
# do not use session as default
#session :disabled => true
Modified: trunk/viewsite/config/environment.rb
===================================================================
--- trunk/viewsite/config/environment.rb 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/config/environment.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -1,93 +1,42 @@
# Be sure to restart your server when you modify this file
-# Uncomment below to force Rails into production mode when
-# you don't control web/app server and can't set it the proper way
-# ENV['RAILS_ENV'] ||= 'production'
-
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
-secret = nil
-secret_path = Pathname.new(RAILS_ROOT) + 'config/secret.txt'
-begin
- secret = secret_path.read.chomp
-rescue Errno::ENOENT
- begin
- require "securerandom"
- rescue LoadError
- # copy from ruby_1_8
- require "fallback/securerandom"
- end
- secret_path.open("wb", 0600) do |f|
- f.write SecureRandom.hex(64)
- end
- retry
-end
-
Rails::Initializer.run do |config|
# 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.
- # See Rails::Configuration for more options.
- # Skip frameworks you're not going to use. To use Rails without a database
- # you must remove the Active Record framework.
- #config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
- config.frameworks -= [ :action_mailer ]
+ # Add additional load paths for your own custom dirs
+ # config.load_paths += %W( #{RAILS_ROOT}/extras )
- # Specify gems that this application depends on.
- # They can then be installed with "rake gems:install" on new installations.
- # You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (sqlite3)
+ # Specify gems that this application depends on and have them installed with rake gems:install
# config.gem "bj"
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "sqlite3-ruby", :lib => "sqlite3"
# config.gem "aws-s3", :lib => "aws/s3"
- # Only load the plugins named here, in the order given. By default, all plugins
- # in vendor/plugins are loaded in alphabetical order.
+ # 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 ]
- # Add additional load paths for your own custom dirs
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
+ # Skip frameworks you're not going to use. To use Rails without a database,
+ # you must remove the Active Record framework.
+ # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
+ config.frameworks -= [ :action_mailer ]
- # Force all environments to use the same logger level
- # (by default production uses :info, the others :debug)
- # config.log_level = :debug
+ # Activate observers that should always be running
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
- # Make Time.zone default to the specified zone, and make Active Record store time values
- # in the database in UTC, and return them converted to the specified local zone.
- # Run "rake -D time" for a list of tasks for finding time zone names. Comment line to use default local time.
+ # 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.
config.time_zone = 'UTC'
- # The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
- # All files from config/locales/*.rb,yml are added automatically.
- # config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')]
+ # 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}')]
# config.i18n.default_locale = :de
-
- # Your secret key for verifying cookie session data integrity.
- # If you change this key, all old sessions 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.
- config.action_controller.session = {
- :session_key => '_crackerjack_session',
- :secret => secret
- }
-
- # 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")
- # config.action_controller.session_store = :active_record_store
-
- # 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
-
- # Activate observers that should always be running
- # Please note that observers generated using script/generate observer need to have an _observer suffix
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
end
Modified: trunk/viewsite/config/environments/production.rb
===================================================================
--- trunk/viewsite/config/environments/production.rb 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/config/environments/production.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -4,18 +4,25 @@
# Code is not reloaded between requests
config.cache_classes = true
-# Enable threaded mode
-# config.threadsafe!
+# Full error reports are disabled and caching is turned on
+config.action_controller.consider_all_requests_local = false
+config.action_controller.perform_caching = true
+config.action_view.cache_template_loading = true
+# See everything in the log (default is :info)
+# config.log_level = :debug
+
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
-# Full error reports are disabled and caching is turned on
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
+# 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"
+# config.action_controller.asset_host = "http://assets.example.com"
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
+
+# Enable threaded mode
+# config.threadsafe!
Modified: trunk/viewsite/config/environments/test.rb
===================================================================
--- trunk/viewsite/config/environments/test.rb 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/config/environments/test.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -12,11 +12,17 @@
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
+config.action_view.cache_template_loading = true
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
-# Tell ActionMailer not to deliver emails to the real world.
+# 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
+
+# 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
Added: trunk/viewsite/config/initializers/backtrace_silencers.rb
===================================================================
--- trunk/viewsite/config/initializers/backtrace_silencers.rb (rev 0)
+++ trunk/viewsite/config/initializers/backtrace_silencers.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# 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!
\ No newline at end of file
Modified: trunk/viewsite/config/initializers/inflections.rb
===================================================================
--- trunk/viewsite/config/initializers/inflections.rb 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/config/initializers/inflections.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -2,7 +2,7 @@
# Add new inflection rules using the following format
# (all these examples are active by default):
-# Inflector.inflections do |inflect|
+# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
Added: trunk/viewsite/config/initializers/new_rails_defaults.rb
===================================================================
--- trunk/viewsite/config/initializers/new_rails_defaults.rb (rev 0)
+++ trunk/viewsite/config/initializers/new_rails_defaults.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -0,0 +1,19 @@
+# Be sure to restart your server when you modify this file.
+
+# These settings change the behavior of Rails 2 apps and will be defaults
+# for Rails 3. You can remove this initializer when Rails 3 is released.
+
+if defined?(ActiveRecord)
+ # Include Active Record class name as root for JSON serialized output.
+ ActiveRecord::Base.include_root_in_json = true
+
+ # Store the full class name (including module namespace) in STI type column.
+ ActiveRecord::Base.store_full_sti_class = true
+end
+
+# Use ISO 8601 format for JSON serialized times and dates.
+ActiveSupport.use_standard_json_time_format = true
+
+# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
+# if you're including raw json in an HTML page.
+ActiveSupport.escape_html_entities_in_json = false
\ No newline at end of file
Added: trunk/viewsite/config/initializers/session_store.rb
===================================================================
--- trunk/viewsite/config/initializers/session_store.rb (rev 0)
+++ trunk/viewsite/config/initializers/session_store.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -0,0 +1,32 @@
+# Be sure to restart your server when you modify this file.
+
+secret = nil
+secret_path = Pathname.new(RAILS_ROOT) + 'config/secret.txt'
+begin
+ secret = secret_path.read.chomp
+rescue Errno::ENOENT
+ begin
+ require "securerandom"
+ rescue LoadError
+ # copy from ruby_1_8
+ require "fallback/securerandom"
+ end
+ secret_path.open("wb", 0600) do |f|
+ f.write SecureRandom.hex(64)
+ end
+ retry
+end
+
+# Your secret key for verifying cookie session data integrity.
+# If you change this key, all old sessions 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.
+ActionController::Base.session = {
+ :key => '_crackerjack_session',
+ :secret => secret
+}
+
+# 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")
+# ActionController::Base.session_store = :active_record_store
Added: trunk/viewsite/config.ru
===================================================================
--- trunk/viewsite/config.ru (rev 0)
+++ trunk/viewsite/config.ru 2009-03-19 08:03:56 UTC (rev 856)
@@ -0,0 +1,7 @@
+# Rack Dispatcher
+
+# Require your environment file to bootstrap Rails
+require File.dirname(__FILE__) + '/config/environment'
+
+# Dispatch the request
+run ActionController::Dispatcher.new
Modified: trunk/viewsite/doc/README_FOR_APP
===================================================================
--- trunk/viewsite/doc/README_FOR_APP 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/doc/README_FOR_APP 2009-03-19 08:03:56 UTC (rev 856)
@@ -1,5 +1,2 @@
-To build the guides:
-
-* Install source-highlighter (http://www.gnu.org/software/src-highlite/source-highlight.html)
-* Install the mizuho gem (http://github.com/FooBarWidget/mizuho/tree/master)
-* Run `rake guides` from the railties directory
\ No newline at end of file
+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.
Modified: trunk/viewsite/public/500.html
===================================================================
--- trunk/viewsite/public/500.html 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/public/500.html 2009-03-19 08:03:56 UTC (rev 856)
@@ -25,9 +25,6 @@
<div class="dialog">
<h1>We're sorry, but something went wrong.</h1>
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
- <p><small>(If you're the administrator of this website, then please read
- the log file "<%=h RAILS_ENV %>.log"
- to find out what went wrong.)</small></p>
</div>
</body>
</html>
Deleted: trunk/viewsite/public/dispatch.cgi
===================================================================
--- trunk/viewsite/public/dispatch.cgi 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/public/dispatch.cgi 2009-03-19 08:03:56 UTC (rev 856)
@@ -1,10 +0,0 @@
-#!/home/kazu/opt/ruby18/bin/ruby18
-
-require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
-
-# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
-# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
-require "dispatcher"
-
-ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch
Deleted: trunk/viewsite/public/dispatch.fcgi
===================================================================
--- trunk/viewsite/public/dispatch.fcgi 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/public/dispatch.fcgi 2009-03-19 08:03:56 UTC (rev 856)
@@ -1,24 +0,0 @@
-#!/home/kazu/opt/ruby18/bin/ruby18
-#
-# You may specify the path to the FastCGI crash log (a log of unhandled
-# exceptions which forced the FastCGI instance to exit, great for debugging)
-# and the number of requests to process before running garbage collection.
-#
-# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
-# and the GC period is nil (turned off). A reasonable number of requests
-# could range from 10-100 depending on the memory footprint of your app.
-#
-# Example:
-# # Default log path, normal GC behavior.
-# RailsFCGIHandler.process!
-#
-# # Default log path, 50 requests between GC.
-# RailsFCGIHandler.process! nil, 50
-#
-# # Custom log path, normal GC behavior.
-# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
-#
-require File.dirname(__FILE__) + "/../config/environment"
-require 'fcgi_handler'
-
-RailsFCGIHandler.process!
Deleted: trunk/viewsite/public/dispatch.rb
===================================================================
--- trunk/viewsite/public/dispatch.rb 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/public/dispatch.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -1,10 +0,0 @@
-#!/home/kazu/opt/ruby18/bin/ruby18
-
-require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
-
-# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
-# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
-require "dispatcher"
-
-ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch
Modified: trunk/viewsite/public/images/rails.png
===================================================================
(Binary files differ)
Added: trunk/viewsite/public/index.html
===================================================================
--- trunk/viewsite/public/index.html (rev 0)
+++ trunk/viewsite/public/index.html 2009-03-19 08:03:56 UTC (rev 856)
@@ -0,0 +1,275 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title>Ruby on Rails: Welcome aboard</title>
+ <style type="text/css" media="screen">
+ body {
+ margin: 0;
+ margin-bottom: 25px;
+ padding: 0;
+ background-color: #f0f0f0;
+ font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
+ font-size: 13px;
+ color: #333;
+ }
+
+ h1 {
+ font-size: 28px;
+ color: #000;
+ }
+
+ a {color: #03c}
+ a:hover {
+ background-color: #03c;
+ color: white;
+ text-decoration: none;
+ }
+
+
+ #page {
+ background-color: #f0f0f0;
+ width: 750px;
+ margin: 0;
+ margin-left: auto;
+ margin-right: auto;
+ }
+
+ #content {
+ float: left;
+ background-color: white;
+ border: 3px solid #aaa;
+ border-top: none;
+ padding: 25px;
+ width: 500px;
+ }
+
+ #sidebar {
+ float: right;
+ width: 175px;
+ }
+
+ #footer {
+ clear: both;
+ }
+
+
+ #header, #about, #getting-started {
+ padding-left: 75px;
+ padding-right: 30px;
+ }
+
+
+ #header {
+ background-image: url("images/rails.png");
+ background-repeat: no-repeat;
+ background-position: top left;
+ height: 64px;
+ }
+ #header h1, #header h2 {margin: 0}
+ #header h2 {
+ color: #888;
+ font-weight: normal;
+ font-size: 16px;
+ }
+
+
+ #about h3 {
+ margin: 0;
+ margin-bottom: 10px;
+ font-size: 14px;
+ }
+
+ #about-content {
+ background-color: #ffd;
+ border: 1px solid #fc0;
+ margin-left: -11px;
+ }
+ #about-content table {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ font-size: 11px;
+ border-collapse: collapse;
+ }
+ #about-content td {
+ padding: 10px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ }
+ #about-content td.name {color: #555}
+ #about-content td.value {color: #000}
+
+ #about-content.failure {
+ background-color: #fcc;
+ border: 1px solid #f00;
+ }
+ #about-content.failure p {
+ margin: 0;
+ padding: 10px;
+ }
+
+
+ #getting-started {
+ border-top: 1px solid #ccc;
+ margin-top: 25px;
+ padding-top: 15px;
+ }
+ #getting-started h1 {
+ margin: 0;
+ font-size: 20px;
+ }
+ #getting-started h2 {
+ margin: 0;
+ font-size: 14px;
+ font-weight: normal;
+ color: #333;
+ margin-bottom: 25px;
+ }
+ #getting-started ol {
+ margin-left: 0;
+ padding-left: 0;
+ }
+ #getting-started li {
+ font-size: 18px;
+ color: #888;
+ margin-bottom: 25px;
+ }
+ #getting-started li h2 {
+ margin: 0;
+ font-weight: normal;
+ font-size: 18px;
+ color: #333;
+ }
+ #getting-started li p {
+ color: #555;
+ font-size: 13px;
+ }
+
+
+ #search {
+ margin: 0;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ font-size: 11px;
+ }
+ #search input {
+ font-size: 11px;
+ margin: 2px;
+ }
+ #search-text {width: 170px}
+
+
+ #sidebar ul {
+ margin-left: 0;
+ padding-left: 0;
+ }
+ #sidebar ul h3 {
+ margin-top: 25px;
+ font-size: 16px;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #ccc;
+ }
+ #sidebar li {
+ list-style-type: none;
+ }
+ #sidebar ul.links li {
+ margin-bottom: 5px;
+ }
+
+ </style>
+ <script type="text/javascript" src="javascripts/prototype.js"></script>
+ <script type="text/javascript" src="javascripts/effects.js"></script>
+ <script type="text/javascript">
+ function about() {
+ if (Element.empty('about-content')) {
+ new Ajax.Updater('about-content', 'rails/info/properties', {
+ method: 'get',
+ onFailure: function() {Element.classNames('about-content').add('failure')},
+ onComplete: function() {new Effect.BlindDown('about-content', {duration: 0.25})}
+ });
+ } else {
+ new Effect[Element.visible('about-content') ?
+ 'BlindUp' : 'BlindDown']('about-content', {duration: 0.25});
+ }
+ }
+
+ window.onload = function() {
+ $('search-text').value = '';
+ $('search').onsubmit = function() {
+ $('search-text').value = 'site:rubyonrails.org ' + $F('search-text');
+ }
+ }
+ </script>
+ </head>
+ <body>
+ <div id="page">
+ <div id="sidebar">
+ <ul id="sidebar-items">
+ <li>
+ <form id="search" action="http://www.google.com/search" method="get">
+ <input type="hidden" name="hl" value="en" />
+ <input type="text" id="search-text" name="q" value="site:rubyonrails.org " />
+ <input type="submit" value="Search" /> the Rails site
+ </form>
+ </li>
+
+ <li>
+ <h3>Join the community</h3>
+ <ul class="links">
+ <li><a href="http://www.rubyonrails.org/">Ruby on Rails</a></li>
+ <li><a href="http://weblog.rubyonrails.org/">Official weblog</a></li>
+ <li><a href="http://wiki.rubyonrails.org/">Wiki</a></li>
+ </ul>
+ </li>
+
+ <li>
+ <h3>Browse the documentation</h3>
+ <ul class="links">
+ <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
+ <li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
+ <li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
+ <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+
+ <div id="content">
+ <div id="header">
+ <h1>Welcome aboard</h1>
+ <h2>You’re riding Ruby on Rails!</h2>
+ </div>
+
+ <div id="about">
+ <h3><a href="rails/info/properties" onclick="about(); return false">About your application’s environment</a></h3>
+ <div id="about-content" style="display: none"></div>
+ </div>
+
+ <div id="getting-started">
+ <h1>Getting started</h1>
+ <h2>Here’s how to get rolling:</h2>
+
+ <ol>
+ <li>
+ <h2>Use <tt>script/generate</tt> to create your models and controllers</h2>
+ <p>To see all available options, run it without parameters.</p>
+ </li>
+
+ <li>
+ <h2>Set up a default route and remove or rename this file</h2>
+ <p>Routes are set up in config/routes.rb.</p>
+ </li>
+
+ <li>
+ <h2>Create your database</h2>
+ <p>Run <tt>rake db:migrate</tt> to create your database. If you're not using SQLite (the default), edit <tt>config/database.yml</tt> with your username and password.</p>
+ </li>
+ </ol>
+ </div>
+ </div>
+
+ <div id="footer"> </div>
+ </div>
+ </body>
+</html>
\ No newline at end of file
Deleted: trunk/viewsite/script/performance/request
===================================================================
--- trunk/viewsite/script/performance/request 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/script/performance/request 2009-03-19 08:03:56 UTC (rev 856)
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/performance/request'
Modified: trunk/viewsite/test/test_helper.rb
===================================================================
--- trunk/viewsite/test/test_helper.rb 2009-03-19 07:08:13 UTC (rev 855)
+++ trunk/viewsite/test/test_helper.rb 2009-03-19 08:03:56 UTC (rev 856)
@@ -8,7 +8,7 @@
# ignore
end
-class Test::Unit::TestCase
+class ActiveSupport::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test database remains unchanged so your fixtures don't have to be reloaded
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|