railties 3.0.0.beta3 → 3.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/README +118 -123
- data/guides/source/3_0_release_notes.textile +13 -11
- data/guides/source/action_controller_overview.textile +2 -2
- data/guides/source/action_mailer_basics.textile +70 -26
- data/guides/source/action_view_overview.textile +1 -1
- data/guides/source/active_record_basics.textile +9 -1
- data/guides/source/active_record_querying.textile +2 -2
- data/guides/source/active_support_core_extensions.textile +377 -9
- data/guides/source/activerecord_validations_callbacks.textile +98 -55
- data/guides/source/association_basics.textile +1 -1
- data/guides/source/caching_with_rails.textile +1 -1
- data/guides/source/command_line.textile +23 -23
- data/guides/source/configuring.textile +1 -3
- data/guides/source/contribute.textile +27 -28
- data/guides/source/credits.html.erb +4 -4
- data/guides/source/debugging_rails_applications.textile +2 -2
- data/guides/source/form_helpers.textile +7 -6
- data/guides/source/generators.textile +19 -29
- data/guides/source/getting_started.textile +106 -49
- data/guides/source/i18n.textile +27 -27
- data/guides/source/index.html.erb +18 -8
- data/guides/source/initialization.textile +140 -514
- data/guides/source/layout.html.erb +6 -4
- data/guides/source/layouts_and_rendering.textile +5 -5
- data/guides/source/migrations.textile +7 -3
- data/guides/source/nested_model_forms.textile +2 -2
- data/guides/source/performance_testing.textile +11 -12
- data/guides/source/plugins.textile +30 -30
- data/guides/source/rails_application_templates.textile +3 -3
- data/guides/source/rails_on_rack.textile +3 -66
- data/guides/source/routing.textile +10 -4
- data/guides/source/security.textile +1 -1
- data/guides/source/testing.textile +55 -52
- data/guides/w3c_validator.rb +67 -0
- data/lib/rails.rb +1 -0
- data/lib/rails/application.rb +49 -13
- data/lib/rails/application/bootstrap.rb +7 -6
- data/lib/rails/application/configuration.rb +24 -47
- data/lib/rails/application/finisher.rb +8 -3
- data/lib/rails/backtrace_cleaner.rb +11 -12
- data/lib/rails/commands.rb +54 -54
- data/lib/rails/commands/application.rb +7 -2
- data/lib/rails/commands/{performance/benchmarker.rb → benchmarker.rb} +0 -0
- data/lib/rails/commands/dbconsole.rb +4 -3
- data/lib/rails/commands/destroy.rb +1 -0
- data/lib/rails/commands/generate.rb +1 -0
- data/lib/rails/commands/{performance/profiler.rb → profiler.rb} +0 -0
- data/lib/rails/commands/runner.rb +4 -2
- data/lib/rails/configuration.rb +36 -0
- data/lib/rails/engine.rb +24 -24
- data/lib/rails/engine/configuration.rb +0 -1
- data/lib/rails/generators.rb +48 -10
- data/lib/rails/generators/actions.rb +5 -3
- data/lib/rails/generators/base.rb +23 -17
- data/lib/rails/generators/erb/scaffold/templates/_form.html.erb +9 -8
- data/lib/rails/generators/erb/scaffold/templates/show.html.erb +1 -1
- data/lib/rails/generators/generated_attribute.rb +7 -6
- data/lib/rails/generators/rails/app/USAGE +2 -2
- data/lib/rails/generators/rails/app/app_generator.rb +242 -97
- data/lib/rails/generators/rails/app/templates/Gemfile +3 -0
- data/lib/rails/generators/rails/app/templates/README +167 -130
- data/lib/rails/generators/rails/app/templates/Rakefile +0 -3
- data/lib/rails/generators/rails/app/templates/config/boot.rb +9 -2
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +5 -5
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +4 -0
- data/lib/rails/generators/rails/app/templates/script/rails +2 -5
- data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -3
- data/lib/rails/generators/rails/stylesheets/templates/scaffold.css +5 -9
- data/lib/rails/generators/test_case.rb +12 -0
- data/lib/rails/generators/test_unit/integration/templates/integration_test.rb +1 -1
- data/lib/rails/generators/test_unit/performance/templates/performance_test.rb +1 -1
- data/lib/rails/info.rb +0 -33
- data/lib/rails/log_subscriber.rb +13 -6
- data/lib/rails/rack/logger.rb +4 -3
- data/lib/rails/railtie.rb +4 -0
- data/lib/rails/railtie/configuration.rb +21 -4
- data/lib/rails/tasks/documentation.rake +2 -0
- data/lib/rails/tasks/framework.rake +22 -0
- data/lib/rails/tasks/middleware.rake +1 -1
- data/lib/rails/tasks/routes.rake +5 -1
- data/lib/rails/test_help.rb +3 -1
- data/lib/rails/test_unit/testing.rake +3 -1
- data/lib/rails/version.rb +1 -1
- metadata +12 -19
- data/lib/rails/application/metal_loader.rb +0 -50
- data/lib/rails/dispatcher.rb +0 -24
- data/lib/rails/generators/rails/mailer/USAGE +0 -15
- data/lib/rails/generators/rails/mailer/mailer_generator.rb +0 -14
- data/lib/rails/generators/rails/mailer/templates/mailer.rb +0 -16
- data/lib/rails/generators/rails/metal/USAGE +0 -8
- data/lib/rails/generators/rails/metal/metal_generator.rb +0 -11
- data/lib/rails/generators/rails/metal/templates/metal.rb +0 -12
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'action_dispatch'
|
2
|
-
|
3
|
-
module Rails
|
4
|
-
class Application
|
5
|
-
class MetalLoader
|
6
|
-
attr_reader :paths, :metals
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
@paths, @metals = [], []
|
10
|
-
end
|
11
|
-
|
12
|
-
def build_middleware(list=nil)
|
13
|
-
load_metals!(list)
|
14
|
-
self
|
15
|
-
end
|
16
|
-
|
17
|
-
def new(app)
|
18
|
-
ActionDispatch::Cascade.new(@metals, app)
|
19
|
-
end
|
20
|
-
|
21
|
-
def name
|
22
|
-
ActionDispatch::Cascade.name
|
23
|
-
end
|
24
|
-
alias :to_s :name
|
25
|
-
|
26
|
-
protected
|
27
|
-
|
28
|
-
def load_metals!(list)
|
29
|
-
metals = []
|
30
|
-
list = Array(list || :all).map(&:to_sym)
|
31
|
-
|
32
|
-
paths.each do |path|
|
33
|
-
matcher = /\A#{Regexp.escape(path)}\/(.*)\.rb\Z/
|
34
|
-
Dir.glob("#{path}/**/*.rb").sort.each do |metal_path|
|
35
|
-
metal = metal_path.sub(matcher, '\1').to_sym
|
36
|
-
next unless list.include?(metal) || list.include?(:all)
|
37
|
-
require_dependency metal.to_s
|
38
|
-
metals << metal
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
metals = metals.sort_by do |m|
|
43
|
-
[list.index(m) || list.index(:all), m.to_s]
|
44
|
-
end
|
45
|
-
|
46
|
-
@metals = metals.map { |m| m.to_s.camelize.constantize }
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
data/lib/rails/dispatcher.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2004-2010 David Heinemeier Hansson
|
3
|
-
#
|
4
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
# a copy of this software and associated documentation files (the
|
6
|
-
# "Software"), to deal in the Software without restriction, including
|
7
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
# the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be
|
13
|
-
# included in all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
-
#++
|
23
|
-
require 'action_controller/deprecated/dispatcher'
|
24
|
-
Dispatcher = ActionController::Dispatcher
|
@@ -1,15 +0,0 @@
|
|
1
|
-
Description:
|
2
|
-
Stubs out a new mailer and its views. Pass the mailer name, either
|
3
|
-
CamelCased or under_scored, and an optional list of emails as arguments.
|
4
|
-
|
5
|
-
This generates a mailer class in app/mailers and invokes your template
|
6
|
-
engine and test framework generators.
|
7
|
-
|
8
|
-
Example:
|
9
|
-
`rails generate mailer Notifications signup forgot_password invoice`
|
10
|
-
|
11
|
-
creates a Notifications mailer class, views, test, and fixtures:
|
12
|
-
Mailer: app/mailers/notifications.rb
|
13
|
-
Views: app/views/notifications/signup.erb [...]
|
14
|
-
Test: test/functional/notifications_test.rb
|
15
|
-
Fixtures: test/fixtures/notifications/signup [...]
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module Rails
|
2
|
-
module Generators
|
3
|
-
class MailerGenerator < NamedBase
|
4
|
-
argument :actions, :type => :array, :default => [], :banner => "method method"
|
5
|
-
check_class_collision
|
6
|
-
|
7
|
-
def create_mailer_file
|
8
|
-
template "mailer.rb", File.join('app/mailers', class_path, "#{file_name}.rb")
|
9
|
-
end
|
10
|
-
|
11
|
-
hook_for :template_engine, :test_framework
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class <%= class_name %> < ActionMailer::Base
|
2
|
-
default :from => "from@example.com"
|
3
|
-
<% for action in actions -%>
|
4
|
-
|
5
|
-
# Subject can be set in your I18n file at config/locales/en.yml
|
6
|
-
# with the following lookup:
|
7
|
-
#
|
8
|
-
# en.actionmailer.<%= file_name %>.<%= action %>.subject
|
9
|
-
#
|
10
|
-
def <%= action %>
|
11
|
-
@greeting = "Hi"
|
12
|
-
|
13
|
-
mail :to => "to@example.org"
|
14
|
-
end
|
15
|
-
<% end -%>
|
16
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# Allow the metal piece to run in isolation
|
2
|
-
require File.expand_path('../../../config/environment', __FILE__) unless defined?(Rails)
|
3
|
-
|
4
|
-
class <%= class_name %>
|
5
|
-
def self.call(env)
|
6
|
-
if env["PATH_INFO"] =~ /^\/<%= file_name %>/
|
7
|
-
[200, {"Content-Type" => "text/html"}, ["Hello, World!"]]
|
8
|
-
else
|
9
|
-
[404, {"Content-Type" => "text/html", "X-Cascade" => "pass"}, ["Not Found"]]
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|