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.
Files changed (93) hide show
  1. data/CHANGELOG +5 -0
  2. data/README +118 -123
  3. data/guides/source/3_0_release_notes.textile +13 -11
  4. data/guides/source/action_controller_overview.textile +2 -2
  5. data/guides/source/action_mailer_basics.textile +70 -26
  6. data/guides/source/action_view_overview.textile +1 -1
  7. data/guides/source/active_record_basics.textile +9 -1
  8. data/guides/source/active_record_querying.textile +2 -2
  9. data/guides/source/active_support_core_extensions.textile +377 -9
  10. data/guides/source/activerecord_validations_callbacks.textile +98 -55
  11. data/guides/source/association_basics.textile +1 -1
  12. data/guides/source/caching_with_rails.textile +1 -1
  13. data/guides/source/command_line.textile +23 -23
  14. data/guides/source/configuring.textile +1 -3
  15. data/guides/source/contribute.textile +27 -28
  16. data/guides/source/credits.html.erb +4 -4
  17. data/guides/source/debugging_rails_applications.textile +2 -2
  18. data/guides/source/form_helpers.textile +7 -6
  19. data/guides/source/generators.textile +19 -29
  20. data/guides/source/getting_started.textile +106 -49
  21. data/guides/source/i18n.textile +27 -27
  22. data/guides/source/index.html.erb +18 -8
  23. data/guides/source/initialization.textile +140 -514
  24. data/guides/source/layout.html.erb +6 -4
  25. data/guides/source/layouts_and_rendering.textile +5 -5
  26. data/guides/source/migrations.textile +7 -3
  27. data/guides/source/nested_model_forms.textile +2 -2
  28. data/guides/source/performance_testing.textile +11 -12
  29. data/guides/source/plugins.textile +30 -30
  30. data/guides/source/rails_application_templates.textile +3 -3
  31. data/guides/source/rails_on_rack.textile +3 -66
  32. data/guides/source/routing.textile +10 -4
  33. data/guides/source/security.textile +1 -1
  34. data/guides/source/testing.textile +55 -52
  35. data/guides/w3c_validator.rb +67 -0
  36. data/lib/rails.rb +1 -0
  37. data/lib/rails/application.rb +49 -13
  38. data/lib/rails/application/bootstrap.rb +7 -6
  39. data/lib/rails/application/configuration.rb +24 -47
  40. data/lib/rails/application/finisher.rb +8 -3
  41. data/lib/rails/backtrace_cleaner.rb +11 -12
  42. data/lib/rails/commands.rb +54 -54
  43. data/lib/rails/commands/application.rb +7 -2
  44. data/lib/rails/commands/{performance/benchmarker.rb → benchmarker.rb} +0 -0
  45. data/lib/rails/commands/dbconsole.rb +4 -3
  46. data/lib/rails/commands/destroy.rb +1 -0
  47. data/lib/rails/commands/generate.rb +1 -0
  48. data/lib/rails/commands/{performance/profiler.rb → profiler.rb} +0 -0
  49. data/lib/rails/commands/runner.rb +4 -2
  50. data/lib/rails/configuration.rb +36 -0
  51. data/lib/rails/engine.rb +24 -24
  52. data/lib/rails/engine/configuration.rb +0 -1
  53. data/lib/rails/generators.rb +48 -10
  54. data/lib/rails/generators/actions.rb +5 -3
  55. data/lib/rails/generators/base.rb +23 -17
  56. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb +9 -8
  57. data/lib/rails/generators/erb/scaffold/templates/show.html.erb +1 -1
  58. data/lib/rails/generators/generated_attribute.rb +7 -6
  59. data/lib/rails/generators/rails/app/USAGE +2 -2
  60. data/lib/rails/generators/rails/app/app_generator.rb +242 -97
  61. data/lib/rails/generators/rails/app/templates/Gemfile +3 -0
  62. data/lib/rails/generators/rails/app/templates/README +167 -130
  63. data/lib/rails/generators/rails/app/templates/Rakefile +0 -3
  64. data/lib/rails/generators/rails/app/templates/config/boot.rb +9 -2
  65. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +5 -5
  66. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +4 -0
  67. data/lib/rails/generators/rails/app/templates/script/rails +2 -5
  68. data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -3
  69. data/lib/rails/generators/rails/stylesheets/templates/scaffold.css +5 -9
  70. data/lib/rails/generators/test_case.rb +12 -0
  71. data/lib/rails/generators/test_unit/integration/templates/integration_test.rb +1 -1
  72. data/lib/rails/generators/test_unit/performance/templates/performance_test.rb +1 -1
  73. data/lib/rails/info.rb +0 -33
  74. data/lib/rails/log_subscriber.rb +13 -6
  75. data/lib/rails/rack/logger.rb +4 -3
  76. data/lib/rails/railtie.rb +4 -0
  77. data/lib/rails/railtie/configuration.rb +21 -4
  78. data/lib/rails/tasks/documentation.rake +2 -0
  79. data/lib/rails/tasks/framework.rake +22 -0
  80. data/lib/rails/tasks/middleware.rake +1 -1
  81. data/lib/rails/tasks/routes.rake +5 -1
  82. data/lib/rails/test_help.rb +3 -1
  83. data/lib/rails/test_unit/testing.rake +3 -1
  84. data/lib/rails/version.rb +1 -1
  85. metadata +12 -19
  86. data/lib/rails/application/metal_loader.rb +0 -50
  87. data/lib/rails/dispatcher.rb +0 -24
  88. data/lib/rails/generators/rails/mailer/USAGE +0 -15
  89. data/lib/rails/generators/rails/mailer/mailer_generator.rb +0 -14
  90. data/lib/rails/generators/rails/mailer/templates/mailer.rb +0 -16
  91. data/lib/rails/generators/rails/metal/USAGE +0 -8
  92. data/lib/rails/generators/rails/metal/metal_generator.rb +0 -11
  93. 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
@@ -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,8 +0,0 @@
1
- Description:
2
- Cast some metal!
3
-
4
- Examples:
5
- `rails generate metal poller`
6
-
7
- This will create:
8
- Metal: app/metal/poller.rb
@@ -1,11 +0,0 @@
1
- module Rails
2
- module Generators
3
- class MetalGenerator < NamedBase
4
- check_class_collision
5
-
6
- def create_metal_file
7
- template "metal.rb", "app/metal/#{file_name}.rb"
8
- end
9
- end
10
- end
11
- 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